| Module | Mixlib::Authentication::SignedHeaderAuth |
| In: |
lib/mixlib/authentication/signedheaderauth.rb
|
| NULL_ARG | = | Object.new | ||
| ALGORITHM_FOR_VERSION | = | { "1.0" => "sha1", "1.1" => "sha1", "1.3" => "sha256", }.freeze() | ||
| SUPPORTED_ALGORITHMS | = | ["sha1"].freeze | Use of SUPPORTED_ALGORITHMS and SUPPORTED_VERSIONS is deprecated. Use ALGORITHM_FOR_VERSION instead | |
| SUPPORTED_VERSIONS | = | ["1.0", "1.1"].freeze | ||
| DEFAULT_SIGN_ALGORITHM | = | "sha1".freeze | ||
| DEFAULT_PROTO_VERSION | = | "1.0".freeze |
This is the intended interface for signing requests with the Opscode/Chef signed header protocol. This wraps the constructor for a Struct that contains the relevant information about your request.
These parameters are used to generate the canonical representation of the request, which is then hashed and encrypted to generate the request‘s signature. These options are all required, with the exception of `:body` and `:file`, which are alternate ways to specify the request body (you must specify one of these).
These parameters are accepted but not used in the computation of the signature.
Low-level RSA signature implementation used in {sign}.
@api private @param rsa_key [OpenSSL::PKey::RSA] User‘s RSA key. If `use_ssh_agent` is
true, this must have the public key portion populated. If `use_ssh_agent` is false, this must have the private key portion populated.
@param digest [Class] Sublcass of OpenSSL::Digest to use while signing. @param sign_algorithm [String] Hash algorithm to use while signing. @param sign_version [String] Version number of the signing protocol to use. @param use_ssh_agent [Boolean] If true, use ssh-agent for request signing. @return [String]
Low-level signing logic for using ssh-agent. This requires the user has already set up ssh-agent and used ssh-add to load in a (possibly encrypted) RSA private key. ssh-agent supports keys other than RSA, however they are not supported as Chef‘s protocol explicitly requires RSA keys/sigs.
@api private @param rsa_key [OpenSSL::PKey::RSA] User‘s RSA public key. @param string_to_sign [String] String data to sign with the requested key. @return [String]
Build the canonicalized request based on the method, other headers, etc. compute the signature from the request, using the looked-up user secret
@param rsa_key [OpenSSL::PKey::RSA] User‘s RSA key. If `use_ssh_agent` is
true, this must have the public key portion populated. If `use_ssh_agent` is false, this must have the private key portion populated.
@param use_ssh_agent [Boolean] If true, use ssh-agent for request signing.