Open LecrisUT opened 2 years ago
Interesting; why do you need this?
In go-gitea/gitea#18340, I am decoupling the letsencrypt TOS and generalizing to arbitrary ones defined in the directory meta. So I want to link them to the TOS if the default of not accepting TOS is on, and offer a first-time interactive option to read and accept them, similar to PreCheck
.
What would you like to have changed?
Either expose
ACMEManager.newACMEClientWithAccount
, add this initialization inACMEManager.PreCheck
with the sameinteractive
flag, or add a new function altogether to manuallyInitializeAccount
.Why is this feature a useful, necessary, and/or important addition to this project?
The goal is to have a check whether or not the cached account has accepted the TOS, or if in
interative
mode, prompt the user to accept/decline with the link to the TOS. Fetching and exposing the Acme meta directory would also be useful. I am nut sure which approach makes more sense in the given flow, but I am leaning towards separating the TOS code in https://github.com/caddyserver/certmagic/blob/b6b3db32bcd5f87d56bc0fba1db708499259653a/acmeclient.go#L70-L123 and adding another function to initialize the account (interactively, error if not accepted) or checkAccount.TermsOfServiceAgreed
if already exists.I will try to write a PR with this idea if you think it's ok.