Class: Azure::Storage::Common::Core::Auth::TokenSigner

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

Instance Attribute Summary

Attributes inherited from Core::Auth::Signer

#access_key

Instance Method Summary collapse

Methods inherited from Core::Auth::Signer

#sign

Constructor Details

#initialize(token_credential) ⇒ TokenSigner

Public: Initialize the Token Signer



31
32
33
34
35
# File 'lib/azure/storage/common/core/auth/token_signer.rb', line 31

def initialize(token_credential)
  @credential = token_credential
  # Use mock key to initialize super class
  super(Base64.strict_encode64("accesstoken"))
end

Instance Method Details

#sign_request(req) ⇒ Object



37
38
39
40
# File 'lib/azure/storage/common/core/auth/token_signer.rb', line 37

def sign_request(req)
  req.headers['Authorization'] = "Bearer #{@credential.token}"
  req
end