handlers

package
v0.0.6-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RevocationReasonUnspecified          = 0 // Unspecified reason for revocation
	RevocationReasonKeyCompromise        = 1 // The key associated with the certificate has been compromised
	RevocationReasonCACertCompromise     = 2 // The issuing CA certificate has been compromised
	RevocationReasonAffiliationChanged   = 3 // The entity's affiliation with the domain has changed
	RevocationReasonSuperseded           = 4 // The certificate has been superseded by another certificate
	RevocationReasonCessationOfOperation = 5 // The entity has ceased its operations (e.g., the domain is no longer used)
	RevocationReasonCertificateHold      = 6 // The certificate is placed on hold (temporary revocation)
)

Revocation statuses (for /revoke-cert)

Variables

View Source
var (
	ErrKIDAndJWKNotAllowed = errors.New("both kid and jwk not allowed in JWS header")
)

Functions

func GenerateID

func GenerateID() (uint64, error)

func GenerateToken

func GenerateToken() (string, error)

Types

type AccountRequest

type AccountRequest struct {
	Status  string   `json:"status,omitempty"`
	Contact []string `json:"contact,omitempty"`
}

AccountRequest represents the structure of the incoming account update/deactivation request body.

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

ErrorResponse represents an error response for the API.

type KeyChangeRequest

type KeyChangeRequest struct {
	AccountURL string          `json:"account"` // The account URL
	OldKey     keystore.KeyMap `json:"oldKey"`  // The old key in JWK format
}

KeyChangeRequest represents the key change request body.

type KeyChangeResponse

type KeyChangeResponse struct {
	Message string `json:"message"`
}

KeyChangeResponse represents the successful key change response.

type NewAccountRequest

type NewAccountRequest struct {
	Contact                []string    `yaml:"contact" json:"contact,omitempty"`
	TermsOfServiceAgreed   bool        `yaml:"termsOfServiceAgreed" json:"termsOfServiceAgreed,omitempty"`
	OnlyReturnExisting     bool        `yaml:"onlyReturnExisting" json:"onlyReturnExisting,omitempty"`
	ExternalAccountBinding interface{} `yaml:"externalAccountBinding" json:"externalAccountBinding,omitempty"`
}

type NewKeyPayload

type NewKeyPayload struct {
	JWK string `json:"jwk"`
}

type NewOrderRequest

type NewOrderRequest struct {
	Identifiers []entities.ACMEIdentifier `yaml:"identifiers" json:"identifiers"`
	NotBefore   string                    `yaml:"not-before" json:"notBefore,omitempty"`
	NotAfter    string                    `yaml:"not-after" json:"notAfter,omitempty"`
}

type OrderFinalizeRequest

type OrderFinalizeRequest struct {
	CSR string `json:"csr"`
}

type Params

type Params struct {
	ACMEConfig      *acme.Config
	CA              ca.CertificateAuthority
	CN              string
	DAOFactory      dao.Factory
	DeviceService   *device.Service
	DNSService      *dns.Service
	Logger          *logging.Logger
	TPM             tpm2.TrustedPlatformModule
	TLSPort         int
	TLSKeyAlgorithm x509.PublicKeyAlgorithm
	TLSStoreType    keystore.StoreType
}

type RestService

type RestService struct {
	RestServicer
	// contains filtered or unexported fields
}

func (*RestService) AccountHandler

func (s *RestService) AccountHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) AuthorizationHandler

func (s *RestService) AuthorizationHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) CABundleHandler

func (s *RestService) CABundleHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) CertificateHandler

func (s *RestService) CertificateHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) ChallengeHandler

func (s *RestService) ChallengeHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) DirectoryHandler

func (s *RestService) DirectoryHandler(w http.ResponseWriter, r *http.Request)

DirectoryHandler responds to /acme/directory requests.

func (*RestService) KeyChangeHandler

func (s *RestService) KeyChangeHandler(w http.ResponseWriter, r *http.Request)

KeyChangeHandler handles key-change requests according to RFC 8555 Section 7.3.5 Account Key Rollover.

func (*RestService) NewAccountHandler

func (s *RestService) NewAccountHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) NewNonceHandler

func (s *RestService) NewNonceHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) NewOrderHandler

func (s *RestService) NewOrderHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) OrderFinalizeHandler

func (s *RestService) OrderFinalizeHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) OrderHandler

func (s *RestService) OrderHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) OrdersListHandler

func (s *RestService) OrdersListHandler(w http.ResponseWriter, r *http.Request)

func (*RestService) RevokeCertHandler

func (s *RestService) RevokeCertHandler(w http.ResponseWriter, r *http.Request)

type RestServicer

type RestServicer interface {
	AccountHandler(w http.ResponseWriter, r *http.Request)
	AuthorizationHandler(w http.ResponseWriter, r *http.Request)
	CertificateHandler(w http.ResponseWriter, r *http.Request)
	ChallengeHandler(w http.ResponseWriter, r *http.Request)
	DirectoryHandler(w http.ResponseWriter, r *http.Request)
	NewAccountHandler(w http.ResponseWriter, r *http.Request)
	NewNonceHandler(w http.ResponseWriter, r *http.Request)
	NewOrderHandler(w http.ResponseWriter, r *http.Request)
	OrderHandler(w http.ResponseWriter, r *http.Request)
	OrdersListHandler(w http.ResponseWriter, r *http.Request)
	OrderFinalizeHandler(w http.ResponseWriter, r *http.Request)
	RevokeCertHandler(w http.ResponseWriter, r *http.Request)
	KeyChangeHandler(w http.ResponseWriter, r *http.Request)

	// Non-RFC 8555 compliant handlers
	CABundleHandler(w http.ResponseWriter, r *http.Request)
}

func NewRestService

func NewRestService(params *Params) (RestServicer, error)

type RevokeCertRequest

type RevokeCertRequest struct {
	Certificate string `json:"certificate"`
	Reason      int    `json:"reason,omitempty"`
}

Jump to

Keyboard shortcuts

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