Class: Azure::Storage::Common::Core::Auth::TokenSigner
- Inherits:
-
Core::Auth::Signer
- Object
- Core::Auth::Signer
- Azure::Storage::Common::Core::Auth::TokenSigner
- Defined in:
- lib/azure/storage/common/core/auth/token_signer.rb
Instance Method Summary collapse
-
#initialize(token_credential) ⇒ TokenSigner
constructor
Public: Initialize the Token Signer.
- #sign_request(req) ⇒ Object
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 |