Service/WindowsAzure/Credentials/SharedAccessSignature.php

Show: PublicProtectedPrivateinherited
Table of Contents
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 license@zend.com 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

Package: Zend\Service\WindowsAzure
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

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

Properties

>VPropertyprotectedstring $_accountKey = ''
inherited
Account key for Windows Azure
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountKey
Default value''Details
Type
string
Inherited_from
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountKey  
>VPropertyprotectedstring $_accountName = ''
inherited
Account name for Windows Azure
Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountName
Default value''Details
Type
string
Inherited_from
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_accountName  
>VPropertyprotectedarray $_permissionSet = array()
Permission set
Default valuearray()Details
Type
array
>VPropertyprotectedboolean $_usePathStyleUri = false
Default valuefalseDetails
Type
boolean
Inherited_from
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::$$_usePathStyleUri  

Methods

methodpublic__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

Parameters
NameTypeDescription
$accountNamestring

Account name for Windows Azure

$accountKeystring

Account key for Windows Azure

$usePathStyleUriboolean

Use path-style URI's

$permissionSetarray

Permission set

methodprotected_issetOr(array $array, mixed $key, mixed $valueIfNotSet) : mixed
inherited

Returns an array value if the key is set, otherwide returns $valueIfNotSet

Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::_issetOr()
Parameters
NameTypeDescription
$arrayarray
$keymixed
$valueIfNotSetmixed
Returns
TypeDescription
mixed
methodprotected_makeArrayOfQueryString(string $value) : array
Parameters
NameTypeDescription
$valuestring

Query string

Returns
TypeDescription
arrayArray of key/value pairs
methodprotected_prepareQueryStringForSigning(string $value) : string
Parameters
NameTypeDescription
$valuestring

Original query string

Returns
TypeDescription
stringQuery string for signing
methodpubliccreateSignature(string $path = '/', string $resource = 'b', string $permissions = 'r', string $start = '', string $expiry = '', string $identifier = '') : string

Create signature

Parameters
NameTypeDescription
$pathstring

Path for the request

$resourcestring

Signed resource - container (c) - blob (b)

$permissionsstring

Signed permissions - read (r), write (w), delete (d) and list (l)

$startstring

The time at which the Shared Access Signature becomes valid.

$expirystring

The time at which the Shared Access Signature becomes invalid.

$identifierstring

Signed identifier

Returns
TypeDescription
string
methodpubliccreateSignedQueryString(string $path = '/', string $queryString = '', string $resource = 'b', string $permissions = 'r', string $start = '', string $expiry = '', string $identifier = '') : string

Create signed query string

Parameters
NameTypeDescription
$pathstring

Path for the request

$queryStringstring

Query string for the request

$resourcestring

Signed resource - container (c) - blob (b)

$permissionsstring

Signed permissions - read (r), write (w), delete (d) and list (l)

$startstring

The time at which the Shared Access Signature becomes valid.

$expirystring

The time at which the Shared Access Signature becomes invalid.

$identifierstring

Signed identifier

Returns
TypeDescription
string
methodpublicgetPermissionSet() : array

Get permission set

Returns
TypeDescription
array
methodpublicpermissionMatchesRequest(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?

Parameters
NameTypeDescription
$permissionUrlstring

Permission URL

$requestUrlstring

Request URL

$resourceTypestring

Resource type

$requiredPermissionstring

Required permission

Returns
TypeDescription
stringSigned request URL
methodpublicsetAccountName(string $value = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_ACCOUNT) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
inherited

Set account name for Windows Azure

Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::setAccountName()
Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
methodpublicsetAccountkey(string $value = \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::DEVSTORE_KEY) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
inherited

Set account key for Windows Azure

Inherited from: \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::setAccountkey()
Parameters
NameTypeDescription
$valuestring
Returns
TypeDescription
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
methodpublicsetPermissionSet(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

Parameters
NameTypeDescription
$valuearray

Permission set

methodpublicsetUsePathStyleUri(boolean $value = false) : \Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
Parameters
NameTypeDescription
$valueboolean
Returns
TypeDescription
\Zend_Service_WindowsAzure_Credentials_CredentialsAbstract
methodpublicsignRequestHeaders(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

Parameters
NameTypeDescription
$httpVerbstring

HTTP verb the request will use

$pathstring

Path for the request

$queryStringstring

Query string for the request

$headersarray

x-ms headers to add

$forTableStorageboolean

Is the request for table storage?

$resourceTypestring

Resource type

$requiredPermissionstring

Required permission

$rawDatamixed

Raw post data

Returns
TypeDescription
arrayArray of headers
methodpublicsignRequestUrl(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

Parameters
NameTypeDescription
$requestUrlstring

Request URL

$resourceTypestring

Resource type

$requiredPermissionstring

Required permission

Returns
TypeDescription
stringSigned request URL
Documentation was generated by phpDocumentor 2.0.0a12.