mirror of
https://github.com/hanzoai/ca.git
synced 2026-11-03 18:08:27 +00:00
305 lines
11 KiB
Go
305 lines
11 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.2
|
|
// - protoc v7.36.2
|
|
// source: cis.proto
|
|
|
|
package pb
|
|
|
|
import (
|
|
context "context"
|
|
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
CIS_GetRoots_FullMethodName = "/pb.CIS/GetRoots"
|
|
CIS_GetIssuer_FullMethodName = "/pb.CIS/GetIssuer"
|
|
CIS_GetCertificate_FullMethodName = "/pb.CIS/GetCertificate"
|
|
CIS_GetCertificateStatus_FullMethodName = "/pb.CIS/GetCertificateStatus"
|
|
CIS_GetCRL_FullMethodName = "/pb.CIS/GetCRL"
|
|
)
|
|
|
|
// CISClient is the client API for CIS service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
|
//
|
|
// CIS is the Certificate Information Service.
|
|
// It is the read-only gRPC and REST view of the CA for authenticated
|
|
// callers: trust anchors, issuer chains, certificate information,
|
|
// revocation status and CRLs of every org, without their tenancy. It never
|
|
// holds CA private keys.
|
|
//
|
|
// The binary endpoints the issued certificates reference (the AIA issuer
|
|
// certificate, the CRL Distribution Point and the OCSP responder) are the
|
|
// aia service, served over plain HTTP to any caller.
|
|
type CISClient interface {
|
|
// GetRoots returns the published trust anchors
|
|
GetRoots(ctx context.Context, in *GetRootsRequest, opts ...grpc.CallOption) (*RootsResponse, error)
|
|
// GetIssuer returns the issuer chain and status by IKID
|
|
GetIssuer(ctx context.Context, in *GetIssuerInfoRequest, opts ...grpc.CallOption) (*IssuerInfo, error)
|
|
// GetCertificate returns the certificate by ID, SKID, Sha256 or issuer
|
|
// and serial number
|
|
GetCertificate(ctx context.Context, in *GetCertificateInfoRequest, opts ...grpc.CallOption) (*CertificateResponse, error)
|
|
// GetCertificateStatus returns the revocation status of a certificate
|
|
GetCertificateStatus(ctx context.Context, in *GetCertificateInfoRequest, opts ...grpc.CallOption) (*CertificateStatusResponse, error)
|
|
// GetCRL returns the current CRL of the issuer in PEM format
|
|
GetCRL(ctx context.Context, in *GetCrlRequest, opts ...grpc.CallOption) (*CrlResponse, error)
|
|
}
|
|
|
|
type cISClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewCISClient(cc grpc.ClientConnInterface) CISClient {
|
|
return &cISClient{cc}
|
|
}
|
|
|
|
func (c *cISClient) GetRoots(ctx context.Context, in *GetRootsRequest, opts ...grpc.CallOption) (*RootsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(RootsResponse)
|
|
err := c.cc.Invoke(ctx, CIS_GetRoots_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cISClient) GetIssuer(ctx context.Context, in *GetIssuerInfoRequest, opts ...grpc.CallOption) (*IssuerInfo, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(IssuerInfo)
|
|
err := c.cc.Invoke(ctx, CIS_GetIssuer_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cISClient) GetCertificate(ctx context.Context, in *GetCertificateInfoRequest, opts ...grpc.CallOption) (*CertificateResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CertificateResponse)
|
|
err := c.cc.Invoke(ctx, CIS_GetCertificate_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cISClient) GetCertificateStatus(ctx context.Context, in *GetCertificateInfoRequest, opts ...grpc.CallOption) (*CertificateStatusResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CertificateStatusResponse)
|
|
err := c.cc.Invoke(ctx, CIS_GetCertificateStatus_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *cISClient) GetCRL(ctx context.Context, in *GetCrlRequest, opts ...grpc.CallOption) (*CrlResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CrlResponse)
|
|
err := c.cc.Invoke(ctx, CIS_GetCRL_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// CISServer is the server API for CIS service.
|
|
// All implementations should embed UnimplementedCISServer
|
|
// for forward compatibility.
|
|
//
|
|
// CIS is the Certificate Information Service.
|
|
// It is the read-only gRPC and REST view of the CA for authenticated
|
|
// callers: trust anchors, issuer chains, certificate information,
|
|
// revocation status and CRLs of every org, without their tenancy. It never
|
|
// holds CA private keys.
|
|
//
|
|
// The binary endpoints the issued certificates reference (the AIA issuer
|
|
// certificate, the CRL Distribution Point and the OCSP responder) are the
|
|
// aia service, served over plain HTTP to any caller.
|
|
type CISServer interface {
|
|
// GetRoots returns the published trust anchors
|
|
GetRoots(context.Context, *GetRootsRequest) (*RootsResponse, error)
|
|
// GetIssuer returns the issuer chain and status by IKID
|
|
GetIssuer(context.Context, *GetIssuerInfoRequest) (*IssuerInfo, error)
|
|
// GetCertificate returns the certificate by ID, SKID, Sha256 or issuer
|
|
// and serial number
|
|
GetCertificate(context.Context, *GetCertificateInfoRequest) (*CertificateResponse, error)
|
|
// GetCertificateStatus returns the revocation status of a certificate
|
|
GetCertificateStatus(context.Context, *GetCertificateInfoRequest) (*CertificateStatusResponse, error)
|
|
// GetCRL returns the current CRL of the issuer in PEM format
|
|
GetCRL(context.Context, *GetCrlRequest) (*CrlResponse, error)
|
|
}
|
|
|
|
// UnimplementedCISServer should be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedCISServer struct{}
|
|
|
|
func (UnimplementedCISServer) GetRoots(context.Context, *GetRootsRequest) (*RootsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetRoots not implemented")
|
|
}
|
|
func (UnimplementedCISServer) GetIssuer(context.Context, *GetIssuerInfoRequest) (*IssuerInfo, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetIssuer not implemented")
|
|
}
|
|
func (UnimplementedCISServer) GetCertificate(context.Context, *GetCertificateInfoRequest) (*CertificateResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetCertificate not implemented")
|
|
}
|
|
func (UnimplementedCISServer) GetCertificateStatus(context.Context, *GetCertificateInfoRequest) (*CertificateStatusResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetCertificateStatus not implemented")
|
|
}
|
|
func (UnimplementedCISServer) GetCRL(context.Context, *GetCrlRequest) (*CrlResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetCRL not implemented")
|
|
}
|
|
func (UnimplementedCISServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeCISServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to CISServer will
|
|
// result in compilation errors.
|
|
type UnsafeCISServer interface {
|
|
mustEmbedUnimplementedCISServer()
|
|
}
|
|
|
|
func RegisterCISServer(s grpc.ServiceRegistrar, srv CISServer) {
|
|
// If the following call panics, it indicates UnimplementedCISServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&CIS_ServiceDesc, srv)
|
|
}
|
|
|
|
func _CIS_GetRoots_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
in := new(GetRootsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CISServer).GetRoots(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: CIS_GetRoots_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req any) (any, error) {
|
|
return srv.(CISServer).GetRoots(ctx, req.(*GetRootsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CIS_GetIssuer_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
in := new(GetIssuerInfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CISServer).GetIssuer(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: CIS_GetIssuer_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req any) (any, error) {
|
|
return srv.(CISServer).GetIssuer(ctx, req.(*GetIssuerInfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CIS_GetCertificate_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
in := new(GetCertificateInfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CISServer).GetCertificate(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: CIS_GetCertificate_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req any) (any, error) {
|
|
return srv.(CISServer).GetCertificate(ctx, req.(*GetCertificateInfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CIS_GetCertificateStatus_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
in := new(GetCertificateInfoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CISServer).GetCertificateStatus(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: CIS_GetCertificateStatus_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req any) (any, error) {
|
|
return srv.(CISServer).GetCertificateStatus(ctx, req.(*GetCertificateInfoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CIS_GetCRL_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
|
|
in := new(GetCrlRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CISServer).GetCRL(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: CIS_GetCRL_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req any) (any, error) {
|
|
return srv.(CISServer).GetCRL(ctx, req.(*GetCrlRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// CIS_ServiceDesc is the grpc.ServiceDesc for CIS service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var CIS_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "pb.CIS",
|
|
HandlerType: (*CISServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GetRoots",
|
|
Handler: _CIS_GetRoots_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetIssuer",
|
|
Handler: _CIS_GetIssuer_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetCertificate",
|
|
Handler: _CIS_GetCertificate_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetCertificateStatus",
|
|
Handler: _CIS_GetCertificateStatus_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetCRL",
|
|
Handler: _CIS_GetCRL_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "cis.proto",
|
|
}
|