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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAdmin

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

CreateAdmin creates a new admin.

func CreateProvisioner

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

CreateProvisioner creates a new prov.

func DeleteAdmin

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

DeleteAdmin deletes admin.

func DeleteProvisioner

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

DeleteProvisioner deletes a provisioner.

func GetAdmin

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

GetAdmin returns the requested admin, or an error.

func GetAdmins

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

GetAdmins returns a segment of admins associated with the authority.

func GetProvisioner

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

GetProvisioner returns the requested provisioner, or an error.

func GetProvisioners

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

GetProvisioners returns the given segment of provisioners associated with the authority.

func Route

func Route(r api.Router, options ...RouterOption)

Route traffic and implement the Router interface.

func UpdateAdmin

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

UpdateAdmin updates an existing admin.

func UpdateProvisioner

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

UpdateProvisioner updates an existing prov.

Types

type ACMEAdminResponder

type ACMEAdminResponder interface {
	GetExternalAccountKeys(w http.ResponseWriter, r *http.Request)
	CreateExternalAccountKey(w http.ResponseWriter, r *http.Request)
	DeleteExternalAccountKey(w http.ResponseWriter, r *http.Request)
}

ACMEAdminResponder is responsible for writing ACME admin responses

func NewACMEAdminResponder

func NewACMEAdminResponder() ACMEAdminResponder

NewACMEAdminResponder returns a new ACMEAdminResponder

type CreateAdminRequest

type CreateAdminRequest struct {
	Subject     string              `json:"subject"`
	Provisioner string              `json:"provisioner"`
	Type        linkedca.Admin_Type `json:"type"`
}

CreateAdminRequest represents the body for a CreateAdmin request.

func (*CreateAdminRequest) Validate

func (car *CreateAdminRequest) Validate() error

Validate validates a new-admin request body.

type CreateExternalAccountKeyRequest

type CreateExternalAccountKeyRequest struct {
	Reference string `json:"reference"`
}

CreateExternalAccountKeyRequest is the type for POST /admin/acme/eab requests

func (*CreateExternalAccountKeyRequest) Validate

func (r *CreateExternalAccountKeyRequest) Validate() error

Validate validates a new ACME EAB Key request body.

type DeleteResponse

type DeleteResponse struct {
	Status string `json:"status"`
}

DeleteResponse is the resource for successful DELETE responses.

type GetAdminsResponse

type GetAdminsResponse struct {
	Admins     []*linkedca.Admin `json:"admins"`
	NextCursor string            `json:"nextCursor"`
}

GetAdminsResponse for returning a list of admins.

type GetExternalAccountKeysResponse

type GetExternalAccountKeysResponse struct {
	EAKs       []*linkedca.EABKey `json:"eaks"`
	NextCursor string             `json:"nextCursor"`
}

GetExternalAccountKeysResponse is the type for GET /admin/acme/eab responses

type GetProvisionersResponse

type GetProvisionersResponse struct {
	Provisioners provisioner.List `json:"provisioners"`
	NextCursor   string           `json:"nextCursor"`
}

GetProvisionersResponse is the type for GET /admin/provisioners responses.

type PolicyAdminResponder

type PolicyAdminResponder interface {
	GetAuthorityPolicy(w http.ResponseWriter, r *http.Request)
	CreateAuthorityPolicy(w http.ResponseWriter, r *http.Request)
	UpdateAuthorityPolicy(w http.ResponseWriter, r *http.Request)
	DeleteAuthorityPolicy(w http.ResponseWriter, r *http.Request)
	GetProvisionerPolicy(w http.ResponseWriter, r *http.Request)
	CreateProvisionerPolicy(w http.ResponseWriter, r *http.Request)
	UpdateProvisionerPolicy(w http.ResponseWriter, r *http.Request)
	DeleteProvisionerPolicy(w http.ResponseWriter, r *http.Request)
	GetACMEAccountPolicy(w http.ResponseWriter, r *http.Request)
	CreateACMEAccountPolicy(w http.ResponseWriter, r *http.Request)
	UpdateACMEAccountPolicy(w http.ResponseWriter, r *http.Request)
	DeleteACMEAccountPolicy(w http.ResponseWriter, r *http.Request)
}

PolicyAdminResponder is the interface responsible for writing ACME admin responses.

func NewPolicyAdminResponder

func NewPolicyAdminResponder() PolicyAdminResponder

NewPolicyAdminResponder returns a new PolicyAdminResponder.

type RouterOption

type RouterOption func(*router)

func WithACMEResponder

func WithACMEResponder(acmeResponder ACMEAdminResponder) RouterOption

func WithPolicyResponder

func WithPolicyResponder(policyResponder PolicyAdminResponder) RouterOption

func WithWebhookResponder

func WithWebhookResponder(webhookResponder WebhookAdminResponder) RouterOption

type UpdateAdminRequest

type UpdateAdminRequest struct {
	Type linkedca.Admin_Type `json:"type"`
}

UpdateAdminRequest represents the body for a UpdateAdmin request.

func (*UpdateAdminRequest) Validate

func (uar *UpdateAdminRequest) Validate() error

Validate validates a new-admin request body.

type WebhookAdminResponder

type WebhookAdminResponder interface {
	CreateProvisionerWebhook(w http.ResponseWriter, r *http.Request)
	UpdateProvisionerWebhook(w http.ResponseWriter, r *http.Request)
	DeleteProvisionerWebhook(w http.ResponseWriter, r *http.Request)
}

WebhookAdminResponder is the interface responsible for writing webhook admin responses.

func NewWebhookAdminResponder

func NewWebhookAdminResponder() WebhookAdminResponder

NewWebhookAdminResponder returns a new WebhookAdminResponder

Jump to

Keyboard shortcuts

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