grpc

package
v0.0.0-...-2d112bd Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(g *grpc.Server, s *Service)

Register registers an identity service implementation in the provided gRPC server.

Types

type InvalidToken

type InvalidToken struct{ Reason string }

InvalidToken is an error type returned by Validators to indicate that the provided authentication token was not valid.

func (InvalidToken) Error

func (e InvalidToken) Error() string

type NotAuthenticated

type NotAuthenticated struct{}

NotAuthenticated is an error type returned by Validators to indicate that the provided authentication token could not be authenticated.

func (NotAuthenticated) Error

func (NotAuthenticated) Error() string

type Service

type Service struct {
	pb.UnimplementedIdentityServer
	// contains filtered or unexported fields
}

Service implements the gRPC service in terms of a Validator and Issuer.

func New

func New(log zerolog.Logger, validator Validator, recordEvent func(parent runtime.Object, eventType, reason, message string), csrService csrService) *Service

New creates a new identity service.

func (*Service) Certify

func (svc *Service) Certify(ctx context.Context, req *pb.CertifyRequest) (*pb.CertifyResponse, error)

type Validator

type Validator interface {
	// Validate takes an opaque authentication token, attempts to validate its
	// authenticity, and produces a DNS-like identifier.
	//
	// An InvalidToken error should be returned if the provided token was not in a
	// correct form.
	//
	// A NotAuthenticated error should be returned if the authenticity of the
	// token cannot be validated.
	Validate(context.Context, []byte) (string, error)
}

Validator implementors accept a bearer token, validates it, and returns a DNS-form identity.

Jump to

Keyboard shortcuts

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