AWS Signature Version 4 implementation for server-side verification.
Summary
Functions
Builds a canonical request string per the SigV4 spec.
Builds a string to sign per the SigV4 spec.
Signs a string with the given secret key using the SigV4 key derivation.
Parses an AWS4-HMAC-SHA256 Authorization header.
Parses presigned URL query parameters.
Verifies the signature from an Authorization header.
Verifies a presigned URL signature.
Types
Functions
@spec build_canonical_request(Plug.Conn.t(), [String.t()], String.t()) :: String.t()
Builds a canonical request string per the SigV4 spec.
Builds a string to sign per the SigV4 spec.
Signs a string with the given secret key using the SigV4 key derivation.
@spec parse_auth_header(String.t()) :: {:ok, parsed_header()} | {:error, :invalid_signature}
Parses an AWS4-HMAC-SHA256 Authorization header.
@spec parse_presigned_params(map()) :: {:ok, parsed_presigned()} | {:error, :invalid_signature}
Parses presigned URL query parameters.
@spec verify_header_signature(Plug.Conn.t(), parsed_header(), Firkin.Credential.t()) :: :ok | {:error, :invalid_signature | :credential_not_found}
Verifies the signature from an Authorization header.
@spec verify_presigned_signature( Plug.Conn.t(), parsed_presigned(), Firkin.Credential.t() ) :: :ok | {:error, :invalid_signature | :expired | :credential_not_found}
Verifies a presigned URL signature.