endpoint

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCertEndpoint

func MakeCertEndpoint(s service.Service) endpoint.Endpoint

func MakeCreateCAEndpoint

func MakeCreateCAEndpoint(s service.Service) endpoint.Endpoint

func MakeDeleteCAEndpoint

func MakeDeleteCAEndpoint(s service.Service) endpoint.Endpoint

func MakeDeleteCertEndpoint

func MakeDeleteCertEndpoint(s service.Service) endpoint.Endpoint

func MakeGetCAsEndpoint

func MakeGetCAsEndpoint(s service.Service) endpoint.Endpoint

func MakeHealthEndpoint

func MakeHealthEndpoint(s service.Service) endpoint.Endpoint

func MakeImportCAEndpoint

func MakeImportCAEndpoint(s service.Service) endpoint.Endpoint

func MakeIssuedCertsEndpoint

func MakeIssuedCertsEndpoint(s service.Service) endpoint.Endpoint

func MakeSignCertEndpoint

func MakeSignCertEndpoint(s service.Service) endpoint.Endpoint

func ValidateCreatrCARequest

func ValidateCreatrCARequest(request CreateCARequest) error

func ValidateImportCARequest

func ValidateImportCARequest(request ImportCARequest) error

func ValidateSignCertificateRquest

func ValidateSignCertificateRquest(request SignCertificateRquest) error

Types

type CaRequest

type CaRequest struct {
	CaType secrets.CAType

	CA string
}

type CreateCARequest

type CreateCARequest struct {
	CaType    string `validate:"oneof='pki' 'dmsenroller'"`
	CaName    string `validate:"required"`
	CaPayload struct {
		KeyMetadata struct {
			KeyType string `json:"type" validate:"oneof='rsa' 'ec'"`
			KeyBits int    `json:"bits" validate:"required"`
		} `json:"key_metadata" validate:"required"`

		Subject struct {
			CN string `json:"common_name" validate:"required"`
			O  string `json:"organization"`
			OU string `json:"organization_unit"`
			C  string `json:"country"`
			ST string `json:"state"`
			L  string `json:"locality"`
		} `json:"subject"`

		CaTTL       int `json:"ca_ttl" validate:"required"`
		EnrollerTTL int `json:"enroller_ttl" validate:"gt=0"`
	}
}

type DeleteCARequest

type DeleteCARequest struct {
	CaType secrets.CAType
	CA     string
}

type DeleteCertRequest

type DeleteCertRequest struct {
	CaName       string
	SerialNumber string
	CaType       secrets.CAType
}

type Endpoints

type Endpoints struct {
	HealthEndpoint         endpoint.Endpoint
	GetCAsEndpoint         endpoint.Endpoint
	CreateCAEndpoint       endpoint.Endpoint
	ImportCAEndpoint       endpoint.Endpoint
	DeleteCAEndpoint       endpoint.Endpoint
	GetIssuedCertsEndpoint endpoint.Endpoint
	GetCertEndpoint        endpoint.Endpoint
	SignCertEndpoint       endpoint.Endpoint
	DeleteCertEndpoint     endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s service.Service, otTracer stdopentracing.Tracer) Endpoints

type GetCAsRequest

type GetCAsRequest struct {
	CaType string
}

type GetCertRequest

type GetCertRequest struct {
	CaType       secrets.CAType
	CaName       string
	SerialNumber string
}

type HealthRequest

type HealthRequest struct{}

type HealthResponse

type HealthResponse struct {
	Healthy bool  `json:"healthy,omitempty"`
	Err     error `json:"-"`
}

type ImportCARequest

type ImportCARequest struct {
	CaType    string `validate:"oneof='pki' 'dmsenroller'"`
	CaName    string `validate:"required"`
	CaPayload struct {
		EnrollerTTL int    `json:"enroller_ttl" validate:"required"`
		Crt         string `json:"crt" validate:"base64"`
		PrivateKey  string `json:"private_key" validate:"base64"`
	}
}

type SignCertificateRquest

type SignCertificateRquest struct {
	CaType      string `validate:"oneof='pki' 'dmsenroller'"`
	CaName      string `validate:"required"`
	SignPayload struct {
		Csr          string `json:"csr" validate:"base64"`
		SignVerbatim bool   `json:"sign_verbatim"`
	}
}

Jump to

Keyboard shortcuts

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