class Kemal::Hmac::Client
- Kemal::Hmac::Client
- Reference
- Object
Defined in:
kemal-hmac/client.crConstructors
-
.new(client : String, secret : String, algorithm : String | Nil = "SHA256")
client
the client name which will be sending HTTP requests to the server using HMAC auth (String)secret
the secret used to generate the HMAC token in relation to the client (String)algorithm
the algorithm used to generate the HMAC token (String) - defaults to SHA256
Instance Method Summary
-
#generate_headers(path : String) : Hash(String, String)
A public helper method to generate the HMAC headers for a given path Use this method to get pre-filled headers to send with your request to the server
path
the path (HTTP path) to generate the headers for (String) - e.g.
Constructor Detail
client
the client name which will be sending HTTP requests to the server using HMAC auth (String)
secret
the secret used to generate the HMAC token in relation to the client (String)
algorithm
the algorithm used to generate the HMAC token (String) - defaults to SHA256
Instance Method Detail
A public helper method to generate the HMAC headers for a given path
Use this method to get pre-filled headers to send with your request to the server
path
the path (HTTP path) to generate the headers for (String) - e.g. "/api/path"
returns a Hash of the HMAC headers