Documentation ¶
Index ¶
- Constants
- Variables
- func WithLogHandler(logger slog.Handler) cfg.Option[Config]
- func WithLogger(logger *slog.Logger) cfg.Option[Config]
- func WithMetrics(m Metrics) cfg.Option[Config]
- func WithTemplate(opts ...cfg.Option[certs.Template]) cfg.Option[Config]
- func WithTracer(tracer trace.Tracer) cfg.Option[Config]
- type CertificateAuthority
- func (ca *CertificateAuthority) CreateCertificate(ctx context.Context, req *pb.CertificateRequest) (*pb.CertificateResponse, error)
- func (ca *CertificateAuthority) DeleteCertificate(ctx context.Context, req *pb.CertificateDeletionRequest) (*pb.CertificateDeletionResponse, error)
- func (ca *CertificateAuthority) DeleteService(ctx context.Context, req *pb.DeletionRequest) (*pb.DeletionResponse, error)
- func (ca *CertificateAuthority) ListCertificates(ctx context.Context, req *pb.CertificateRequest) (*pb.ListCertificatesResponse, error)
- func (ca *CertificateAuthority) RegisterService(ctx context.Context, req *pb.CertificateRequest) (*pb.CertificateResponse, error)
- func (ca *CertificateAuthority) RootCertificate(ctx context.Context, _ *pb.RootCertificateRequest) (*pb.RootCertificateResponse, error)
- func (ca *CertificateAuthority) Shutdown(ctx context.Context) error
- func (ca *CertificateAuthority) VerifyCertificate(ctx context.Context, req *pb.VerificationRequest) (*pb.VerificationResponse, error)
- type Config
- type Metrics
- type Repository
Constants ¶
Variables ¶
View Source
var ( ErrNilRepository = errs.WithDomain(errDomain, ErrNil, ErrRepository) ErrNilPrivateKey = errs.WithDomain(errDomain, ErrNil, ErrPrivateKey) ErrInvalidPublicKey = errs.WithDomain(errDomain, ErrInvalid, ErrPublicKey) ErrInvalidCertificate = errs.WithDomain(errDomain, ErrInvalid, ErrCertificate) )
Functions ¶
Types ¶
type CertificateAuthority ¶
type CertificateAuthority struct { pb.UnimplementedCertificateAuthorityServer // contains filtered or unexported fields }
func NewCertificateAuthority ¶
func NewCertificateAuthority( repo Repository, privateKey *ecdsa.PrivateKey, opts ...cfg.Option[Config], ) (*CertificateAuthority, error)
func (*CertificateAuthority) CreateCertificate ¶
func (ca *CertificateAuthority) CreateCertificate(ctx context.Context, req *pb.CertificateRequest) (*pb.CertificateResponse, error)
func (*CertificateAuthority) DeleteCertificate ¶
func (ca *CertificateAuthority) DeleteCertificate(ctx context.Context, req *pb.CertificateDeletionRequest) (*pb.CertificateDeletionResponse, error)
func (*CertificateAuthority) DeleteService ¶
func (ca *CertificateAuthority) DeleteService(ctx context.Context, req *pb.DeletionRequest) (*pb.DeletionResponse, error)
func (*CertificateAuthority) ListCertificates ¶
func (ca *CertificateAuthority) ListCertificates(ctx context.Context, req *pb.CertificateRequest) (*pb.ListCertificatesResponse, error)
func (*CertificateAuthority) RegisterService ¶
func (ca *CertificateAuthority) RegisterService( ctx context.Context, req *pb.CertificateRequest) (*pb.CertificateResponse, error)
func (*CertificateAuthority) RootCertificate ¶
func (ca *CertificateAuthority) RootCertificate(ctx context.Context, _ *pb.RootCertificateRequest) (*pb.RootCertificateResponse, error)
func (*CertificateAuthority) Shutdown ¶
func (ca *CertificateAuthority) Shutdown(ctx context.Context) error
func (*CertificateAuthority) VerifyCertificate ¶
func (ca *CertificateAuthority) VerifyCertificate(ctx context.Context, req *pb.VerificationRequest) (*pb.VerificationResponse, error)
type Metrics ¶
type Metrics interface { IncServiceRegistries() IncServiceRegistryFailed() ObserveServiceRegistryLatency(ctx context.Context, duration time.Duration) IncServiceDeletions() IncServiceDeletionFailed() ObserveServiceDeletionLatency(ctx context.Context, duration time.Duration) IncCertificatesCreated(service string) IncCertificatesCreateFailed(service string) ObserveCertificatesCreateLatency(ctx context.Context, service string, duration time.Duration) IncCertificatesListed(service string) IncCertificatesListFailed(service string) ObserveCertificatesListLatency(ctx context.Context, service string, duration time.Duration) IncCertificatesDeleted(service string) IncCertificatesDeleteFailed(service string) ObserveCertificatesDeleteLatency(ctx context.Context, service string, duration time.Duration) IncCertificatesVerified(service string) IncCertificateVerificationFailed(service string) ObserveCertificateVerificationLatency(ctx context.Context, service string, duration time.Duration) IncRootCertificateRequests() IncRootCertificateRequestFailed() ObserveRootCertificateRequestLatency(ctx context.Context, duration time.Duration) }
type Repository ¶
type Repository interface { GetService(ctx context.Context, service string) (pubKey []byte, err error) CreateService(ctx context.Context, service string, pubKey []byte) (err error) DeleteService(ctx context.Context, service string) error ListCertificates(ctx context.Context, service string) (certs []*pb.CertificateResponse, err error) CreateCertificate(ctx context.Context, service string, cert []byte, expiry time.Time) error DeleteCertificate(ctx context.Context, service string, cert []byte) error Shutdown(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.