grpc

package
v0.0.0-...-0cb28c9 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MPL-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package wrappers wraps the GRPC calls in the core interfaces.

Package wrappers wraps the GRPC calls in the core interfaces.

Package wrappers wraps the GRPC calls in the core interfaces.

Package wrappers wraps the GRPC calls in the core interfaces.

Package wrappers wraps the GRPC calls in the core interfaces.

Index

Constants

This section is empty.

Variables

View Source
var CodedError = grpc.Errorf

CodedError is a alias required to appease go vet

View Source
var ErrMissingParameters = CodedError(codes.FailedPrecondition, "required RPC parameter was missing")

Functions

func AuthzToPB

func AuthzToPB(authz core.Authorization) (*corepb.Authorization, error)

func ChallengeToPB

func ChallengeToPB(challenge core.Challenge) (*corepb.Challenge, error)

func ClientSetup

func ClientSetup(c *cmd.GRPCClientConfig, tls *tls.Config, metrics clientMetrics, clk clock.Clock) (*grpc.ClientConn, error)

ClientSetup creates a gRPC TransportCredentials that presents a client certificate and validates the the server certificate based on the provided *tls.Config. It dials the remote service and returns a grpc.ClientConn if successful.

func NewClientMetrics

func NewClientMetrics(stats registry) clientMetrics

NewClientMetrics constructs a *grpc_prometheus.ClientMetrics, registered with the given registry, with timing histogram enabled. It must be called a maximum of once per registry, or there will be conflicting names.

func NewServer

func NewServer(c *cmd.GRPCServerConfig, tls *tls.Config, metrics serverMetrics, clk clock.Clock) (*grpc.Server, net.Listener, error)

NewServer creates a gRPC server that uses the provided *tls.Config, and verifies that clients present a certificate that (a) is signed by one of the configured ClientCAs, and (b) contains at least one subjectAlternativeName matching the accepted list from GRPCServerConfig.

func NewServerMetrics

func NewServerMetrics(stats registry) serverMetrics

NewServerMetrics registers metrics with a registry. It must be called a maximum of once per registry, or there will be conflicting names. It constructs and registers a *grpc_prometheus.ServerMetrics with timing histogram enabled as well as a prometheus Histogram for RPC latency.

func NewValidationAuthorityGRPCClient

func NewValidationAuthorityGRPCClient(cc *ggrpc.ClientConn) core.ValidationAuthority

func PBToAuthz

func PBToAuthz(pb *corepb.Authorization) (core.Authorization, error)

func PBToProblemDetails

func PBToProblemDetails(in *corepb.ProblemDetails) (*probs.ProblemDetails, error)

func ProblemDetailsToPB

func ProblemDetailsToPB(prob *probs.ProblemDetails) (*corepb.ProblemDetails, error)

func RegisterValidationAuthorityGRPCServer

func RegisterValidationAuthorityGRPCServer(s *ggrpc.Server, impl core.ValidationAuthority) error

Types

type CertificateAuthorityClientWrapper

type CertificateAuthorityClientWrapper struct {
	// contains filtered or unexported fields
}

CertificateAuthorityClientWrapper is the gRPC version of a core.CertificateAuthority client. It composites a CertificateAuthorityClient and OCSPGeneratorClient, either of which may be nil if the calling code doesn't intend to use the relevant functions. Once we've fully moved to gRPC, calling code will do away with this wrapper and directly instantiate exactly the type of client it needs.

func (CertificateAuthorityClientWrapper) GenerateOCSP

func (CertificateAuthorityClientWrapper) IssueCertificate

func (CertificateAuthorityClientWrapper) IssueCertificateForPrecertificate

func (CertificateAuthorityClientWrapper) IssuePrecertificate

type CertificateAuthorityServerWrapper

type CertificateAuthorityServerWrapper struct {
	// contains filtered or unexported fields
}

CertificateAuthorityServerWrapper is the gRPC version of a core.CertificateAuthority server

func (*CertificateAuthorityServerWrapper) GenerateOCSP

func (*CertificateAuthorityServerWrapper) IssueCertificate

func (*CertificateAuthorityServerWrapper) IssueCertificateForPrecertificate

func (*CertificateAuthorityServerWrapper) IssuePrecertificate

type PublisherClientWrapper

type PublisherClientWrapper struct {
	// contains filtered or unexported fields
}

PublisherClientWrapper is a wrapper needed to satisfy the interfaces in core/interfaces.go

func NewPublisherClientWrapper

func NewPublisherClientWrapper(inner pubpb.PublisherClient) *PublisherClientWrapper

NewPublisherClientWrapper returns an initialized PublisherClientWrapper

func (*PublisherClientWrapper) SubmitToSingleCTWithResult

func (pc *PublisherClientWrapper) SubmitToSingleCTWithResult(ctx context.Context, req *pubpb.Request) (*pubpb.Result, error)

SubmitToSingleCTWithResult is a wrapper

type PublisherServerWrapper

type PublisherServerWrapper struct {
	// contains filtered or unexported fields
}

PublisherServerWrapper is the gRPC version of a core.Publisher

func NewPublisherServerWrapper

func NewPublisherServerWrapper(inner *publisher.Impl) *PublisherServerWrapper

NewPublisherServerWrapper returns an initialized PublisherServerWrapper

func (*PublisherServerWrapper) SubmitToSingleCTWithResult

func (pub *PublisherServerWrapper) SubmitToSingleCTWithResult(ctx context.Context, req *pubpb.Request) (*pubpb.Result, error)

SubmitToSingleCTWithResult is a wrapper

type RegistrationAuthorityClientWrapper

type RegistrationAuthorityClientWrapper struct {
	// contains filtered or unexported fields
}

RegistrationAuthorityClientWrapper is the gRPC version of a core.RegistrationAuthority client

func (RegistrationAuthorityClientWrapper) AdministrativelyRevokeCertificate

func (rac RegistrationAuthorityClientWrapper) AdministrativelyRevokeCertificate(ctx context.Context, cert x509.Certificate, code revocation.Reason, adminName string) error

func (RegistrationAuthorityClientWrapper) DeactivateAuthorization

func (rac RegistrationAuthorityClientWrapper) DeactivateAuthorization(ctx context.Context, auth core.Authorization) error

func (RegistrationAuthorityClientWrapper) DeactivateRegistration

func (rac RegistrationAuthorityClientWrapper) DeactivateRegistration(ctx context.Context, reg core.Registration) error

func (*RegistrationAuthorityClientWrapper) FinalizeOrder

func (RegistrationAuthorityClientWrapper) NewAuthorization

func (RegistrationAuthorityClientWrapper) NewCertificate

func (*RegistrationAuthorityClientWrapper) NewOrder

func (RegistrationAuthorityClientWrapper) NewRegistration

func (RegistrationAuthorityClientWrapper) RevokeCertificateWithReg

func (rac RegistrationAuthorityClientWrapper) RevokeCertificateWithReg(ctx context.Context, cert x509.Certificate, code revocation.Reason, regID int64) error

func (RegistrationAuthorityClientWrapper) UpdateAuthorization

func (rac RegistrationAuthorityClientWrapper) UpdateAuthorization(ctx context.Context, authz core.Authorization, challengeIndex int, chall core.Challenge) (core.Authorization, error)

func (RegistrationAuthorityClientWrapper) UpdateRegistration

func (rac RegistrationAuthorityClientWrapper) UpdateRegistration(ctx context.Context, base, updates core.Registration) (core.Registration, error)

type RegistrationAuthorityServerWrapper

type RegistrationAuthorityServerWrapper struct {
	// contains filtered or unexported fields
}

RegistrationAuthorityServerWrapper is the gRPC version of a core.RegistrationAuthority server

func (*RegistrationAuthorityServerWrapper) AdministrativelyRevokeCertificate

func (ras *RegistrationAuthorityServerWrapper) AdministrativelyRevokeCertificate(ctx context.Context, request *rapb.AdministrativelyRevokeCertificateRequest) (*corepb.Empty, error)

func (*RegistrationAuthorityServerWrapper) DeactivateAuthorization

func (ras *RegistrationAuthorityServerWrapper) DeactivateAuthorization(ctx context.Context, request *corepb.Authorization) (*corepb.Empty, error)

func (*RegistrationAuthorityServerWrapper) DeactivateRegistration

func (ras *RegistrationAuthorityServerWrapper) DeactivateRegistration(ctx context.Context, request *corepb.Registration) (*corepb.Empty, error)

func (*RegistrationAuthorityServerWrapper) FinalizeOrder

func (*RegistrationAuthorityServerWrapper) NewAuthorization

func (*RegistrationAuthorityServerWrapper) NewCertificate

func (*RegistrationAuthorityServerWrapper) NewOrder

func (*RegistrationAuthorityServerWrapper) NewRegistration

func (*RegistrationAuthorityServerWrapper) RevokeCertificateWithReg

func (*RegistrationAuthorityServerWrapper) UpdateAuthorization

func (*RegistrationAuthorityServerWrapper) UpdateRegistration

type StorageAuthorityClientWrapper

type StorageAuthorityClientWrapper struct {
	// contains filtered or unexported fields
}

StorageAuthorityClientWrapper is the gRPC version of a core.StorageAuthority client

func (StorageAuthorityClientWrapper) AddCertificate

func (sac StorageAuthorityClientWrapper) AddCertificate(
	ctx context.Context,
	der []byte,
	regID int64,
	ocspResponse []byte,
	issued *time.Time) (string, error)

func (StorageAuthorityClientWrapper) AddPendingAuthorizations

func (StorageAuthorityClientWrapper) CountCertificatesByExactNames

func (sac StorageAuthorityClientWrapper) CountCertificatesByExactNames(ctx context.Context, domains []string, earliest, latest time.Time) ([]*sapb.CountByNames_MapElement, error)

func (StorageAuthorityClientWrapper) CountCertificatesByNames

func (sac StorageAuthorityClientWrapper) CountCertificatesByNames(ctx context.Context, domains []string, earliest, latest time.Time) ([]*sapb.CountByNames_MapElement, error)

func (StorageAuthorityClientWrapper) CountFQDNSets

func (sac StorageAuthorityClientWrapper) CountFQDNSets(ctx context.Context, window time.Duration, domains []string) (int64, error)

func (StorageAuthorityClientWrapper) CountInvalidAuthorizations

func (sac StorageAuthorityClientWrapper) CountInvalidAuthorizations(ctx context.Context, request *sapb.CountInvalidAuthorizationsRequest) (*sapb.Count, error)

func (StorageAuthorityClientWrapper) CountOrders

func (sac StorageAuthorityClientWrapper) CountOrders(ctx context.Context, acctID int64, earliest, latest time.Time) (int, error)

func (StorageAuthorityClientWrapper) CountPendingAuthorizations

func (sac StorageAuthorityClientWrapper) CountPendingAuthorizations(ctx context.Context, regID int64) (int, error)

func (StorageAuthorityClientWrapper) CountRegistrationsByIP

func (sac StorageAuthorityClientWrapper) CountRegistrationsByIP(ctx context.Context, ip net.IP, earliest, latest time.Time) (int, error)

func (StorageAuthorityClientWrapper) CountRegistrationsByIPRange

func (sac StorageAuthorityClientWrapper) CountRegistrationsByIPRange(ctx context.Context, ip net.IP, earliest, latest time.Time) (int, error)

func (StorageAuthorityClientWrapper) DeactivateAuthorization

func (sac StorageAuthorityClientWrapper) DeactivateAuthorization(ctx context.Context, id string) error

func (StorageAuthorityClientWrapper) DeactivateRegistration

func (sac StorageAuthorityClientWrapper) DeactivateRegistration(ctx context.Context, id int64) error

func (StorageAuthorityClientWrapper) FQDNSetExists

func (sac StorageAuthorityClientWrapper) FQDNSetExists(ctx context.Context, domains []string) (bool, error)

func (StorageAuthorityClientWrapper) FinalizeAuthorization

func (sac StorageAuthorityClientWrapper) FinalizeAuthorization(ctx context.Context, authz core.Authorization) error

func (StorageAuthorityClientWrapper) FinalizeOrder

func (sac StorageAuthorityClientWrapper) FinalizeOrder(ctx context.Context, order *corepb.Order) error

func (StorageAuthorityClientWrapper) GetAuthorization

func (sac StorageAuthorityClientWrapper) GetAuthorization(ctx context.Context, authID string) (core.Authorization, error)

func (StorageAuthorityClientWrapper) GetAuthorizations

func (StorageAuthorityClientWrapper) GetCertificate

func (sac StorageAuthorityClientWrapper) GetCertificate(ctx context.Context, serial string) (core.Certificate, error)

func (StorageAuthorityClientWrapper) GetCertificateStatus

func (sac StorageAuthorityClientWrapper) GetCertificateStatus(ctx context.Context, serial string) (core.CertificateStatus, error)

func (StorageAuthorityClientWrapper) GetOrder

func (StorageAuthorityClientWrapper) GetOrderForNames

func (StorageAuthorityClientWrapper) GetPendingAuthorization

func (StorageAuthorityClientWrapper) GetRegistration

func (sac StorageAuthorityClientWrapper) GetRegistration(ctx context.Context, regID int64) (core.Registration, error)

func (StorageAuthorityClientWrapper) GetRegistrationByKey

func (sac StorageAuthorityClientWrapper) GetRegistrationByKey(ctx context.Context, key *jose.JSONWebKey) (core.Registration, error)

func (StorageAuthorityClientWrapper) GetValidAuthorizations

func (sac StorageAuthorityClientWrapper) GetValidAuthorizations(ctx context.Context, regID int64, domains []string, now time.Time) (map[string]*core.Authorization, error)

func (StorageAuthorityClientWrapper) GetValidOrderAuthorizations

func (sas StorageAuthorityClientWrapper) GetValidOrderAuthorizations(
	ctx context.Context,
	request *sapb.GetValidOrderAuthorizationsRequest) (map[string]*core.Authorization, error)

func (StorageAuthorityClientWrapper) MarkCertificateRevoked

func (sac StorageAuthorityClientWrapper) MarkCertificateRevoked(ctx context.Context, serial string, reasonCode revocation.Reason) error

func (StorageAuthorityClientWrapper) NewOrder

func (sas StorageAuthorityClientWrapper) NewOrder(ctx context.Context, request *corepb.Order) (*corepb.Order, error)

func (StorageAuthorityClientWrapper) NewPendingAuthorization

func (sac StorageAuthorityClientWrapper) NewPendingAuthorization(ctx context.Context, authz core.Authorization) (core.Authorization, error)

func (StorageAuthorityClientWrapper) NewRegistration

func (StorageAuthorityClientWrapper) PreviousCertificateExists

func (sac StorageAuthorityClientWrapper) PreviousCertificateExists(
	ctx context.Context,
	req *sapb.PreviousCertificateExistsRequest,
) (*sapb.Exists, error)

func (StorageAuthorityClientWrapper) RevokeAuthorizationsByDomain

func (sac StorageAuthorityClientWrapper) RevokeAuthorizationsByDomain(ctx context.Context, domain core.AcmeIdentifier) (int64, int64, error)

func (StorageAuthorityClientWrapper) SetOrderError

func (sac StorageAuthorityClientWrapper) SetOrderError(ctx context.Context, order *corepb.Order) error

func (StorageAuthorityClientWrapper) SetOrderProcessing

func (sac StorageAuthorityClientWrapper) SetOrderProcessing(ctx context.Context, order *corepb.Order) error

func (StorageAuthorityClientWrapper) UpdatePendingAuthorization

func (sac StorageAuthorityClientWrapper) UpdatePendingAuthorization(ctx context.Context, authz core.Authorization) error

func (StorageAuthorityClientWrapper) UpdateRegistration

func (sac StorageAuthorityClientWrapper) UpdateRegistration(ctx context.Context, reg core.Registration) error

type StorageAuthorityServerWrapper

type StorageAuthorityServerWrapper struct {
	// contains filtered or unexported fields
}

StorageAuthorityServerWrapper is the gRPC version of a core.ServerAuthority server

func (StorageAuthorityServerWrapper) AddCertificate

func (StorageAuthorityServerWrapper) AddPendingAuthorizations

func (StorageAuthorityServerWrapper) CountCertificatesByExactNames

func (sas StorageAuthorityServerWrapper) CountCertificatesByExactNames(ctx context.Context, request *sapb.CountCertificatesByNamesRequest) (*sapb.CountByNames, error)

func (StorageAuthorityServerWrapper) CountCertificatesByNames

func (StorageAuthorityServerWrapper) CountFQDNSets

func (StorageAuthorityServerWrapper) CountInvalidAuthorizations

func (sas StorageAuthorityServerWrapper) CountInvalidAuthorizations(ctx context.Context, request *sapb.CountInvalidAuthorizationsRequest) (*sapb.Count, error)

func (StorageAuthorityServerWrapper) CountOrders

func (StorageAuthorityServerWrapper) CountPendingAuthorizations

func (sas StorageAuthorityServerWrapper) CountPendingAuthorizations(ctx context.Context, request *sapb.RegistrationID) (*sapb.Count, error)

func (StorageAuthorityServerWrapper) CountRegistrationsByIP

func (sas StorageAuthorityServerWrapper) CountRegistrationsByIP(ctx context.Context, request *sapb.CountRegistrationsByIPRequest) (*sapb.Count, error)

func (StorageAuthorityServerWrapper) CountRegistrationsByIPRange

func (sas StorageAuthorityServerWrapper) CountRegistrationsByIPRange(ctx context.Context, request *sapb.CountRegistrationsByIPRequest) (*sapb.Count, error)

func (StorageAuthorityServerWrapper) DeactivateAuthorization

func (sas StorageAuthorityServerWrapper) DeactivateAuthorization(ctx context.Context, request *sapb.AuthorizationID) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) DeactivateRegistration

func (sas StorageAuthorityServerWrapper) DeactivateRegistration(ctx context.Context, request *sapb.RegistrationID) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) FQDNSetExists

func (StorageAuthorityServerWrapper) FinalizeAuthorization

func (sas StorageAuthorityServerWrapper) FinalizeAuthorization(ctx context.Context, request *corepb.Authorization) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) FinalizeOrder

func (sas StorageAuthorityServerWrapper) FinalizeOrder(ctx context.Context, order *corepb.Order) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) GetAuthorization

func (StorageAuthorityServerWrapper) GetAuthorizations

func (StorageAuthorityServerWrapper) GetCertificate

func (sas StorageAuthorityServerWrapper) GetCertificate(ctx context.Context, request *sapb.Serial) (*corepb.Certificate, error)

func (StorageAuthorityServerWrapper) GetCertificateStatus

func (sas StorageAuthorityServerWrapper) GetCertificateStatus(ctx context.Context, request *sapb.Serial) (*sapb.CertificateStatus, error)

func (StorageAuthorityServerWrapper) GetOrder

func (StorageAuthorityServerWrapper) GetOrderForNames

func (StorageAuthorityServerWrapper) GetPendingAuthorization

func (StorageAuthorityServerWrapper) GetRegistration

func (StorageAuthorityServerWrapper) GetRegistrationByKey

func (sas StorageAuthorityServerWrapper) GetRegistrationByKey(ctx context.Context, request *sapb.JSONWebKey) (*corepb.Registration, error)

func (StorageAuthorityServerWrapper) GetValidAuthorizations

func (StorageAuthorityServerWrapper) GetValidOrderAuthorizations

func (StorageAuthorityServerWrapper) MarkCertificateRevoked

func (sas StorageAuthorityServerWrapper) MarkCertificateRevoked(ctx context.Context, request *sapb.MarkCertificateRevokedRequest) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) NewOrder

func (sas StorageAuthorityServerWrapper) NewOrder(ctx context.Context, request *corepb.Order) (*corepb.Order, error)

func (StorageAuthorityServerWrapper) NewPendingAuthorization

func (sas StorageAuthorityServerWrapper) NewPendingAuthorization(ctx context.Context, request *corepb.Authorization) (*corepb.Authorization, error)

func (StorageAuthorityServerWrapper) NewRegistration

func (StorageAuthorityServerWrapper) PreviousCertificateExists

func (sac StorageAuthorityServerWrapper) PreviousCertificateExists(
	ctx context.Context,
	req *sapb.PreviousCertificateExistsRequest,
) (*sapb.Exists, error)

func (StorageAuthorityServerWrapper) RevokeAuthorizationsByDomain

func (StorageAuthorityServerWrapper) SetOrderError

func (sas StorageAuthorityServerWrapper) SetOrderError(ctx context.Context, order *corepb.Order) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) SetOrderProcessing

func (sas StorageAuthorityServerWrapper) SetOrderProcessing(ctx context.Context, order *corepb.Order) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) UpdatePendingAuthorization

func (sas StorageAuthorityServerWrapper) UpdatePendingAuthorization(ctx context.Context, request *corepb.Authorization) (*corepb.Empty, error)

func (StorageAuthorityServerWrapper) UpdateRegistration

func (sas StorageAuthorityServerWrapper) UpdateRegistration(ctx context.Context, request *corepb.Registration) (*corepb.Empty, error)

type ValidationAuthorityGRPCClient

type ValidationAuthorityGRPCClient struct {
	// contains filtered or unexported fields
}

func (ValidationAuthorityGRPCClient) IsSafeDomain

IsSafeDomain returns true if the domain given is determined to be safe by an third-party safe browsing API.

func (ValidationAuthorityGRPCClient) PerformValidation

func (vac ValidationAuthorityGRPCClient) PerformValidation(ctx context.Context, domain string, challenge core.Challenge, authz core.Authorization) ([]core.ValidationRecord, error)

PerformValidation has the VA revalidate the specified challenge and returns the updated Challenge object.

type ValidationAuthorityGRPCServer

type ValidationAuthorityGRPCServer struct {
	// contains filtered or unexported fields
}

func (*ValidationAuthorityGRPCServer) IsSafeDomain

func (*ValidationAuthorityGRPCServer) PerformValidation

Directories

Path Synopsis
Package test_proto is a generated protocol buffer package.
Package test_proto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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