354 lines
15 KiB
Go
354 lines
15 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.6.1
|
|
// - protoc v4.25.9
|
|
// source: sso/oauth.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 (
|
|
OauthService_GenerateOauthCode_FullMethodName = "/oauth.v1.OauthService/GenerateOauthCode"
|
|
OauthService_ExchangeOauthCode_FullMethodName = "/oauth.v1.OauthService/ExchangeOauthCode"
|
|
OauthService_CreateOauthClient_FullMethodName = "/oauth.v1.OauthService/CreateOauthClient"
|
|
OauthService_GetOauthClients_FullMethodName = "/oauth.v1.OauthService/GetOauthClients"
|
|
OauthService_UpdateOauthClient_FullMethodName = "/oauth.v1.OauthService/UpdateOauthClient"
|
|
OauthService_ResetOauthSecret_FullMethodName = "/oauth.v1.OauthService/ResetOauthSecret"
|
|
OauthService_DeleteOauthClient_FullMethodName = "/oauth.v1.OauthService/DeleteOauthClient"
|
|
)
|
|
|
|
// OauthServiceClient is the client API for OauthService 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 OauthServiceClient interface {
|
|
// === Базовый SSO (вызывается из Gateway / Графаны) ===
|
|
GenerateOauthCode(ctx context.Context, in *GenerateOauthCodeRequest, opts ...grpc.CallOption) (*GenerateOauthCodeResponse, error)
|
|
ExchangeOauthCode(ctx context.Context, in *ExchangeOauthCodeRequest, opts ...grpc.CallOption) (*ExchangeOauthCodeResponse, error)
|
|
// === Системные методы (Консоль Разработчика / Админка) ===
|
|
CreateOauthClient(ctx context.Context, in *CreateOauthClientRequest, opts ...grpc.CallOption) (*CreateOauthClientResponse, error)
|
|
GetOauthClients(ctx context.Context, in *GetOauthClientsRequest, opts ...grpc.CallOption) (*GetOauthClientsResponse, error)
|
|
UpdateOauthClient(ctx context.Context, in *UpdateOauthClientRequest, opts ...grpc.CallOption) (*UpdateOauthClientResponse, error)
|
|
ResetOauthSecret(ctx context.Context, in *ResetOauthSecretRequest, opts ...grpc.CallOption) (*ResetOauthSecretResponse, error)
|
|
DeleteOauthClient(ctx context.Context, in *DeleteOauthClientRequest, opts ...grpc.CallOption) (*DeleteOauthClientResponse, error)
|
|
}
|
|
|
|
type oauthServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewOauthServiceClient(cc grpc.ClientConnInterface) OauthServiceClient {
|
|
return &oauthServiceClient{cc}
|
|
}
|
|
|
|
func (c *oauthServiceClient) GenerateOauthCode(ctx context.Context, in *GenerateOauthCodeRequest, opts ...grpc.CallOption) (*GenerateOauthCodeResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GenerateOauthCodeResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_GenerateOauthCode_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) ExchangeOauthCode(ctx context.Context, in *ExchangeOauthCodeRequest, opts ...grpc.CallOption) (*ExchangeOauthCodeResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ExchangeOauthCodeResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_ExchangeOauthCode_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) CreateOauthClient(ctx context.Context, in *CreateOauthClientRequest, opts ...grpc.CallOption) (*CreateOauthClientResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CreateOauthClientResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_CreateOauthClient_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) GetOauthClients(ctx context.Context, in *GetOauthClientsRequest, opts ...grpc.CallOption) (*GetOauthClientsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(GetOauthClientsResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_GetOauthClients_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) UpdateOauthClient(ctx context.Context, in *UpdateOauthClientRequest, opts ...grpc.CallOption) (*UpdateOauthClientResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(UpdateOauthClientResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_UpdateOauthClient_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) ResetOauthSecret(ctx context.Context, in *ResetOauthSecretRequest, opts ...grpc.CallOption) (*ResetOauthSecretResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ResetOauthSecretResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_ResetOauthSecret_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) DeleteOauthClient(ctx context.Context, in *DeleteOauthClientRequest, opts ...grpc.CallOption) (*DeleteOauthClientResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(DeleteOauthClientResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_DeleteOauthClient_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// OauthServiceServer is the server API for OauthService service.
|
|
// All implementations must embed UnimplementedOauthServiceServer
|
|
// for forward compatibility.
|
|
type OauthServiceServer interface {
|
|
// === Базовый SSO (вызывается из Gateway / Графаны) ===
|
|
GenerateOauthCode(context.Context, *GenerateOauthCodeRequest) (*GenerateOauthCodeResponse, error)
|
|
ExchangeOauthCode(context.Context, *ExchangeOauthCodeRequest) (*ExchangeOauthCodeResponse, error)
|
|
// === Системные методы (Консоль Разработчика / Админка) ===
|
|
CreateOauthClient(context.Context, *CreateOauthClientRequest) (*CreateOauthClientResponse, error)
|
|
GetOauthClients(context.Context, *GetOauthClientsRequest) (*GetOauthClientsResponse, error)
|
|
UpdateOauthClient(context.Context, *UpdateOauthClientRequest) (*UpdateOauthClientResponse, error)
|
|
ResetOauthSecret(context.Context, *ResetOauthSecretRequest) (*ResetOauthSecretResponse, error)
|
|
DeleteOauthClient(context.Context, *DeleteOauthClientRequest) (*DeleteOauthClientResponse, error)
|
|
mustEmbedUnimplementedOauthServiceServer()
|
|
}
|
|
|
|
// UnimplementedOauthServiceServer must 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 UnimplementedOauthServiceServer struct{}
|
|
|
|
func (UnimplementedOauthServiceServer) GenerateOauthCode(context.Context, *GenerateOauthCodeRequest) (*GenerateOauthCodeResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GenerateOauthCode not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) ExchangeOauthCode(context.Context, *ExchangeOauthCodeRequest) (*ExchangeOauthCodeResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ExchangeOauthCode not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) CreateOauthClient(context.Context, *CreateOauthClientRequest) (*CreateOauthClientResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method CreateOauthClient not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) GetOauthClients(context.Context, *GetOauthClientsRequest) (*GetOauthClientsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method GetOauthClients not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) UpdateOauthClient(context.Context, *UpdateOauthClientRequest) (*UpdateOauthClientResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method UpdateOauthClient not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) ResetOauthSecret(context.Context, *ResetOauthSecretRequest) (*ResetOauthSecretResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method ResetOauthSecret not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) DeleteOauthClient(context.Context, *DeleteOauthClientRequest) (*DeleteOauthClientResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method DeleteOauthClient not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) mustEmbedUnimplementedOauthServiceServer() {}
|
|
func (UnimplementedOauthServiceServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeOauthServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to OauthServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeOauthServiceServer interface {
|
|
mustEmbedUnimplementedOauthServiceServer()
|
|
}
|
|
|
|
func RegisterOauthServiceServer(s grpc.ServiceRegistrar, srv OauthServiceServer) {
|
|
// If the following call panics, it indicates UnimplementedOauthServiceServer 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(&OauthService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _OauthService_GenerateOauthCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GenerateOauthCodeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).GenerateOauthCode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_GenerateOauthCode_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).GenerateOauthCode(ctx, req.(*GenerateOauthCodeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_ExchangeOauthCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ExchangeOauthCodeRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).ExchangeOauthCode(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_ExchangeOauthCode_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).ExchangeOauthCode(ctx, req.(*ExchangeOauthCodeRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_CreateOauthClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateOauthClientRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).CreateOauthClient(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_CreateOauthClient_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).CreateOauthClient(ctx, req.(*CreateOauthClientRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_GetOauthClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetOauthClientsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).GetOauthClients(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_GetOauthClients_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).GetOauthClients(ctx, req.(*GetOauthClientsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_UpdateOauthClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateOauthClientRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).UpdateOauthClient(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_UpdateOauthClient_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).UpdateOauthClient(ctx, req.(*UpdateOauthClientRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_ResetOauthSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ResetOauthSecretRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).ResetOauthSecret(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_ResetOauthSecret_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).ResetOauthSecret(ctx, req.(*ResetOauthSecretRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_DeleteOauthClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteOauthClientRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).DeleteOauthClient(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_DeleteOauthClient_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).DeleteOauthClient(ctx, req.(*DeleteOauthClientRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// OauthService_ServiceDesc is the grpc.ServiceDesc for OauthService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var OauthService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "oauth.v1.OauthService",
|
|
HandlerType: (*OauthServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "GenerateOauthCode",
|
|
Handler: _OauthService_GenerateOauthCode_Handler,
|
|
},
|
|
{
|
|
MethodName: "ExchangeOauthCode",
|
|
Handler: _OauthService_ExchangeOauthCode_Handler,
|
|
},
|
|
{
|
|
MethodName: "CreateOauthClient",
|
|
Handler: _OauthService_CreateOauthClient_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetOauthClients",
|
|
Handler: _OauthService_GetOauthClients_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateOauthClient",
|
|
Handler: _OauthService_UpdateOauthClient_Handler,
|
|
},
|
|
{
|
|
MethodName: "ResetOauthSecret",
|
|
Handler: _OauthService_ResetOauthSecret_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteOauthClient",
|
|
Handler: _OauthService_DeleteOauthClient_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sso/oauth.proto",
|
|
}
|