@@ -32,18 +32,21 @@ import (
3232 "github.com/sigstore/fulcio/pkg/log"
3333 "github.com/sigstore/sigstore/pkg/cryptoutils"
3434 "google.golang.org/grpc/codes"
35+ health "google.golang.org/grpc/health/grpc_health_v1"
3536 "google.golang.org/grpc/metadata"
37+ "google.golang.org/grpc/status"
3638)
3739
38- type grpcCAServer struct {
40+ type GRPCCAServer struct {
3941 fulciogrpc.UnimplementedCAServer
42+ health.HealthServer
4043 ct * ctclient.LogClient
4144 ca certauth.CertificateAuthority
4245 identity.IssuerPool
4346}
4447
45- func NewGRPCCAServer (ct * ctclient.LogClient , ca certauth.CertificateAuthority , ip identity.IssuerPool ) fulciogrpc. CAServer {
46- return & grpcCAServer {
48+ func NewGRPCCAServer (ct * ctclient.LogClient , ca certauth.CertificateAuthority , ip identity.IssuerPool ) * GRPCCAServer {
49+ return & GRPCCAServer {
4750 ct : ct ,
4851 ca : ca ,
4952 IssuerPool : ip ,
@@ -54,7 +57,7 @@ const (
5457 MetadataOIDCTokenKey = "oidcidentitytoken"
5558)
5659
57- func (g * grpcCAServer ) CreateSigningCertificate (ctx context.Context , request * fulciogrpc.CreateSigningCertificateRequest ) (* fulciogrpc.SigningCertificate , error ) {
60+ func (g * GRPCCAServer ) CreateSigningCertificate (ctx context.Context , request * fulciogrpc.CreateSigningCertificateRequest ) (* fulciogrpc.SigningCertificate , error ) {
5861 logger := log .ContextLogger (ctx )
5962
6063 // OIDC token either is passed in gRPC field or was extracted from HTTP headers
@@ -228,7 +231,7 @@ func (g *grpcCAServer) CreateSigningCertificate(ctx context.Context, request *fu
228231 return result , nil
229232}
230233
231- func (g * grpcCAServer ) GetTrustBundle (ctx context.Context , _ * fulciogrpc.GetTrustBundleRequest ) (* fulciogrpc.TrustBundle , error ) {
234+ func (g * GRPCCAServer ) GetTrustBundle (ctx context.Context , _ * fulciogrpc.GetTrustBundleRequest ) (* fulciogrpc.TrustBundle , error ) {
232235 trustBundle , err := g .ca .TrustBundle (ctx )
233236 if err != nil {
234237 return nil , handleFulcioGRPCError (ctx , codes .Internal , err , retrieveTrustBundleCAError )
@@ -252,7 +255,7 @@ func (g *grpcCAServer) GetTrustBundle(ctx context.Context, _ *fulciogrpc.GetTrus
252255 return resp , nil
253256}
254257
255- func (g * grpcCAServer ) GetConfiguration (ctx context.Context , _ * fulciogrpc.GetConfigurationRequest ) (* fulciogrpc.Configuration , error ) {
258+ func (g * GRPCCAServer ) GetConfiguration (ctx context.Context , _ * fulciogrpc.GetConfigurationRequest ) (* fulciogrpc.Configuration , error ) {
256259 cfg := config .FromContext (ctx )
257260 if cfg == nil {
258261 err := errors .New ("configuration not loaded" )
@@ -263,3 +266,11 @@ func (g *grpcCAServer) GetConfiguration(ctx context.Context, _ *fulciogrpc.GetCo
263266 Issuers : cfg .ToIssuers (),
264267 }, nil
265268}
269+
270+ func (g * GRPCCAServer ) Check (_ context.Context , _ * health.HealthCheckRequest ) (* health.HealthCheckResponse , error ) {
271+ return & health.HealthCheckResponse {Status : health .HealthCheckResponse_SERVING }, nil
272+ }
273+
274+ func (g * GRPCCAServer ) Watch (_ * health.HealthCheckRequest , _ health.Health_WatchServer ) error {
275+ return status .Error (codes .Unimplemented , "unimplemented" )
276+ }
0 commit comments