grpc

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAServiceClient

type CAServiceClient interface {
	PostCertificateRenewal(
		ctx context.Context,
		isd int,
		as api.AS,
		body api.PostCertificateRenewalJSONRequestBody,
		reqEditors ...api.RequestEditorFn,
	) (*http.Response, error)
}

CAServiceClient is the minimal interface that is needed from private/ca/api:ClientWithResponsesInterface.

type CMS

type CMS struct {
	Verifier     RenewalRequestVerifier
	ChainBuilder ChainBuilder
	IA           addr.IA

	// Metrics contains the counters. It is safe to pass nil-counters.
	Metrics CMSHandlerMetrics
}

CMS handles CMS requests.

func (CMS) HandleCMSRequest

func (s CMS) HandleCMSRequest(
	ctx context.Context,
	req *cppb.ChainRenewalRequest,
) ([]*x509.Certificate, error)

HandleCMSRequest handles a request with CMS signature.

type CMSHandlerMetrics

type CMSHandlerMetrics struct {
	Success metrics.Counter

	DatabaseError metrics.Counter
	InternalError metrics.Counter
	NotFoundError metrics.Counter
	ParseError    metrics.Counter
	VerifyError   metrics.Counter
}

CMSHandlerMetrics contains the counters for the CMSHandler

type CMSRequestHandler

type CMSRequestHandler interface {
	HandleCMSRequest(context.Context, *cppb.ChainRenewalRequest) ([]*x509.Certificate, error)
}

CMSRequestHandler handles CMS requests.

type CMSSigner

type CMSSigner interface {
	SignCMS(ctx context.Context, msg []byte) ([]byte, error)
}

CMSSigner signs response message.

type ChainBuilder

type ChainBuilder interface {
	CreateChain(context.Context, *x509.CertificateRequest) ([]*x509.Certificate, error)
}

ChainBuilder creates a chain for the given CSR.

type DelegatingHandler

type DelegatingHandler struct {
	Client CAServiceClient

	// Metrics contains the counters. It is safe to pass nil-counters.
	Metrics DelegatingHandlerMetrics
}

DelegatingHandler delegates requests to the CA service.

func (*DelegatingHandler) HandleCMSRequest

func (h *DelegatingHandler) HandleCMSRequest(
	ctx context.Context,
	req *cppb.ChainRenewalRequest,
) ([]*x509.Certificate, error)

HandleCMSRequest handles a certificate renewal request that was signed with CMS by delegating it to the CA Service.

type DelegatingHandlerMetrics

type DelegatingHandlerMetrics struct {
	BadRequests   metrics.Counter
	InternalError metrics.Counter
	Unavailable   metrics.Counter
	Success       metrics.Counter
}

DelegatingHandlerMetrics contains the counters for the DelegatingHandler

type RenewalRequestVerifier

type RenewalRequestVerifier interface {
	VerifyCMSSignedRenewalRequest(context.Context, []byte) (*x509.CertificateRequest, error)
}

RenewalRequestVerifier verifies the incoming chain renewal request.

type RenewalServer

type RenewalServer struct {
	IA         addr.IA
	CMSHandler CMSRequestHandler
	CMSSigner  CMSSigner

	// Metrics contains the counters. Different error are different counters.
	Metrics RenewalServerMetrics
}

RenewalServer servers trust material for gRPC requests.

func (RenewalServer) ChainRenewal

type RenewalServerMetrics

type RenewalServerMetrics struct {
	BackendErrors metrics.Counter
	Success       metrics.Counter
}

RenewalServerMetrics contains counters for RenewalServerMetrics.

Directories

Path Synopsis
Package mock_grpc is a generated GoMock package.
Package mock_grpc is a generated GoMock package.

Jump to

Keyboard shortcuts

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