Documentation ¶
Index ¶
- func NewHandler(ops HandlerOptions) api.RouterHandler
- type Clock
- type ContextKey
- type Directory
- type ExternalAccountBinding
- type FinalizeRequest
- type Handler
- func (h *Handler) FinalizeOrder(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAuthorization(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetCertificate(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetChallenge(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetDirectory(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetNonce(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetOrUpdateAccount(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetOrder(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetOrdersByAccountID(w http.ResponseWriter, r *http.Request)
- func (h *Handler) NewAccount(w http.ResponseWriter, r *http.Request)
- func (h *Handler) NewOrder(w http.ResponseWriter, r *http.Request)
- func (h *Handler) NotImplemented(w http.ResponseWriter, r *http.Request)
- func (h *Handler) RevokeCert(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Route(r api.Router)
- type HandlerOptions
- type LinkType
- type Linker
- type Meta
- type NewAccountRequest
- type NewOrderRequest
- type UpdateAccountRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶ added in v0.15.12
func NewHandler(ops HandlerOptions) api.RouterHandler
NewHandler returns a new ACME API handler.
Types ¶
type Clock ¶ added in v0.15.12
type Clock struct{}
Clock that returns time in UTC rounded to seconds.
type ContextKey ¶ added in v0.15.12
type ContextKey string
ContextKey is the key type for storing and searching for ACME request essentials in the context of a request.
type Directory ¶ added in v0.15.12
type Directory struct { NewNonce string `json:"newNonce"` NewAccount string `json:"newAccount"` NewOrder string `json:"newOrder"` RevokeCert string `json:"revokeCert"` KeyChange string `json:"keyChange"` Meta Meta `json:"meta"` }
Directory represents an ACME directory for configuring clients.
type ExternalAccountBinding ¶ added in v0.18.1
type ExternalAccountBinding struct { Protected string `json:"protected"` Payload string `json:"payload"` Sig string `json:"signature"` }
ExternalAccountBinding represents the ACME externalAccountBinding JWS
type FinalizeRequest ¶
type FinalizeRequest struct { CSR string `json:"csr"` // contains filtered or unexported fields }
FinalizeRequest captures the body for a Finalize order request.
func (*FinalizeRequest) Validate ¶
func (f *FinalizeRequest) Validate() error
Validate validates a finalize request body.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is the ACME API request handler.
func (*Handler) FinalizeOrder ¶
func (h *Handler) FinalizeOrder(w http.ResponseWriter, r *http.Request)
FinalizeOrder attemptst to finalize an order and create a certificate.
func (*Handler) GetAuthorization ¶ added in v0.15.12
func (h *Handler) GetAuthorization(w http.ResponseWriter, r *http.Request)
GetAuthorization ACME api for retrieving an Authz.
func (*Handler) GetCertificate ¶
func (h *Handler) GetCertificate(w http.ResponseWriter, r *http.Request)
GetCertificate ACME api for retrieving a Certificate.
func (*Handler) GetChallenge ¶
func (h *Handler) GetChallenge(w http.ResponseWriter, r *http.Request)
GetChallenge ACME api for retrieving a Challenge.
func (*Handler) GetDirectory ¶
func (h *Handler) GetDirectory(w http.ResponseWriter, r *http.Request)
GetDirectory is the ACME resource for returning a directory configuration for client configuration.
func (*Handler) GetNonce ¶
func (h *Handler) GetNonce(w http.ResponseWriter, r *http.Request)
GetNonce just sets the right header since a Nonce is added to each response by middleware by default.
func (*Handler) GetOrUpdateAccount ¶ added in v0.15.12
func (h *Handler) GetOrUpdateAccount(w http.ResponseWriter, r *http.Request)
GetOrUpdateAccount is the api for updating an ACME account.
func (*Handler) GetOrder ¶
func (h *Handler) GetOrder(w http.ResponseWriter, r *http.Request)
GetOrder ACME api for retrieving an order.
func (*Handler) GetOrdersByAccountID ¶ added in v0.15.12
func (h *Handler) GetOrdersByAccountID(w http.ResponseWriter, r *http.Request)
GetOrdersByAccountID ACME api for retrieving the list of order urls belonging to an account.
func (*Handler) NewAccount ¶
func (h *Handler) NewAccount(w http.ResponseWriter, r *http.Request)
NewAccount is the handler resource for creating new ACME accounts.
func (*Handler) NewOrder ¶
func (h *Handler) NewOrder(w http.ResponseWriter, r *http.Request)
NewOrder ACME api for creating a new order.
func (*Handler) NotImplemented ¶ added in v0.14.5
func (h *Handler) NotImplemented(w http.ResponseWriter, r *http.Request)
NotImplemented returns a 501 and is generally a placeholder for functionality which MAY be added at some point in the future but is not in any way a guarantee of such.
func (*Handler) RevokeCert ¶ added in v0.18.1
func (h *Handler) RevokeCert(w http.ResponseWriter, r *http.Request)
RevokeCert attempts to revoke a certificate.
type HandlerOptions ¶ added in v0.15.12
type HandlerOptions struct { Backdate provisioner.Duration // DB storage backend that impements the acme.DB interface. DB acme.DB // DNS the host used to generate accurate ACME links. By default the authority // will use the Host from the request, so this value will only be used if // request.Host is empty. DNS string // Prefix is a URL path prefix under which the ACME api is served. This // prefix is required to generate accurate ACME links. // E.g. https://ca.smallstep.com/acme/my-acme-provisioner/new-account -- // "acme" is the prefix from which the ACME api is accessed. Prefix string CA acme.CertificateAuthority // PrerequisitesChecker checks if all prerequisites for serving ACME are // met by the CA configuration. PrerequisitesChecker func(ctx context.Context) (bool, error) }
HandlerOptions required to create a new ACME API request handler.
type LinkType ¶ added in v0.15.12
type LinkType int
LinkType captures the link type.
const ( // NewNonceLinkType new-nonce NewNonceLinkType LinkType = iota // NewAccountLinkType new-account NewAccountLinkType // AccountLinkType account AccountLinkType // OrderLinkType order OrderLinkType // NewOrderLinkType new-order NewOrderLinkType // OrdersByAccountLinkType list of orders owned by account OrdersByAccountLinkType // FinalizeLinkType finalize order FinalizeLinkType // NewAuthzLinkType authz NewAuthzLinkType // AuthzLinkType new-authz AuthzLinkType // ChallengeLinkType challenge ChallengeLinkType // CertificateLinkType certificate CertificateLinkType // DirectoryLinkType directory DirectoryLinkType // RevokeCertLinkType revoke certificate RevokeCertLinkType // KeyChangeLinkType key rollover KeyChangeLinkType )
type Linker ¶ added in v0.15.12
type Linker interface { GetLink(ctx context.Context, typ LinkType, inputs ...string) string GetUnescapedPathSuffix(typ LinkType, provName string, inputs ...string) string LinkOrder(ctx context.Context, o *acme.Order) LinkAccount(ctx context.Context, o *acme.Account) LinkChallenge(ctx context.Context, o *acme.Challenge, azID string) LinkAuthorization(ctx context.Context, o *acme.Authorization) LinkOrdersByAccountID(ctx context.Context, orders []string) }
Linker interface for generating links for ACME resources.
type NewAccountRequest ¶
type NewAccountRequest struct { Contact []string `json:"contact"` OnlyReturnExisting bool `json:"onlyReturnExisting"` TermsOfServiceAgreed bool `json:"termsOfServiceAgreed"` ExternalAccountBinding *ExternalAccountBinding `json:"externalAccountBinding,omitempty"` }
NewAccountRequest represents the payload for a new account request.
func (*NewAccountRequest) Validate ¶
func (n *NewAccountRequest) Validate() error
Validate validates a new-account request body.
type NewOrderRequest ¶
type NewOrderRequest struct { Identifiers []acme.Identifier `json:"identifiers"` NotBefore time.Time `json:"notBefore,omitempty"` NotAfter time.Time `json:"notAfter,omitempty"` }
NewOrderRequest represents the body for a NewOrder request.
func (*NewOrderRequest) Validate ¶
func (n *NewOrderRequest) Validate() error
Validate validates a new-order request body.
type UpdateAccountRequest ¶
type UpdateAccountRequest struct { Contact []string `json:"contact"` Status acme.Status `json:"status"` }
UpdateAccountRequest represents an update-account request.
func (*UpdateAccountRequest) Validate ¶
func (u *UpdateAccountRequest) Validate() error
Validate validates a update-account request body.