blob: 26289b121340b01e5c7b2181f309f1f7e3a5b6da [file] [log] [blame]
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: registry/v1alpha1/authn.proto
package registryv1alpha1
import (
context "context"
)
import (
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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
AuthnService_GetCurrentUser_FullMethodName = "/bufman.dubbo.apache.org.registry.v1alpha1.AuthnService/GetCurrentUser"
AuthnService_GetCurrentUserSubject_FullMethodName = "/bufman.dubbo.apache.org.registry.v1alpha1.AuthnService/GetCurrentUserSubject"
)
// AuthnServiceClient is the client API for AuthnService 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 AuthnServiceClient interface {
// GetCurrentUser gets information associated with the current user.
//
// The user's ID is retrieved from the request's authentication header.
GetCurrentUser(ctx context.Context, in *GetCurrentUserRequest, opts ...grpc.CallOption) (*GetCurrentUserResponse, error)
// GetCurrentUserSubject gets the currently logged in users subject.
//
// The user's ID is retrieved from the request's authentication header.
GetCurrentUserSubject(ctx context.Context, in *GetCurrentUserSubjectRequest, opts ...grpc.CallOption) (*GetCurrentUserSubjectResponse, error)
}
type authnServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAuthnServiceClient(cc grpc.ClientConnInterface) AuthnServiceClient {
return &authnServiceClient{cc}
}
func (c *authnServiceClient) GetCurrentUser(ctx context.Context, in *GetCurrentUserRequest, opts ...grpc.CallOption) (*GetCurrentUserResponse, error) {
out := new(GetCurrentUserResponse)
err := c.cc.Invoke(ctx, AuthnService_GetCurrentUser_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authnServiceClient) GetCurrentUserSubject(ctx context.Context, in *GetCurrentUserSubjectRequest, opts ...grpc.CallOption) (*GetCurrentUserSubjectResponse, error) {
out := new(GetCurrentUserSubjectResponse)
err := c.cc.Invoke(ctx, AuthnService_GetCurrentUserSubject_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthnServiceServer is the server API for AuthnService service.
// All implementations must embed UnimplementedAuthnServiceServer
// for forward compatibility
type AuthnServiceServer interface {
// GetCurrentUser gets information associated with the current user.
//
// The user's ID is retrieved from the request's authentication header.
GetCurrentUser(context.Context, *GetCurrentUserRequest) (*GetCurrentUserResponse, error)
// GetCurrentUserSubject gets the currently logged in users subject.
//
// The user's ID is retrieved from the request's authentication header.
GetCurrentUserSubject(context.Context, *GetCurrentUserSubjectRequest) (*GetCurrentUserSubjectResponse, error)
mustEmbedUnimplementedAuthnServiceServer()
}
// UnimplementedAuthnServiceServer must be embedded to have forward compatible implementations.
type UnimplementedAuthnServiceServer struct {
}
func (UnimplementedAuthnServiceServer) GetCurrentUser(context.Context, *GetCurrentUserRequest) (*GetCurrentUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCurrentUser not implemented")
}
func (UnimplementedAuthnServiceServer) GetCurrentUserSubject(context.Context, *GetCurrentUserSubjectRequest) (*GetCurrentUserSubjectResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCurrentUserSubject not implemented")
}
func (UnimplementedAuthnServiceServer) mustEmbedUnimplementedAuthnServiceServer() {}
// UnsafeAuthnServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthnServiceServer will
// result in compilation errors.
type UnsafeAuthnServiceServer interface {
mustEmbedUnimplementedAuthnServiceServer()
}
func RegisterAuthnServiceServer(s grpc.ServiceRegistrar, srv AuthnServiceServer) {
s.RegisterService(&AuthnService_ServiceDesc, srv)
}
func _AuthnService_GetCurrentUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCurrentUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthnServiceServer).GetCurrentUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthnService_GetCurrentUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthnServiceServer).GetCurrentUser(ctx, req.(*GetCurrentUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthnService_GetCurrentUserSubject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCurrentUserSubjectRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthnServiceServer).GetCurrentUserSubject(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthnService_GetCurrentUserSubject_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthnServiceServer).GetCurrentUserSubject(ctx, req.(*GetCurrentUserSubjectRequest))
}
return interceptor(ctx, in, info, handler)
}
// AuthnService_ServiceDesc is the grpc.ServiceDesc for AuthnService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthnService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "bufman.dubbo.apache.org.registry.v1alpha1.AuthnService",
HandlerType: (*AuthnServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetCurrentUser",
Handler: _AuthnService_GetCurrentUser_Handler,
},
{
MethodName: "GetCurrentUserSubject",
Handler: _AuthnService_GetCurrentUserSubject_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "registry/v1alpha1/authn.proto",
}