Class: Aliyun::Odps::Authorization

Inherits:
Object
  • Object
show all
Defined in:
lib/aliyun/odps/authorization.rb

Constant Summary collapse

PROVIDER =
'ODPS'

Class Method Summary collapse

Class Method Details

.get_authorization(access_key, secret_key, options = {}) ⇒ String

Get authorization key

Parameters:

  • access_key (String)

    Access Key

  • secret_key (String)

    Secret Key

  • options (Hash) (defaults to: {})

    Options

Options Hash (options):

  • :verb (String)

    VERB, request method

  • :date (String)

    Request Time in formate: ‘%a, %d %b %Y %H:%M:%S GMT’

  • :path (String)

    resource name

  • :query (Hash)

    Query key-value pair

  • :headers (Hash)

    Headers

Returns:

  • (String)

    the authorization string



26
27
28
29
30
# File 'lib/aliyun/odps/authorization.rb', line 26

def get_authorization(access_key, secret_key, options = {})
  content_string = concat_content_string(options[:verb], options[:date], options)
  signature_string = signature(secret_key, content_string)
  "#{PROVIDER} #{access_key}:#{signature_string.strip}"
end