Class: Azure::Storage::Auth::SharedAccessSignatureSigner

Inherits:
Core::Auth::Signer show all
Defined in:
lib/azure/storage/core/auth/shared_access_signature_signer.rb

Instance Attribute Summary collapse

Attributes inherited from Core::Auth::Signer

#access_key

Instance Method Summary collapse

Methods inherited from Core::Auth::Signer

#sign

Constructor Details

#initialize(account_name = Azure::Storage.storage_account_name, sas_token = Azure::Storage.storage_sas_token) ⇒ SharedAccessSignatureSigner

Public: Initialize the Signer with a SharedAccessSignature

Parameters:

  • account_name (String) (defaults to: Azure::Storage.storage_account_name)

    The account name. Defaults to the one in the global configuration.

  • sas_token (String) (defaults to: Azure::Storage.storage_sas_token)

    The sas token to be used for signing


28
29
30
31
# File 'lib/azure/storage/core/auth/shared_access_signature_signer.rb', line 28

def initialize(=Azure::Storage., sas_token=Azure::Storage.storage_sas_token)
  @account_name = 
  @sas_token = sas_token
end

Instance Attribute Details

#account_nameObject (readonly)

Returns the value of attribute account_name


22
23
24
# File 'lib/azure/storage/core/auth/shared_access_signature_signer.rb', line 22

def 
  @account_name
end

Instance Method Details

#sign_request(req) ⇒ Object


33
34
35
36
# File 'lib/azure/storage/core/auth/shared_access_signature_signer.rb', line 33

def sign_request(req)
  ori_uri = req.uri
  URI.parse(ori_uri.to_s + (ori_uri.query.nil? ? '?' : '&') + sas_token.sub(/^\?/,'') + '&api-version=' + Azure::Storage::Default::STG_VERSION)
end