Class: Azure::Core::Auth::Authorizer

Inherits:
Object
  • Object
show all
Defined in:
lib/azure/core/auth/authorizer.rb

Instance Method Summary collapse

Instance Method Details

#sign(request, signer) ⇒ Object

Public: Signs an HTTP request before it’s made, by adding the Authorization header

request - An Azure::Core::HttpRequest that hasn’t been signed signer - A signing strategy, such as Azure::Table::Auth::SharedKey

Returns the modified request



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

def sign(request, signer)
  signature = signer.sign(request.method, request.uri, request.headers)
  request.headers['Authorization'] = "#{signer.name} #{signature}"
  request
end