Module: VeracodeApiSigning::Formatters
Constant Summary
Constants included from Regions
Instance Method Summary collapse
-
#format_signing_data(api_key_id, host, url, method) ⇒ String
The formatted signing data.
-
#format_veracode_hmac_header(auth_scheme, api_key_id, timestamp, nonce, signature) ⇒ String
The formatted hmac header.
Methods included from Regions
#get_region_for_api_credential, #remove_prefix_from_api_credential
Instance Method Details
#format_signing_data(api_key_id, host, url, method) ⇒ String
Returns the formatted signing data.
17 18 19 20 21 22 23 24 25 |
# File 'lib/veracode_api_signing/formatters.rb', line 17 def format_signing_data(api_key_id, host, url, method) # Ensure some things are in the right case. # Note: that path (url) is allowed to be case-sensitive (because path is sent along verbatim) api_key_id = remove_prefix_from_api_credential(api_key_id).downcase host = host.downcase method = method.upcase "id=#{api_key_id}&host=#{host}&url=#{url}&method=#{method}" end |
#format_veracode_hmac_header(auth_scheme, api_key_id, timestamp, nonce, signature) ⇒ String
Returns the formatted hmac header.
35 36 37 38 39 |
# File 'lib/veracode_api_signing/formatters.rb', line 35 def format_veracode_hmac_header(auth_scheme, api_key_id, , nonce, signature) # NOTE: This should _NOT_ manipulate case and so-on, that would likely break things. api_key_id = remove_prefix_from_api_credential(api_key_id) "#{auth_scheme} id=#{api_key_id},ts=#{},nonce=#{nonce},sig=#{signature}" end |