MessageSignatures.Message (MessageSignatures v0.1.0)

Copy Markdown View Source

A transport-agnostic HTTP message used for signing and verification.

Header names are stored lowercased with their original order preserved. Binary method values retain their case. Standard method atoms are accepted as shorthand for their conventional uppercase spelling. Values remain raw until accessed through field_value/2 or field_instances/2, which apply RFC 9421 field canonicalization.

Summary

Types

headers()

@type headers() :: [{String.t(), String.t()}]

t()

@type t() :: %MessageSignatures.Message{
  headers: headers(),
  kind: :request | :response,
  method: String.t() | nil,
  request: t() | nil,
  status: 100..599 | nil,
  trailers: headers(),
  uri: URI.t() | nil
}

Functions

field_instances(message, name)

@spec field_instances(t(), String.t()) :: [String.t()]

field_value(message, name)

@spec field_value(t(), String.t()) :: {:ok, String.t()} | :error

from_request(opts)

@spec from_request(keyword()) :: t()

from_response(opts)

@spec from_response(keyword()) :: t()