Documentation
¶
Overview ¶
Package wrappers wraps the GRPC calls in the core interfaces.
Index ¶
- Constants
- Variables
- func ClientSetup(c *cmd.GRPCClientConfig, stats metrics.Scope) (*grpc.ClientConn, error)
- func CodeToProblem(c codes.Code) probs.ProblemType
- func ErrorToProb(err error) *probs.ProblemDetails
- func NewServer(c *cmd.GRPCServerConfig, stats metrics.Scope) (*grpc.Server, net.Listener, error)
- func NewValidationAuthorityGRPCClient(cc *ggrpc.ClientConn) core.ValidationAuthority
- func RegisterValidationAuthorityGRPCServer(s *ggrpc.Server, impl core.ValidationAuthority) error
- type CertificateAuthorityClientWrapper
- type CertificateAuthorityServerWrapper
- type PublisherClientWrapper
- type PublisherServerWrapper
- type ValidationAuthorityGRPCClient
- type ValidationAuthorityGRPCServer
Constants ¶
const ( // DNSQueryTimeout is used when DNS queries timeout DNSQueryTimeout codes.Code = 100 // DNSError is used when DNS queries fail for some reason DNSError codes.Code = 101 )
gRPC error codes used by Boulder. While the gRPC codes end at 16 we start at 100 to provide a little leeway in case they ever decide to add more
Variables ¶
var CodedError = grpc.Errorf
CodedError is a alias required to appease go vet
var ErrMissingParameters = CodedError(codes.FailedPrecondition, "required RPC parameter was missing")
Functions ¶
func ClientSetup ¶
func ClientSetup(c *cmd.GRPCClientConfig, stats metrics.Scope) (*grpc.ClientConn, error)
ClientSetup loads various TLS certificates and creates a gRPC TransportCredentials that presents the client certificate and validates the certificate presented by the server is for a specific hostname and issued by the provided issuer certificate thens dials and returns a grpc.ClientConn to the remote service.
func CodeToProblem ¶
func CodeToProblem(c codes.Code) probs.ProblemType
CodeToProblem takes a gRPC error code and translates it to a Boulder ProblemType
func ErrorToProb ¶
func ErrorToProb(err error) *probs.ProblemDetails
ErrorToProb converts a error returned by a gRPC call to a probs.ProblemDetails
func NewServer ¶
NewServer loads various TLS certificates and creates a gRPC Server that verifies the client certificate was issued by the provided issuer certificate and presents a a server TLS certificate.
func NewValidationAuthorityGRPCClient ¶
func NewValidationAuthorityGRPCClient(cc *ggrpc.ClientConn) core.ValidationAuthority
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
func NewCertificateAuthorityClient ¶
func NewCertificateAuthorityClient(inner caPB.CertificateAuthorityClient, timeout time.Duration) *CertificateAuthorityClientWrapper
func (CertificateAuthorityClientWrapper) GenerateOCSP ¶
func (cac CertificateAuthorityClientWrapper) GenerateOCSP(ctx context.Context, ocspReq core.OCSPSigningRequest) ([]byte, error)
func (CertificateAuthorityClientWrapper) IssueCertificate ¶
func (cac CertificateAuthorityClientWrapper) IssueCertificate(ctx context.Context, csr x509.CertificateRequest, regID int64) (core.Certificate, error)
type CertificateAuthorityServerWrapper ¶
type CertificateAuthorityServerWrapper struct {
// contains filtered or unexported fields
}
CertificateAuthorityServerWrapper is the gRPC version of a core.CertificateAuthority server
func NewCertificateAuthorityServer ¶
func NewCertificateAuthorityServer(inner core.CertificateAuthority) *CertificateAuthorityServerWrapper
func (*CertificateAuthorityServerWrapper) GenerateOCSP ¶
func (cas *CertificateAuthorityServerWrapper) GenerateOCSP(ctx context.Context, request *caPB.GenerateOCSPRequest) (*caPB.OCSPResponse, error)
func (*CertificateAuthorityServerWrapper) IssueCertificate ¶
func (cas *CertificateAuthorityServerWrapper) IssueCertificate(ctx context.Context, request *caPB.IssueCertificateRequest) (*caPB.Certificate, error)
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, timeout time.Duration) *PublisherClientWrapper
NewPublisherClientWrapper returns an initialized PublisherClientWrapper
func (*PublisherClientWrapper) SubmitToCT ¶
func (pc *PublisherClientWrapper) SubmitToCT(ctx context.Context, der []byte) error
SubmitToCT makes a call to the gRPC version of the publisher
type PublisherServerWrapper ¶
type PublisherServerWrapper struct {
// contains filtered or unexported fields
}
PublisherServerWrapper is a wrapper required to bridge the differences between the gRPC and previous AMQP interfaces
func NewPublisherServerWrapper ¶
func NewPublisherServerWrapper(inner *publisher.Impl) *PublisherServerWrapper
NewPublisherServerWrapper returns an initialized PublisherServerWrapper
func (*PublisherServerWrapper) SubmitToCT ¶
func (pub *PublisherServerWrapper) SubmitToCT(ctx context.Context, request *pubPB.Request) (*pubPB.Empty, error)
SubmitToCT calls the same method on the wrapped publisher.Impl since their interfaces are different
type ValidationAuthorityGRPCClient ¶
type ValidationAuthorityGRPCClient struct {
// contains filtered or unexported fields
}
func (ValidationAuthorityGRPCClient) IsSafeDomain ¶
func (vac ValidationAuthorityGRPCClient) IsSafeDomain(ctx context.Context, req *vaPB.IsSafeDomainRequest) (*vaPB.IsDomainSafe, error)
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 (s *ValidationAuthorityGRPCServer) IsSafeDomain(ctx context.Context, in *vaPB.IsSafeDomainRequest) (*vaPB.IsDomainSafe, error)
func (*ValidationAuthorityGRPCServer) PerformValidation ¶
func (s *ValidationAuthorityGRPCServer) PerformValidation(ctx context.Context, in *vaPB.PerformValidationRequest) (*vaPB.ValidationResult, error)