acumen/fetch_authorization

Fetch an ACME authorization.

After creating an order, fetch each authorization to see the available challenges for proving domain control.

Example

import acumen
import acumen/authorization.{type Authorization}
import acumen/fetch_authorization

let assert Ok(#(resp, ctx)) = acumen.execute(
  ctx,
  build: fetch_authorization.build(auth_url, _, registered_key),
  send: httpc.send,
)

let assert Ok(auth) = fetch_authorization.response(resp, auth_url)

Values

pub fn build(
  url: url.Url,
  context: acumen.Context,
  key: acumen.RegisteredKey,
) -> Result(request.Request(String), acumen.AcmeError)

Builds a signed POST-as-GET request to fetch an authorization.

pub fn response(
  resp: response.Response(String),
  url url: url.Url,
) -> Result(authorization.Authorization, acumen.AcmeError)

Parses an authorization fetch response.

Search Document