boulder: github.com/letsencrypt/boulder/probs Index | Files

package probs

import "github.com/letsencrypt/boulder/probs"

Index

Package Files

probs.go

Constants

const (
    ConnectionProblem            = ProblemType("connection")
    MalformedProblem             = ProblemType("malformed")
    ServerInternalProblem        = ProblemType("serverInternal")
    TLSProblem                   = ProblemType("tls")
    UnauthorizedProblem          = ProblemType("unauthorized")
    RateLimitedProblem           = ProblemType("rateLimited")
    BadNonceProblem              = ProblemType("badNonce")
    InvalidEmailProblem          = ProblemType("invalidEmail")
    RejectedIdentifierProblem    = ProblemType("rejectedIdentifier")
    AccountDoesNotExistProblem   = ProblemType("accountDoesNotExist")
    CAAProblem                   = ProblemType("caa")
    DNSProblem                   = ProblemType("dns")
    AlreadyRevokedProblem        = ProblemType("alreadyRevoked")
    OrderNotReadyProblem         = ProblemType("orderNotReady")
    BadSignatureAlgorithmProblem = ProblemType("badSignatureAlgorithm")
    BadPublicKeyProblem          = ProblemType("badPublicKey")
    BadRevocationReasonProblem   = ProblemType("badRevocationReason")
    BadCSRProblem                = ProblemType("badCSR")

    V1ErrorNS = "urn:acme:error:"
    V2ErrorNS = "urn:ietf:params:acme:error:"
)

Error types that can be used in ACME payloads

func ProblemDetailsToStatusCode Uses

func ProblemDetailsToStatusCode(prob *ProblemDetails) int

ProblemDetailsToStatusCode inspects the given ProblemDetails to figure out what HTTP status code it should represent. It should only be used by the WFE but is included in this package because of its reliance on ProblemTypes.

type ProblemDetails Uses

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"`
}

ProblemDetails objects represent problem documents https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00

func AccountDoesNotExist Uses

func AccountDoesNotExist(detail string, a ...interface{}) *ProblemDetails

AccountDoesNotExist returns a ProblemDetails representing an AccountDoesNotExistProblem error

func AlreadyRevoked Uses

func AlreadyRevoked(detail string, a ...interface{}) *ProblemDetails

AlreadyRevoked returns a ProblemDetails with a AlreadyRevokedProblem and a 400 Bad Request status code.

func BadCSR Uses

func BadCSR(detail string, a ...interface{}) *ProblemDetails

BadCSR returns a ProblemDetails representing a BadCSRProblem.

func BadNonce Uses

func BadNonce(detail string, a ...interface{}) *ProblemDetails

BadNonce returns a ProblemDetails with a BadNonceProblem and a 400 Bad Request status code.

func BadPublicKey Uses

func BadPublicKey(detail string, a ...interface{}) *ProblemDetails

BadPublicKey returns a ProblemDetails with a BadPublicKeyProblem and a 400 Bad Request status code.

func BadRevocationReason Uses

func BadRevocationReason(detail string, a ...interface{}) *ProblemDetails

BadRevocationReason returns a ProblemDetails representing a BadRevocationReasonProblem

func BadSignatureAlgorithm Uses

func BadSignatureAlgorithm(detail string, a ...interface{}) *ProblemDetails

BadSignatureAlgorithm returns a ProblemDetails with a BadSignatureAlgorithmProblem and a 400 Bad Request status code.

func CAA Uses

func CAA(detail string, a ...interface{}) *ProblemDetails

CAA returns a ProblemDetails representing a CAAProblem

func Conflict Uses

func Conflict(detail string, a ...interface{}) *ProblemDetails

Conflict returns a ProblemDetails with a MalformedProblem and a 409 Conflict status code.

func ConnectionFailure Uses

func ConnectionFailure(detail string, a ...interface{}) *ProblemDetails

ConnectionFailure returns a ProblemDetails representing a ConnectionProblem error

func ContentLengthRequired Uses

func ContentLengthRequired() *ProblemDetails

ContentLengthRequired returns a ProblemDetails representing a missing Content-Length header error

func DNS Uses

func DNS(detail string, a ...interface{}) *ProblemDetails

DNS returns a ProblemDetails representing a DNSProblem

func InvalidContentType Uses

func InvalidContentType(detail string, a ...interface{}) *ProblemDetails

InvalidContentType returns a ProblemDetails suitable for a missing ContentType header, or an incorrect ContentType header

func InvalidEmail Uses

func InvalidEmail(detail string, a ...interface{}) *ProblemDetails

InvalidEmail returns a ProblemDetails representing an invalid email address error

func Malformed Uses

func Malformed(detail string, a ...interface{}) *ProblemDetails

Malformed returns a ProblemDetails with a MalformedProblem and a 400 Bad Request status code.

func MethodNotAllowed Uses

func MethodNotAllowed() *ProblemDetails

MethodNotAllowed returns a ProblemDetails representing a disallowed HTTP method error.

func NotFound Uses

func NotFound(detail string, a ...interface{}) *ProblemDetails

NotFound returns a ProblemDetails with a MalformedProblem and a 404 Not Found status code.

func OrderNotReady Uses

func OrderNotReady(detail string, a ...interface{}) *ProblemDetails

OrderNotReady returns a ProblemDetails representing a OrderNotReadyProblem

func RateLimited Uses

func RateLimited(detail string, a ...interface{}) *ProblemDetails

RateLimited returns a ProblemDetails representing a RateLimitedProblem error

func RejectedIdentifier Uses

func RejectedIdentifier(detail string, a ...interface{}) *ProblemDetails

RejectedIdentifier returns a ProblemDetails with a RejectedIdentifierProblem and a 400 Bad Request status code.

func ServerInternal Uses

func ServerInternal(detail string, a ...interface{}) *ProblemDetails

ServerInternal returns a ProblemDetails with a ServerInternalProblem and a 500 Internal Server Failure status code.

func TLSError Uses

func TLSError(detail string, a ...interface{}) *ProblemDetails

TLSError returns a ProblemDetails representing a TLSProblem error

func Unauthorized Uses

func Unauthorized(detail string, a ...interface{}) *ProblemDetails

Unauthorized returns a ProblemDetails with an UnauthorizedProblem and a 403 Forbidden status code.

func (*ProblemDetails) Error Uses

func (pd *ProblemDetails) Error() string

func (*ProblemDetails) WithSubProblems Uses

func (pd *ProblemDetails) WithSubProblems(subProbs []SubProblemDetails) *ProblemDetails

WithSubProblems returns a new ProblemsDetails instance created by adding the provided subProbs to the existing ProblemsDetail.

type ProblemType Uses

type ProblemType string

ProblemType defines the error types in the ACME protocol

type SubProblemDetails Uses

type SubProblemDetails struct {
    ProblemDetails
    Identifier identifier.ACMEIdentifier `json:"identifier"`
}

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

Package probs imports 3 packages (graph) and is imported by 210 packages. Updated 2019-10-10. Refresh now. Tools for package owners.