api

package
v0.0.0-...-c397b60 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FinalizeOrder

func FinalizeOrder(w http.ResponseWriter, r *http.Request)

FinalizeOrder attempts to finalize an order and create a certificate.

func GetAuthorization

func GetAuthorization(w http.ResponseWriter, r *http.Request)

GetAuthorization ACME api for retrieving an Authz.

func GetCertificate

func GetCertificate(w http.ResponseWriter, r *http.Request)

GetCertificate ACME api for retrieving a Certificate.

func GetChallenge

func GetChallenge(w http.ResponseWriter, r *http.Request)

GetChallenge ACME api for retrieving a Challenge.

func GetDirectory

func GetDirectory(w http.ResponseWriter, r *http.Request)

GetDirectory is the ACME resource for returning a directory configuration for client configuration.

func GetNonce

func 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 GetOrUpdateAccount

func GetOrUpdateAccount(w http.ResponseWriter, r *http.Request)

GetOrUpdateAccount is the api for updating an ACME account.

func GetOrder

func GetOrder(w http.ResponseWriter, r *http.Request)

GetOrder ACME api for retrieving an order.

func GetOrdersByAccountID

func GetOrdersByAccountID(w http.ResponseWriter, r *http.Request)

GetOrdersByAccountID ACME api for retrieving the list of order urls belonging to an account.

func NewAccount

func NewAccount(w http.ResponseWriter, r *http.Request)

NewAccount is the handler resource for creating new ACME accounts.

func NewHandler

func NewHandler(opts HandlerOptions) api.RouterHandler

NewHandler returns a new ACME API handler.

Note: this method is deprecated in step-ca, other applications can still use this to support ACME, but the recommendation is to use use api.Route(api.Router) and acme.NewContext() instead.

func NewOrder

func NewOrder(w http.ResponseWriter, r *http.Request)

NewOrder ACME api for creating a new order.

func NotImplemented

func NotImplemented(w http.ResponseWriter, _ *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 RevokeCert

func RevokeCert(w http.ResponseWriter, r *http.Request)

RevokeCert attempts to revoke a certificate.

func Route

func Route(r api.Router)

Route traffic and implement the Router interface. This method requires that all the acme components, authority, db, client, linker, and prerequisite checker to be present in the context.

Types

type Clock

type Clock struct{}

Clock that returns time in UTC rounded to seconds.

func (*Clock) Now

func (c *Clock) Now() time.Time

Now returns the UTC time rounded to seconds.

type ContextKey

type ContextKey string

ContextKey is the key type for storing and searching for ACME request essentials in the context of a request.

type Directory

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

Directory represents an ACME directory for configuring clients.

func (*Directory) ToLog

func (d *Directory) ToLog() (interface{}, error)

ToLog enables response logging for the Directory type.

type ExternalAccountBinding

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 HandlerOptions

type HandlerOptions struct {
	// DB storage backend that implements the acme.DB interface.
	//
	// Deprecated: use acme.NewContex(context.Context, acme.DB)
	DB acme.DB

	// CA is the certificate authority interface.
	//
	// Deprecated: use authority.NewContext(context.Context, *authority.Authority)
	CA acme.CertificateAuthority

	// Backdate is the duration that the CA will subtract from the current time
	// to set the NotBefore in the certificate.
	Backdate provisioner.Duration

	// 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

	// 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 Meta

type Meta struct {
	TermsOfService          string   `json:"termsOfService,omitempty"`
	Website                 string   `json:"website,omitempty"`
	CaaIdentities           []string `json:"caaIdentities,omitempty"`
	ExternalAccountRequired bool     `json:"externalAccountRequired,omitempty"`
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL