const ( // Error types that can be used in ACME payloads. These are sorted in the // same order as they are defined in RFC8555 Section 6.7. We do not implement // the `compound`, `externalAccountRequired`, or `userActionRequired` errors, // because we have no path that would return them. AccountDoesNotExistProblem = ProblemType("accountDoesNotExist") AlreadyRevokedProblem = ProblemType("alreadyRevoked") BadCSRProblem = ProblemType("badCSR") BadNonceProblem = ProblemType("badNonce") BadPublicKeyProblem = ProblemType("badPublicKey") BadRevocationReasonProblem = ProblemType("badRevocationReason") BadSignatureAlgorithmProblem = ProblemType("badSignatureAlgorithm") CAAProblem = ProblemType("caa") ConnectionProblem = ProblemType("connection") DNSProblem = ProblemType("dns") InvalidContactProblem = ProblemType("invalidContact") MalformedProblem = ProblemType("malformed") OrderNotReadyProblem = ProblemType("orderNotReady") RateLimitedProblem = ProblemType("rateLimited") RejectedIdentifierProblem = ProblemType("rejectedIdentifier") ServerInternalProblem = ProblemType("serverInternal") TLSProblem = ProblemType("tls") = ProblemType("unauthorized") UnsupportedContactProblem = ProblemType("unsupportedContact") UnsupportedIdentifierProblem = ProblemType("unsupportedIdentifier") ErrorNS = "urn:ietf:params:acme:error:" )
ProblemDetails objects represent problem documents https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00
type ProblemDetails struct { Type ProblemType `json:"type,omitempty"` Detail string `json:"detail,omitempty"` // HTTPStatus is the HTTP status code the ProblemDetails should probably be sent // as. HTTPStatus int `json:"status,omitempty"` // SubProblems are optional additional per-identifier problems. See // RFC 8555 Section 6.7.1: https://tools.ietf.org/html/rfc8555#section-6.7.1 SubProblems []SubProblemDetails `json:"subproblems,omitempty"` }
func AccountDoesNotExist(detail string) *ProblemDetails
AccountDoesNotExist returns a ProblemDetails representing an AccountDoesNotExistProblem error
func AlreadyRevoked(detail string, a ...any) *ProblemDetails
AlreadyRevoked returns a ProblemDetails with a AlreadyRevokedProblem and a 400 Bad Request status code.
func BadCSR(detail string, a ...any) *ProblemDetails
BadCSR returns a ProblemDetails representing a BadCSRProblem.
func BadNonce(detail string) *ProblemDetails
BadNonce returns a ProblemDetails with a BadNonceProblem and a 400 Bad Request status code.
func BadPublicKey(detail string, a ...any) *ProblemDetails
BadPublicKey returns a ProblemDetails with a BadPublicKeyProblem and a 400 Bad Request status code.
func BadRevocationReason(detail string, a ...any) *ProblemDetails
BadRevocationReason returns a ProblemDetails representing a BadRevocationReasonProblem
func BadSignatureAlgorithm(detail string, a ...any) *ProblemDetails
BadSignatureAlgorithm returns a ProblemDetails with a BadSignatureAlgorithmProblem and a 400 Bad Request status code.
func CAA(detail string) *ProblemDetails
CAA returns a ProblemDetails representing a CAAProblem
func Canceled(detail string, a ...any) *ProblemDetails
Canceled returns a ProblemDetails with a MalformedProblem and a 408 Request Timeout status code.
func Conflict(detail string) *ProblemDetails
Conflict returns a ProblemDetails with a MalformedProblem and a 409 Conflict status code.
func Connection(detail string) *ProblemDetails
Connection returns a ProblemDetails representing a ConnectionProblem error
func ContentLengthRequired() *ProblemDetails
ContentLengthRequired returns a ProblemDetails representing a missing Content-Length header error
func DNS(detail string) *ProblemDetails
DNS returns a ProblemDetails representing a DNSProblem
func InvalidContact(detail string) *ProblemDetails
InvalidContact returns a ProblemDetails representing an InvalidContactProblem.
func InvalidContentType(detail string) *ProblemDetails
InvalidContentType returns a ProblemDetails suitable for a missing ContentType header, or an incorrect ContentType header
func Malformed(detail string, a ...any) *ProblemDetails
Malformed returns a ProblemDetails with a MalformedProblem and a 400 Bad Request status code.
func MethodNotAllowed() *ProblemDetails
MethodNotAllowed returns a ProblemDetails representing a disallowed HTTP method error.
func NotFound(detail string) *ProblemDetails
NotFound returns a ProblemDetails with a MalformedProblem and a 404 Not Found status code.
func OrderNotReady(detail string, a ...any) *ProblemDetails
OrderNotReady returns a ProblemDetails representing a OrderNotReadyProblem
func RateLimited(detail string) *ProblemDetails
RateLimited returns a ProblemDetails representing a RateLimitedProblem error
func RejectedIdentifier(detail string) *ProblemDetails
RejectedIdentifier returns a ProblemDetails with a RejectedIdentifierProblem and a 400 Bad Request status code.
func ServerInternal(detail string) *ProblemDetails
ServerInternal returns a ProblemDetails with a ServerInternalProblem and a 500 Internal Server Failure status code.
func TLS(detail string) *ProblemDetails
TLS returns a ProblemDetails representing a TLSProblem error
func Unauthorized(detail string) *ProblemDetails
Unauthorized returns a ProblemDetails with an UnauthorizedProblem and a 403 Forbidden status code.
func UnsupportedContact(detail string) *ProblemDetails
UnsupportedContact returns a ProblemDetails representing an UnsupportedContactProblem
func UnsupportedIdentifier(detail string, a ...any) *ProblemDetails
UnsupportedIdentifier returns a ProblemDetails representing an UnsupportedIdentifierProblem
func (pd *ProblemDetails) Error() string
func (pd *ProblemDetails) WithSubProblems(subProbs []SubProblemDetails) *ProblemDetails
WithSubProblems returns a new ProblemsDetails instance created by adding the provided subProbs to the existing ProblemsDetail.
ProblemType defines the error types in the ACME protocol
type ProblemType string
SubProblemDetails represents sub-problems specific to an identifier that are related to a top-level ProblemDetails. See RFC 8555 Section 6.7.1: https://tools.ietf.org/html/rfc8555#section-6.7.1
type SubProblemDetails struct { ProblemDetails Identifier identifier.ACMEIdentifier `json:"identifier"` }