go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/tokenserver/api/admin/v1/certificate_authorities_grpc.pb.go (about)

     1  // Copyright 2016 The LUCI Authors. All rights reserved.
     2  // Use of this source code is governed under the Apache License, Version 2.0
     3  // that can be found in the LICENSE file.
     4  
     5  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     6  // versions:
     7  // - protoc-gen-go-grpc v1.3.0
     8  // - protoc             v3.21.7
     9  // source: go.chromium.org/luci/tokenserver/api/admin/v1/certificate_authorities.proto
    10  
    11  package admin
    12  
    13  import (
    14  	context "context"
    15  	grpc "google.golang.org/grpc"
    16  	codes "google.golang.org/grpc/codes"
    17  	status "google.golang.org/grpc/status"
    18  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    19  )
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the grpc package it is being compiled against.
    23  // Requires gRPC-Go v1.32.0 or later.
    24  const _ = grpc.SupportPackageIsVersion7
    25  
    26  const (
    27  	CertificateAuthorities_FetchCRL_FullMethodName         = "/tokenserver.admin.CertificateAuthorities/FetchCRL"
    28  	CertificateAuthorities_ListCAs_FullMethodName          = "/tokenserver.admin.CertificateAuthorities/ListCAs"
    29  	CertificateAuthorities_GetCAStatus_FullMethodName      = "/tokenserver.admin.CertificateAuthorities/GetCAStatus"
    30  	CertificateAuthorities_IsRevokedCert_FullMethodName    = "/tokenserver.admin.CertificateAuthorities/IsRevokedCert"
    31  	CertificateAuthorities_CheckCertificate_FullMethodName = "/tokenserver.admin.CertificateAuthorities/CheckCertificate"
    32  )
    33  
    34  // CertificateAuthoritiesClient is the client API for CertificateAuthorities service.
    35  //
    36  // 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.
    37  type CertificateAuthoritiesClient interface {
    38  	// FetchCRL makes the server fetch a CRL for some CA.
    39  	FetchCRL(ctx context.Context, in *FetchCRLRequest, opts ...grpc.CallOption) (*FetchCRLResponse, error)
    40  	// ListCAs returns a list of Common Names of registered CAs.
    41  	ListCAs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListCAsResponse, error)
    42  	// GetCAStatus returns configuration of some CA defined in the config.
    43  	GetCAStatus(ctx context.Context, in *GetCAStatusRequest, opts ...grpc.CallOption) (*GetCAStatusResponse, error)
    44  	// IsRevokedCert says whether a certificate serial number is in the CRL.
    45  	IsRevokedCert(ctx context.Context, in *IsRevokedCertRequest, opts ...grpc.CallOption) (*IsRevokedCertResponse, error)
    46  	// CheckCertificate says whether a certificate is valid or not.
    47  	CheckCertificate(ctx context.Context, in *CheckCertificateRequest, opts ...grpc.CallOption) (*CheckCertificateResponse, error)
    48  }
    49  
    50  type certificateAuthoritiesClient struct {
    51  	cc grpc.ClientConnInterface
    52  }
    53  
    54  func NewCertificateAuthoritiesClient(cc grpc.ClientConnInterface) CertificateAuthoritiesClient {
    55  	return &certificateAuthoritiesClient{cc}
    56  }
    57  
    58  func (c *certificateAuthoritiesClient) FetchCRL(ctx context.Context, in *FetchCRLRequest, opts ...grpc.CallOption) (*FetchCRLResponse, error) {
    59  	out := new(FetchCRLResponse)
    60  	err := c.cc.Invoke(ctx, CertificateAuthorities_FetchCRL_FullMethodName, in, out, opts...)
    61  	if err != nil {
    62  		return nil, err
    63  	}
    64  	return out, nil
    65  }
    66  
    67  func (c *certificateAuthoritiesClient) ListCAs(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListCAsResponse, error) {
    68  	out := new(ListCAsResponse)
    69  	err := c.cc.Invoke(ctx, CertificateAuthorities_ListCAs_FullMethodName, in, out, opts...)
    70  	if err != nil {
    71  		return nil, err
    72  	}
    73  	return out, nil
    74  }
    75  
    76  func (c *certificateAuthoritiesClient) GetCAStatus(ctx context.Context, in *GetCAStatusRequest, opts ...grpc.CallOption) (*GetCAStatusResponse, error) {
    77  	out := new(GetCAStatusResponse)
    78  	err := c.cc.Invoke(ctx, CertificateAuthorities_GetCAStatus_FullMethodName, in, out, opts...)
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	return out, nil
    83  }
    84  
    85  func (c *certificateAuthoritiesClient) IsRevokedCert(ctx context.Context, in *IsRevokedCertRequest, opts ...grpc.CallOption) (*IsRevokedCertResponse, error) {
    86  	out := new(IsRevokedCertResponse)
    87  	err := c.cc.Invoke(ctx, CertificateAuthorities_IsRevokedCert_FullMethodName, in, out, opts...)
    88  	if err != nil {
    89  		return nil, err
    90  	}
    91  	return out, nil
    92  }
    93  
    94  func (c *certificateAuthoritiesClient) CheckCertificate(ctx context.Context, in *CheckCertificateRequest, opts ...grpc.CallOption) (*CheckCertificateResponse, error) {
    95  	out := new(CheckCertificateResponse)
    96  	err := c.cc.Invoke(ctx, CertificateAuthorities_CheckCertificate_FullMethodName, in, out, opts...)
    97  	if err != nil {
    98  		return nil, err
    99  	}
   100  	return out, nil
   101  }
   102  
   103  // CertificateAuthoritiesServer is the server API for CertificateAuthorities service.
   104  // All implementations must embed UnimplementedCertificateAuthoritiesServer
   105  // for forward compatibility
   106  type CertificateAuthoritiesServer interface {
   107  	// FetchCRL makes the server fetch a CRL for some CA.
   108  	FetchCRL(context.Context, *FetchCRLRequest) (*FetchCRLResponse, error)
   109  	// ListCAs returns a list of Common Names of registered CAs.
   110  	ListCAs(context.Context, *emptypb.Empty) (*ListCAsResponse, error)
   111  	// GetCAStatus returns configuration of some CA defined in the config.
   112  	GetCAStatus(context.Context, *GetCAStatusRequest) (*GetCAStatusResponse, error)
   113  	// IsRevokedCert says whether a certificate serial number is in the CRL.
   114  	IsRevokedCert(context.Context, *IsRevokedCertRequest) (*IsRevokedCertResponse, error)
   115  	// CheckCertificate says whether a certificate is valid or not.
   116  	CheckCertificate(context.Context, *CheckCertificateRequest) (*CheckCertificateResponse, error)
   117  	mustEmbedUnimplementedCertificateAuthoritiesServer()
   118  }
   119  
   120  // UnimplementedCertificateAuthoritiesServer must be embedded to have forward compatible implementations.
   121  type UnimplementedCertificateAuthoritiesServer struct {
   122  }
   123  
   124  func (UnimplementedCertificateAuthoritiesServer) FetchCRL(context.Context, *FetchCRLRequest) (*FetchCRLResponse, error) {
   125  	return nil, status.Errorf(codes.Unimplemented, "method FetchCRL not implemented")
   126  }
   127  func (UnimplementedCertificateAuthoritiesServer) ListCAs(context.Context, *emptypb.Empty) (*ListCAsResponse, error) {
   128  	return nil, status.Errorf(codes.Unimplemented, "method ListCAs not implemented")
   129  }
   130  func (UnimplementedCertificateAuthoritiesServer) GetCAStatus(context.Context, *GetCAStatusRequest) (*GetCAStatusResponse, error) {
   131  	return nil, status.Errorf(codes.Unimplemented, "method GetCAStatus not implemented")
   132  }
   133  func (UnimplementedCertificateAuthoritiesServer) IsRevokedCert(context.Context, *IsRevokedCertRequest) (*IsRevokedCertResponse, error) {
   134  	return nil, status.Errorf(codes.Unimplemented, "method IsRevokedCert not implemented")
   135  }
   136  func (UnimplementedCertificateAuthoritiesServer) CheckCertificate(context.Context, *CheckCertificateRequest) (*CheckCertificateResponse, error) {
   137  	return nil, status.Errorf(codes.Unimplemented, "method CheckCertificate not implemented")
   138  }
   139  func (UnimplementedCertificateAuthoritiesServer) mustEmbedUnimplementedCertificateAuthoritiesServer() {
   140  }
   141  
   142  // UnsafeCertificateAuthoritiesServer may be embedded to opt out of forward compatibility for this service.
   143  // Use of this interface is not recommended, as added methods to CertificateAuthoritiesServer will
   144  // result in compilation errors.
   145  type UnsafeCertificateAuthoritiesServer interface {
   146  	mustEmbedUnimplementedCertificateAuthoritiesServer()
   147  }
   148  
   149  func RegisterCertificateAuthoritiesServer(s grpc.ServiceRegistrar, srv CertificateAuthoritiesServer) {
   150  	s.RegisterService(&CertificateAuthorities_ServiceDesc, srv)
   151  }
   152  
   153  func _CertificateAuthorities_FetchCRL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   154  	in := new(FetchCRLRequest)
   155  	if err := dec(in); err != nil {
   156  		return nil, err
   157  	}
   158  	if interceptor == nil {
   159  		return srv.(CertificateAuthoritiesServer).FetchCRL(ctx, in)
   160  	}
   161  	info := &grpc.UnaryServerInfo{
   162  		Server:     srv,
   163  		FullMethod: CertificateAuthorities_FetchCRL_FullMethodName,
   164  	}
   165  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   166  		return srv.(CertificateAuthoritiesServer).FetchCRL(ctx, req.(*FetchCRLRequest))
   167  	}
   168  	return interceptor(ctx, in, info, handler)
   169  }
   170  
   171  func _CertificateAuthorities_ListCAs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   172  	in := new(emptypb.Empty)
   173  	if err := dec(in); err != nil {
   174  		return nil, err
   175  	}
   176  	if interceptor == nil {
   177  		return srv.(CertificateAuthoritiesServer).ListCAs(ctx, in)
   178  	}
   179  	info := &grpc.UnaryServerInfo{
   180  		Server:     srv,
   181  		FullMethod: CertificateAuthorities_ListCAs_FullMethodName,
   182  	}
   183  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   184  		return srv.(CertificateAuthoritiesServer).ListCAs(ctx, req.(*emptypb.Empty))
   185  	}
   186  	return interceptor(ctx, in, info, handler)
   187  }
   188  
   189  func _CertificateAuthorities_GetCAStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   190  	in := new(GetCAStatusRequest)
   191  	if err := dec(in); err != nil {
   192  		return nil, err
   193  	}
   194  	if interceptor == nil {
   195  		return srv.(CertificateAuthoritiesServer).GetCAStatus(ctx, in)
   196  	}
   197  	info := &grpc.UnaryServerInfo{
   198  		Server:     srv,
   199  		FullMethod: CertificateAuthorities_GetCAStatus_FullMethodName,
   200  	}
   201  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   202  		return srv.(CertificateAuthoritiesServer).GetCAStatus(ctx, req.(*GetCAStatusRequest))
   203  	}
   204  	return interceptor(ctx, in, info, handler)
   205  }
   206  
   207  func _CertificateAuthorities_IsRevokedCert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   208  	in := new(IsRevokedCertRequest)
   209  	if err := dec(in); err != nil {
   210  		return nil, err
   211  	}
   212  	if interceptor == nil {
   213  		return srv.(CertificateAuthoritiesServer).IsRevokedCert(ctx, in)
   214  	}
   215  	info := &grpc.UnaryServerInfo{
   216  		Server:     srv,
   217  		FullMethod: CertificateAuthorities_IsRevokedCert_FullMethodName,
   218  	}
   219  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   220  		return srv.(CertificateAuthoritiesServer).IsRevokedCert(ctx, req.(*IsRevokedCertRequest))
   221  	}
   222  	return interceptor(ctx, in, info, handler)
   223  }
   224  
   225  func _CertificateAuthorities_CheckCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   226  	in := new(CheckCertificateRequest)
   227  	if err := dec(in); err != nil {
   228  		return nil, err
   229  	}
   230  	if interceptor == nil {
   231  		return srv.(CertificateAuthoritiesServer).CheckCertificate(ctx, in)
   232  	}
   233  	info := &grpc.UnaryServerInfo{
   234  		Server:     srv,
   235  		FullMethod: CertificateAuthorities_CheckCertificate_FullMethodName,
   236  	}
   237  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   238  		return srv.(CertificateAuthoritiesServer).CheckCertificate(ctx, req.(*CheckCertificateRequest))
   239  	}
   240  	return interceptor(ctx, in, info, handler)
   241  }
   242  
   243  // CertificateAuthorities_ServiceDesc is the grpc.ServiceDesc for CertificateAuthorities service.
   244  // It's only intended for direct use with grpc.RegisterService,
   245  // and not to be introspected or modified (even as a copy)
   246  var CertificateAuthorities_ServiceDesc = grpc.ServiceDesc{
   247  	ServiceName: "tokenserver.admin.CertificateAuthorities",
   248  	HandlerType: (*CertificateAuthoritiesServer)(nil),
   249  	Methods: []grpc.MethodDesc{
   250  		{
   251  			MethodName: "FetchCRL",
   252  			Handler:    _CertificateAuthorities_FetchCRL_Handler,
   253  		},
   254  		{
   255  			MethodName: "ListCAs",
   256  			Handler:    _CertificateAuthorities_ListCAs_Handler,
   257  		},
   258  		{
   259  			MethodName: "GetCAStatus",
   260  			Handler:    _CertificateAuthorities_GetCAStatus_Handler,
   261  		},
   262  		{
   263  			MethodName: "IsRevokedCert",
   264  			Handler:    _CertificateAuthorities_IsRevokedCert_Handler,
   265  		},
   266  		{
   267  			MethodName: "CheckCertificate",
   268  			Handler:    _CertificateAuthorities_CheckCertificate_Handler,
   269  		},
   270  	},
   271  	Streams:  []grpc.StreamDesc{},
   272  	Metadata: "go.chromium.org/luci/tokenserver/api/admin/v1/certificate_authorities.proto",
   273  }