Documentation

Auth extends AbstractAuth
in package

Azure storage auth class

This class is ported over from the discontinued Azure Storage PHP library at https://github.com/Azure/azure-storage-php (EOL: 3/17/2024)

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
2.0.0

Table of Contents

Properties

$accountKey  : string|null
Account key
$accountName  : string|null
Account name
$includedHeaders  : array<string|int, mixed>
The included headers

Methods

__construct()  : mixed
Constructor.
formatHeaders()  : array<string|int, mixed>
Convert a http headers array into a uniformed format for further process
getAccountKey()  : string|null
Get account key
getAccountName()  : string|null
Get account name
getAuthorizationHeader()  : string
Returns authorization header to be included in the request.
getBaseUri()  : string
Get account key
hasAccountKey()  : bool
Has account key
hasAccountName()  : bool
Has account name
setAccountKey()  : AbstractAuth
Set account key
setAccountName()  : AbstractAuth
Set account name
signRequest()  : Request
Adds authentication header to the request headers.
startsWith()  : bool
Checks if the passed $string starts with $prefix
tryGetValue()  : mixed
Returns the specified value of the $key passed from $array and in case that this $key doesn't exist, the default value is returned.
tryGetValueInsensitive()  : mixed
Returns the specified value of the $key passed from $array and in case that this $key doesn't exist, the default value is returned. The key matching is done in a case-insensitive manner.
computeCanonicalizedHeaders()  : array<string|int, mixed>
Computes canonicalized headers for headers array.
computeCanonicalizedResource()  : string
Computes canonicalized resources from URL.
computeCanonicalizedResourceForTable()  : string
Computes canonicalized resources from URL using Table formar
computeSignature()  : string
Computes the authorization signature for blob and queue shared key.

Properties

$accountKey

Account key

protected string|null $accountKey = null

$accountName

Account name

protected string|null $accountName = null

$includedHeaders

The included headers

protected array<string|int, mixed> $includedHeaders = ['content-encoding', 'content-language', 'content-length', 'content-md5', 'content-type', 'date', 'if-modified-since', 'if-match', 'if-none-match', 'if-unmodified-since', 'range']

Methods

__construct()

Constructor.

public __construct(string $accountName, string $accountKey) : mixed
Parameters
$accountName : string
$accountKey : string

formatHeaders()

Convert a http headers array into a uniformed format for further process

public static formatHeaders(array<string|int, mixed> $headers) : array<string|int, mixed>
Parameters
$headers : array<string|int, mixed>
Return values
array<string|int, mixed>

getAccountKey()

Get account key

public getAccountKey() : string|null
Return values
string|null

getAccountName()

Get account name

public getAccountName() : string|null
Return values
string|null

getAuthorizationHeader()

Returns authorization header to be included in the request.

public getAuthorizationHeader(array<string|int, mixed> $headers, string $url, array<string|int, mixed> $queryParams, string $httpMethod) : string
Parameters
$headers : array<string|int, mixed>
$url : string
$queryParams : array<string|int, mixed>
$httpMethod : string
Return values
string

getBaseUri()

Get account key

public getBaseUri() : string
Return values
string

hasAccountKey()

Has account key

public hasAccountKey() : bool
Return values
bool

hasAccountName()

Has account name

public hasAccountName() : bool
Return values
bool

signRequest()

Adds authentication header to the request headers.

public signRequest(Request $request) : Request
Parameters
$request : Request
Return values
Request

startsWith()

Checks if the passed $string starts with $prefix

public static startsWith(string $string, string $prefix[, bool $ignoreCase = false ]) : bool
Parameters
$string : string
$prefix : string
$ignoreCase : bool = false
Return values
bool

tryGetValue()

Returns the specified value of the $key passed from $array and in case that this $key doesn't exist, the default value is returned.

public static tryGetValue(array<string|int, mixed> $array, mixed $key[, mixed $default = null ]) : mixed
Parameters
$array : array<string|int, mixed>
$key : mixed
$default : mixed = null

tryGetValueInsensitive()

Returns the specified value of the $key passed from $array and in case that this $key doesn't exist, the default value is returned. The key matching is done in a case-insensitive manner.

public static tryGetValueInsensitive(string $key, array<string|int, mixed> $haystack[, mixed $default = null ]) : mixed
Parameters
$key : string
$haystack : array<string|int, mixed>
$default : mixed = null

computeCanonicalizedHeaders()

Computes canonicalized headers for headers array.

protected computeCanonicalizedHeaders(array<string|int, mixed> $headers) : array<string|int, mixed>
Parameters
$headers : array<string|int, mixed>
Return values
array<string|int, mixed>

computeCanonicalizedResource()

Computes canonicalized resources from URL.

protected computeCanonicalizedResource(string $url, array<string|int, mixed> $queryParams) : string
Parameters
$url : string
$queryParams : array<string|int, mixed>
Return values
string

computeCanonicalizedResourceForTable()

Computes canonicalized resources from URL using Table formar

protected computeCanonicalizedResourceForTable(string $url, array<string|int, mixed> $queryParams) : string
Parameters
$url : string
$queryParams : array<string|int, mixed>
Return values
string

computeSignature()

Computes the authorization signature for blob and queue shared key.

protected computeSignature(array<string|int, mixed> $headers, string $url, array<string|int, mixed> $queryParams, string $httpMethod) : string
Parameters
$headers : array<string|int, mixed>
$url : string
$queryParams : array<string|int, mixed>
$httpMethod : string
Return values
string

        
On this page

Search results