acumen/update_account
Update an existing ACME account.
After registration, you can update your account by posting to the account URL. Per RFC 8555, you can update:
contact: Contact URLs for the accounttermsOfServiceAgreed: Agreement to terms of servicestatus: Set to “deactivated” to deactivate the account (Section 7.3.6)
The server ignores updates to orders and unrecognized fields.
Example
import acumen
import acumen/update_account
// Update contact information
let update = update_account.request()
|> update_account.contacts(["mailto:new-admin@example.com"])
// Or deactivate the account
let deactivate = update_account.request()
|> update_account.deactivate
let assert Ok(#(resp, ctx)) = acumen.execute(
ctx,
build: update_account.build(update, _, registered_key),
send: httpc.send,
)
let assert Ok(account) = update_account.response(resp)
Types
Request builder for account updates.
Create with request(), configure with contacts(), agree_to_terms(),
or deactivate(), then pass to build().
pub opaque type RequestBuilder
Values
pub fn agree_to_terms(builder: RequestBuilder) -> RequestBuilder
Indicates agreement to the ACME server’s terms of service.
The ToS URL is available in directory.meta.terms_of_service.
pub fn build(
builder: RequestBuilder,
context: acumen.Context,
key: acumen.RegisteredKey,
) -> Result(request.Request(String), acumen.AcmeError)
Builds the signed HTTP request for account update.
Only includes fields that were explicitly set on the builder; omitted fields are left unchanged on the server.
pub fn contacts(
builder: RequestBuilder,
contacts: List(String),
) -> RequestBuilder
Sets the new contact URLs for the account.
Contact URLs are typically mailto: addresses where the CA can reach you
about certificate expiration, policy changes, or security issues.
pub fn deactivate(builder: RequestBuilder) -> RequestBuilder
Marks the account for deactivation.
Once deactivated, the account cannot be used for any further operations. This action is permanent.
pub fn request() -> RequestBuilder
Creates a new account update request builder with no changes set.
Example
let update = update_account.request()
|> update_account.contacts(["mailto:new@example.com"])
pub fn response(
resp: response.Response(String),
) -> Result(account.Account, acumen.AcmeError)
Parses the account update response.
Returns the full account state after the update, including any fields that were not modified.