Files
ca/privpb/admin_grpc.pb.go
dissoupovandGitHub 27e411997c Added integration tests (#16)
* Refactor Backend service

* Added integration tests
2026-10-23 18:02:39 -05:00

322 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: admin.proto
package privpb
import (
context "context"
pb "github.com/effective-security/trustyca/api/pb"
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 (
Admin_ListOrgs_FullMethodName = "/privpb.Admin/ListOrgs"
Admin_ListProjects_FullMethodName = "/privpb.Admin/ListProjects"
Admin_ListIssuers_FullMethodName = "/privpb.Admin/ListIssuers"
Admin_ListCertificates_FullMethodName = "/privpb.Admin/ListCertificates"
)
// AdminClient is the client API for Admin 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.
type AdminClient interface {
// ListOrgs lists orgs
ListOrgs(ctx context.Context, in *ListOrgsRequest, opts ...grpc.CallOption) (*pb.OrgsResponse, error)
//
//// GetOrg returns an org with its budget
//rpc GetOrg(GetOrgRequest) returns (pb.Org) {
//option (google.api.http) = {
//post: "/privpb.Admin/GetOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org get";
//}
//// CreateOrg creates an org owned by an existing user
//rpc CreateOrg(CreateOrgRequest)
//returns (pb.Organization) {
//option (google.api.http) = {
//post: "/privpb.Admin/CreateOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org create";
//}
//// UpdateOrg updates an org
//rpc UpdateOrg(UpdateOrgRequest)
//returns (pb.Organization) {
//option (google.api.http) = {
//post: "/privpb.Admin/UpdateOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org update";
//}
//// DeleteOrg deletes an org that has no projects
//rpc DeleteOrg(DeleteOrgRequest)
//returns (google.protobuf.Empty) {
//option (google.api.http) = {
//post: "/privpb.Admin/DeleteOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org delete";
//}
ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*pb.ProjectsResponse, error)
// ListIssuers lists the issuers of every org and of the platform, newest
// first, for support staff; the tenant view of an org is CA.ListIssuers.
// Private key material is never returned.
ListIssuers(ctx context.Context, in *ListAllIssuersRequest, opts ...grpc.CallOption) (*pb.IssuersResponse, error)
// ListCertificates lists the certificates of every org and of the
// platform, newest first, for support staff; the tenant view of an org
// is CA.ListCertificates
ListCertificates(ctx context.Context, in *ListAllCertificatesRequest, opts ...grpc.CallOption) (*pb.CertificatesResponse, error)
}
type adminClient struct {
cc grpc.ClientConnInterface
}
func NewAdminClient(cc grpc.ClientConnInterface) AdminClient {
return &adminClient{cc}
}
func (c *adminClient) ListOrgs(ctx context.Context, in *ListOrgsRequest, opts ...grpc.CallOption) (*pb.OrgsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(pb.OrgsResponse)
err := c.cc.Invoke(ctx, Admin_ListOrgs_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) ListProjects(ctx context.Context, in *ListProjectsRequest, opts ...grpc.CallOption) (*pb.ProjectsResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(pb.ProjectsResponse)
err := c.cc.Invoke(ctx, Admin_ListProjects_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) ListIssuers(ctx context.Context, in *ListAllIssuersRequest, opts ...grpc.CallOption) (*pb.IssuersResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(pb.IssuersResponse)
err := c.cc.Invoke(ctx, Admin_ListIssuers_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *adminClient) ListCertificates(ctx context.Context, in *ListAllCertificatesRequest, opts ...grpc.CallOption) (*pb.CertificatesResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(pb.CertificatesResponse)
err := c.cc.Invoke(ctx, Admin_ListCertificates_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AdminServer is the server API for Admin service.
// All implementations should embed UnimplementedAdminServer
// for forward compatibility.
type AdminServer interface {
// ListOrgs lists orgs
ListOrgs(context.Context, *ListOrgsRequest) (*pb.OrgsResponse, error)
//
//// GetOrg returns an org with its budget
//rpc GetOrg(GetOrgRequest) returns (pb.Org) {
//option (google.api.http) = {
//post: "/privpb.Admin/GetOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org get";
//}
//// CreateOrg creates an org owned by an existing user
//rpc CreateOrg(CreateOrgRequest)
//returns (pb.Organization) {
//option (google.api.http) = {
//post: "/privpb.Admin/CreateOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org create";
//}
//// UpdateOrg updates an org
//rpc UpdateOrg(UpdateOrgRequest)
//returns (pb.Organization) {
//option (google.api.http) = {
//post: "/privpb.Admin/UpdateOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org update";
//}
//// DeleteOrg deletes an org that has no projects
//rpc DeleteOrg(DeleteOrgRequest)
//returns (google.protobuf.Empty) {
//option (google.api.http) = {
//post: "/privpb.Admin/DeleteOrganization",
//body: "*"
//};
//option (es.api.cli_cmd) = "org delete";
//}
ListProjects(context.Context, *ListProjectsRequest) (*pb.ProjectsResponse, error)
// ListIssuers lists the issuers of every org and of the platform, newest
// first, for support staff; the tenant view of an org is CA.ListIssuers.
// Private key material is never returned.
ListIssuers(context.Context, *ListAllIssuersRequest) (*pb.IssuersResponse, error)
// ListCertificates lists the certificates of every org and of the
// platform, newest first, for support staff; the tenant view of an org
// is CA.ListCertificates
ListCertificates(context.Context, *ListAllCertificatesRequest) (*pb.CertificatesResponse, error)
}
// UnimplementedAdminServer 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 UnimplementedAdminServer struct{}
func (UnimplementedAdminServer) ListOrgs(context.Context, *ListOrgsRequest) (*pb.OrgsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListOrgs not implemented")
}
func (UnimplementedAdminServer) ListProjects(context.Context, *ListProjectsRequest) (*pb.ProjectsResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListProjects not implemented")
}
func (UnimplementedAdminServer) ListIssuers(context.Context, *ListAllIssuersRequest) (*pb.IssuersResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListIssuers not implemented")
}
func (UnimplementedAdminServer) ListCertificates(context.Context, *ListAllCertificatesRequest) (*pb.CertificatesResponse, error) {
return nil, status.Error(codes.Unimplemented, "method ListCertificates not implemented")
}
func (UnimplementedAdminServer) testEmbeddedByValue() {}
// UnsafeAdminServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AdminServer will
// result in compilation errors.
type UnsafeAdminServer interface {
mustEmbedUnimplementedAdminServer()
}
func RegisterAdminServer(s grpc.ServiceRegistrar, srv AdminServer) {
// If the following call panics, it indicates UnimplementedAdminServer 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(&Admin_ServiceDesc, srv)
}
func _Admin_ListOrgs_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
in := new(ListOrgsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).ListOrgs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_ListOrgs_FullMethodName,
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(AdminServer).ListOrgs(ctx, req.(*ListOrgsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_ListProjects_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
in := new(ListProjectsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).ListProjects(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_ListProjects_FullMethodName,
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(AdminServer).ListProjects(ctx, req.(*ListProjectsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_ListIssuers_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
in := new(ListAllIssuersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).ListIssuers(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_ListIssuers_FullMethodName,
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(AdminServer).ListIssuers(ctx, req.(*ListAllIssuersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Admin_ListCertificates_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) {
in := new(ListAllCertificatesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AdminServer).ListCertificates(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Admin_ListCertificates_FullMethodName,
}
handler := func(ctx context.Context, req any) (any, error) {
return srv.(AdminServer).ListCertificates(ctx, req.(*ListAllCertificatesRequest))
}
return interceptor(ctx, in, info, handler)
}
// Admin_ServiceDesc is the grpc.ServiceDesc for Admin service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Admin_ServiceDesc = grpc.ServiceDesc{
ServiceName: "privpb.Admin",
HandlerType: (*AdminServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ListOrgs",
Handler: _Admin_ListOrgs_Handler,
},
{
MethodName: "ListProjects",
Handler: _Admin_ListProjects_Handler,
},
{
MethodName: "ListIssuers",
Handler: _Admin_ListIssuers_Handler,
},
{
MethodName: "ListCertificates",
Handler: _Admin_ListCertificates_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "admin.proto",
}