ExAcme.Challenge (ExAcme v0.2.0)
View SourceRepresents an ACME Challenge object.
Provides functionalities to handle challenges required for validation.
Attributes
url
- The URL of the challenge.status
- The current status of the challenge.type
- The type of challenge (e.g., "dns-01").token
- The challenge token.validated
- Datetime when the challenge was validated.error
- Any error associated with the challenge.
Summary
Functions
Fetches a challenge from the ACME server.
Finds a challenge of a specific type within an authorization.
Generates the key authorization string for a challenge.
Triggers the validation of a challenge.
Types
Functions
@spec fetch(String.t(), ExAcme.AccountKey.t(), ExAcme.client()) :: {:ok, t()} | {:error, term()}
Fetches a challenge from the ACME server.
Parameters
url
- The challenge URL.account_key
- The account key for authentication.client
- The ExAcme client agent.
Returns
{:ok, challenge}
on success.{:error, reason}
on failure.
Finds a challenge of a specific type within an authorization.
Parameters
authorization
- The authorization map.type
- The type of challenge to find (e.g., "dns-01").
Returns
- The challenge object if found, else
nil
.
@spec key_authorization(String.t(), ExAcme.AccountKey.t()) :: String.t()
Generates the key authorization string for a challenge.
Parameters
token
- The challenge token.account_key
- The account key.
Returns
- The key authorization string.
@spec trigger_validation(String.t(), ExAcme.AccountKey.t(), ExAcme.client()) :: {:ok, t()} | {:error, term()}
Triggers the validation of a challenge.
Parameters
url
- The challenge URL.account_key
- The account key for authentication.client
- The ExAcme client agent.
Returns
{:ok, challenge}
on success.{:error, reason}
on failure.