Service/WindowsAzure/Credentials/SharedAccessSignature.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Service_WindowsAzure
- Version
- $Id: SharedAccessSignature.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Service_WindowsAzure_Credentials_SharedAccessSignature
- Parent(s)
- \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants

DEVSTORE_ACCOUNT
= "devstoreaccount1"
Development storage account and key
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT
DEVSTORE_KEY
= "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="

PREFIX_PROPERTIES
= "x-ms-prop-"
HTTP header prefixes
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_PROPERTIES
PREFIX_METADATA
= "x-ms-meta-"

PREFIX_STORAGE_HEADER
= "x-ms-"

PERMISSION_READ
= "r"
Permissions
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ
PERMISSION_WRITE
= "w"

PERMISSION_DELETE
= "d"

PERMISSION_LIST
= "l"
Properties


string $_accountKey = ''
Account key for Windows Azure
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountKey''
Details- Type
- string
- Inherited_from
- \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountKey


string $_accountName = ''
Account name for Windows Azure
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountName''
Details- Type
- string
- Inherited_from
- \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountName


boolean $_usePathStyleUri = false
Use path-style URI's
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_usePathStyleUrifalse
Details- Type
- boolean
- Inherited_from
- \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_usePathStyleUri
Methods


__construct(string $accountName = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT, string $accountKey = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY, boolean $usePathStyleUri = false, array $permissionSet = array()) : void
Creates a new Zend_Service_WindowsAzure_Credentials_SharedAccessSignature instance
Name | Type | Description |
---|---|---|
$accountName | string | Account name for Windows Azure |
$accountKey | string | Account key for Windows Azure |
$usePathStyleUri | boolean | Use path-style URI's |
$permissionSet | array | Permission set |


_issetOr(array $array, mixed $key, mixed $valueIfNotSet) : mixed
Returns an array value if the key is set, otherwide returns $valueIfNotSet
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::_issetOr()Name | Type | Description |
---|---|---|
$array | array | |
$key | mixed | |
$valueIfNotSet | mixed |
Type | Description |
---|---|
mixed |


_makeArrayOfQueryString(string $value) : array
Make array of query string
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::_makeArrayOfQueryString()Name | Type | Description |
---|---|---|
$value | string | Query string |
Type | Description |
---|---|
array | Array of key/value pairs |


_prepareQueryStringForSigning(string $value) : string
Prepare query string for signing
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::_prepareQueryStringForSigning()Name | Type | Description |
---|---|---|
$value | string | Original query string |
Type | Description |
---|---|
string | Query string for signing |


createSignature(string $path = '/', string $resource = 'b', string $permissions = 'r', string $start = '', string $expiry = '', string $identifier = '') : string
Create signature
Name | Type | Description |
---|---|---|
$path | string | Path for the request |
$resource | string | Signed resource - container (c) - blob (b) |
$permissions | string | Signed permissions - read (r), write (w), delete (d) and list (l) |
$start | string | The time at which the Shared Access Signature becomes valid. |
$expiry | string | The time at which the Shared Access Signature becomes invalid. |
$identifier | string | Signed identifier |
Type | Description |
---|---|
string |


createSignedQueryString(string $path = '/', string $queryString = '', string $resource = 'b', string $permissions = 'r', string $start = '', string $expiry = '', string $identifier = '') : string
Create signed query string
Name | Type | Description |
---|---|---|
$path | string | Path for the request |
$queryString | string | Query string for the request |
$resource | string | Signed resource - container (c) - blob (b) |
$permissions | string | Signed permissions - read (r), write (w), delete (d) and list (l) |
$start | string | The time at which the Shared Access Signature becomes valid. |
$expiry | string | The time at which the Shared Access Signature becomes invalid. |
$identifier | string | Signed identifier |
Type | Description |
---|---|
string |


permissionMatchesRequest(string $permissionUrl = '', string $requestUrl = '', string $resourceType = \Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, string $requiredPermission = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ) : string
Permission matches request?
Name | Type | Description |
---|---|---|
$permissionUrl | string | Permission URL |
$requestUrl | string | Request URL |
$resourceType | string | Resource type |
$requiredPermission | string | Required permission |
Type | Description |
---|---|
string | Signed request URL |


setAccountName(string $value = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
Set account name for Windows Azure
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::setAccountName()Name | Type | Description |
---|---|---|
$value | string |
Type | Description |
---|---|
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract |


setAccountkey(string $value = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
Set account key for Windows Azure
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::setAccountkey()Name | Type | Description |
---|---|---|
$value | string |
Type | Description |
---|---|
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract |


setPermissionSet(array $value = array()) : void
Set permisison set
Warning: fine-grained permissions should be added prior to coarse-grained permissions. For example: first add blob permissions, end with container-wide permissions.
Warning: the signed access signature URL must match the account name of the Zend_Service_WindowsAzure_Credentials_Zend_Service_WindowsAzure_Credentials_SharedAccessSignature instance
Name | Type | Description |
---|---|---|
$value | array | Permission set |


setUsePathStyleUri(boolean $value = false) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
Set use path-style URI's
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::setUsePathStyleUri()Name | Type | Description |
---|---|---|
$value | boolean |
Type | Description |
---|---|
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract |


signRequestHeaders(string $httpVerb = \Zend_Http_Client::GET, string $path = '/', string $queryString = '', array $headers = null, boolean $forTableStorage = false, string $resourceType = \Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, string $requiredPermission = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ, mixed $rawData = null) : array
Sign request with credentials
Name | Type | Description |
---|---|---|
$httpVerb | string | HTTP verb the request will use |
$path | string | Path for the request |
$queryString | string | Query string for the request |
$headers | array | x-ms headers to add |
$forTableStorage | boolean | Is the request for table storage? |
$resourceType | string | Resource type |
$requiredPermission | string | Required permission |
$rawData | mixed | Raw post data |
Type | Description |
---|---|
array | Array of headers |


signRequestUrl(string $requestUrl = '', string $resourceType = \Zend_Service_WindowsAzure_Storage::RESOURCE_UNKNOWN, string $requiredPermission = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PERMISSION_READ) : string
Sign request URL with credentials
Name | Type | Description |
---|---|---|
$requestUrl | string | Request URL |
$resourceType | string | Resource type |
$requiredPermission | string | Required permission |
Type | Description |
---|---|
string | Signed request URL |