Method: ChefAPI::Authentication#initialize

Defined in:
lib/chef-api/authentication.rb

#initialize(user, key, verb, path, body) ⇒ Authentication

Create a new Authentication object for signing. Creating an instance will not run any validations or perform any operations (this is on purpose).

Parameters:

  • user (String)

    the username/client/user of the user to sign the request. In Hosted Chef land, this is your “client”. In Supermarket land, this is your “username”.

  • key (String, OpenSSL::PKey::RSA)

    the path to a private key on disk, the raw private key (as a String), or the raw private key (as an OpenSSL::PKey::RSA instance)

  • verb (Symbol, String)

    the verb for the request (e.g. :get)

  • path (String)

    the “path” part of the URI (e.g. /path/to/resource)

  • body (String, IO)

    the body to sign for the request, as a raw string or an IO object to be read in chunks



72
73
74
75
76
77
78
# File 'lib/chef-api/authentication.rb', line 72

def initialize(user, key, verb, path, body)
  @user = user
  @key  = key
  @verb = verb
  @path = path
  @body = body
end