lib/mongo/auth/aws/request.rb
# Returns the calculated signature of the canonical request, per
# the AWS signature V4 specification.
#
# @return [ String ] The signature.
Returns the calculated signature of the canonical request, per
the AWS signature V4 specification.
Returns the calculated signature of the canonical request per the AWS signature V4 specification .
def signature
          hashed_canonical_request = Digest::SHA256.hexdigest(canonical_request)
          hashed_body = Digest::SHA256.new.update(STS_REQUEST_BODY).hexdigest
          string_to_sign = "AWS4-HMAC-SHA256\n" +
            "#{formatted_time}\n" +
            "#{scope}\n" +
            hashed_canonical_request
          mac = hmac("AWS4#{secret_access_key}", formatted_date)
          mac = hmac(mac, region)
          mac = hmac(mac, 'sts')
          signing_key = hmac(mac, 'aws4_request')
          hmac_hex(signing_key, string_to_sign)
        end
def signature hashed_canonical_request = Digest :: SHA256 . hexdigest ( canonical_request ) hashed_body = Digest :: SHA256 . new . update ( STS_REQUEST_BODY ) . hexdigest string_to_sign = "AWS4-HMAC-SHA256\n" + "#{formatted_time}\n" + "#{scope}\n" + hashed_canonical_request mac = hmac ( "AWS4#{secret_access_key}" , formatted_date ) mac = hmac ( mac , region ) mac = hmac ( mac , 'sts' ) signing_key = hmac ( mac , 'aws4_request' ) hmac_hex ( signing_key , string_to_sign ) end
Returns the calculated signature of the canonical request, per
the AWS signature V4 specification.
Returns the calculated signature of the canonical request per the AWS signature V4 specification .
# All of the intermediate HMAC operations are not hex-encoded. # Only the final HMAC operation is hex-encoded.
None
 String 