Class: VeracodeApiSigning::HMACAuth
- Inherits:
-
Object
- Object
- VeracodeApiSigning::HMACAuth
- Includes:
- Formatters, Regions, Utils, Validation
- Defined in:
- lib/veracode_api_signing/hmac_auth.rb
Constant Summary collapse
- DEFAULT_AUTH_SCHEME =
"VERACODE-HMAC-SHA-256"
Constants included from Regions
Instance Method Summary collapse
-
#generate_veracode_hmac_header(host, path, method, api_key_id, api_key_secret, auth_scheme = DEFAULT_AUTH_SCHEME) ⇒ String
The value of Veracode compliant HMAC header.
Methods included from Regions
#get_region_for_api_credential, #remove_prefix_from_api_credential
Methods included from Formatters
#format_signing_data, #format_veracode_hmac_header
Methods included from Utils
#generate_nonce, #get_current_timestamp, #get_host_from_url, #get_path_and_params_from_url, #get_scheme_from_url, #parsed_url
Methods included from Validation
#valid_hex?, #validate_api_key_id, #validate_api_key_secret, #validate_scheme
Instance Method Details
#generate_veracode_hmac_header(host, path, method, api_key_id, api_key_secret, auth_scheme = DEFAULT_AUTH_SCHEME) ⇒ String
Returns The value of Veracode compliant HMAC header.
26 27 28 29 30 31 32 |
# File 'lib/veracode_api_signing/hmac_auth.rb', line 26 def generate_veracode_hmac_header(host, path, method, api_key_id, api_key_secret, auth_scheme = DEFAULT_AUTH_SCHEME) signing_data = format_signing_data(api_key_id, host, path, method) = nonce = generate_nonce signature = create_signature(auth_scheme, api_key_secret, signing_data, , nonce) format_veracode_hmac_header(auth_scheme, api_key_id, , nonce, signature) end |