Class: Mixlib::Authentication::SigningObject

Inherits:
Struct
  • Object
show all
Includes:
SignedHeaderAuth
Defined in:
lib/mixlib/authentication/signedheaderauth.rb

Overview

SigningObject

A Struct-based value object that contains the necessary information to generate a request signature. ‘SignedHeaderAuth.signing_object()` provides a more convenient interface to the constructor.

Constant Summary

Constants included from SignedHeaderAuth

Mixlib::Authentication::SignedHeaderAuth::ALGORITHM_FOR_VERSION, Mixlib::Authentication::SignedHeaderAuth::DEFAULT_PROTO_VERSION, Mixlib::Authentication::SignedHeaderAuth::DEFAULT_SIGN_ALGORITHM, Mixlib::Authentication::SignedHeaderAuth::NULL_ARG, Mixlib::Authentication::SignedHeaderAuth::SUPPORTED_ALGORITHMS, Mixlib::Authentication::SignedHeaderAuth::SUPPORTED_VERSIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SignedHeaderAuth

#algorithm, #canonicalize_request, #do_sign, #do_sign_ssh_agent, #hashed_body, #sign, signing_object, #validate_sign_version_digest!

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def body
  @body
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def file
  @file
end

#headersObject

Returns the value of attribute headers

Returns:

  • (Object)

    the current value of headers



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def headers
  @headers
end

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def host
  @host
end

#http_methodObject

Returns the value of attribute http_method

Returns:

  • (Object)

    the current value of http_method



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def http_method
  @http_method
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def path
  @path
end

#proto_versionObject

Returns the value of attribute proto_version

Returns:

  • (Object)

    the current value of proto_version



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def proto_version
  @proto_version
end

#timestampObject

Returns the value of attribute timestamp

Returns:

  • (Object)

    the current value of timestamp



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def timestamp
  @timestamp
end

#user_idObject

Returns the value of attribute user_id

Returns:

  • (Object)

    the current value of user_id



343
344
345
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 343

def user_id
  @user_id
end

Instance Method Details

#server_api_versionObject



353
354
355
356
357
358
359
360
361
362
# File 'lib/mixlib/authentication/signedheaderauth.rb', line 353

def server_api_version
  key = (self[:headers] || {}).keys.select do |k|
    k.casecmp("x-ops-server-api-version") == 0
  end.first
  if key
    self[:headers][key]
  else
    DEFAULT_SERVER_API_VERSION
  end
end