354 lines
16 KiB
Go
354 lines
16 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_SystemCreateOauthClient_FullMethodName = "/oauth.v1.OauthService/SystemCreateOauthClient"
|
|
OauthService_SystemGetOauthClients_FullMethodName = "/oauth.v1.OauthService/SystemGetOauthClients"
|
|
OauthService_SystemUpdateOauthClient_FullMethodName = "/oauth.v1.OauthService/SystemUpdateOauthClient"
|
|
OauthService_SystemResetOauthSecret_FullMethodName = "/oauth.v1.OauthService/SystemResetOauthSecret"
|
|
OauthService_SystemDeleteOauthClient_FullMethodName = "/oauth.v1.OauthService/SystemDeleteOauthClient"
|
|
)
|
|
|
|
// 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)
|
|
// === Системные методы для Админки (Управление клиентами) ===
|
|
SystemCreateOauthClient(ctx context.Context, in *SystemCreateOauthClientRequest, opts ...grpc.CallOption) (*SystemCreateOauthClientResponse, error)
|
|
SystemGetOauthClients(ctx context.Context, in *SystemGetOauthClientsRequest, opts ...grpc.CallOption) (*SystemGetOauthClientsResponse, error)
|
|
SystemUpdateOauthClient(ctx context.Context, in *SystemUpdateOauthClientRequest, opts ...grpc.CallOption) (*SystemUpdateOauthClientResponse, error)
|
|
SystemResetOauthSecret(ctx context.Context, in *SystemResetOauthSecretRequest, opts ...grpc.CallOption) (*SystemResetOauthSecretResponse, error)
|
|
SystemDeleteOauthClient(ctx context.Context, in *SystemDeleteOauthClientRequest, opts ...grpc.CallOption) (*SystemDeleteOauthClientResponse, 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) SystemCreateOauthClient(ctx context.Context, in *SystemCreateOauthClientRequest, opts ...grpc.CallOption) (*SystemCreateOauthClientResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SystemCreateOauthClientResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_SystemCreateOauthClient_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) SystemGetOauthClients(ctx context.Context, in *SystemGetOauthClientsRequest, opts ...grpc.CallOption) (*SystemGetOauthClientsResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SystemGetOauthClientsResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_SystemGetOauthClients_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) SystemUpdateOauthClient(ctx context.Context, in *SystemUpdateOauthClientRequest, opts ...grpc.CallOption) (*SystemUpdateOauthClientResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SystemUpdateOauthClientResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_SystemUpdateOauthClient_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) SystemResetOauthSecret(ctx context.Context, in *SystemResetOauthSecretRequest, opts ...grpc.CallOption) (*SystemResetOauthSecretResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SystemResetOauthSecretResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_SystemResetOauthSecret_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *oauthServiceClient) SystemDeleteOauthClient(ctx context.Context, in *SystemDeleteOauthClientRequest, opts ...grpc.CallOption) (*SystemDeleteOauthClientResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(SystemDeleteOauthClientResponse)
|
|
err := c.cc.Invoke(ctx, OauthService_SystemDeleteOauthClient_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)
|
|
// === Системные методы для Админки (Управление клиентами) ===
|
|
SystemCreateOauthClient(context.Context, *SystemCreateOauthClientRequest) (*SystemCreateOauthClientResponse, error)
|
|
SystemGetOauthClients(context.Context, *SystemGetOauthClientsRequest) (*SystemGetOauthClientsResponse, error)
|
|
SystemUpdateOauthClient(context.Context, *SystemUpdateOauthClientRequest) (*SystemUpdateOauthClientResponse, error)
|
|
SystemResetOauthSecret(context.Context, *SystemResetOauthSecretRequest) (*SystemResetOauthSecretResponse, error)
|
|
SystemDeleteOauthClient(context.Context, *SystemDeleteOauthClientRequest) (*SystemDeleteOauthClientResponse, 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) SystemCreateOauthClient(context.Context, *SystemCreateOauthClientRequest) (*SystemCreateOauthClientResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SystemCreateOauthClient not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) SystemGetOauthClients(context.Context, *SystemGetOauthClientsRequest) (*SystemGetOauthClientsResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SystemGetOauthClients not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) SystemUpdateOauthClient(context.Context, *SystemUpdateOauthClientRequest) (*SystemUpdateOauthClientResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SystemUpdateOauthClient not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) SystemResetOauthSecret(context.Context, *SystemResetOauthSecretRequest) (*SystemResetOauthSecretResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SystemResetOauthSecret not implemented")
|
|
}
|
|
func (UnimplementedOauthServiceServer) SystemDeleteOauthClient(context.Context, *SystemDeleteOauthClientRequest) (*SystemDeleteOauthClientResponse, error) {
|
|
return nil, status.Error(codes.Unimplemented, "method SystemDeleteOauthClient 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_SystemCreateOauthClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SystemCreateOauthClientRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).SystemCreateOauthClient(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_SystemCreateOauthClient_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).SystemCreateOauthClient(ctx, req.(*SystemCreateOauthClientRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_SystemGetOauthClients_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SystemGetOauthClientsRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).SystemGetOauthClients(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_SystemGetOauthClients_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).SystemGetOauthClients(ctx, req.(*SystemGetOauthClientsRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_SystemUpdateOauthClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SystemUpdateOauthClientRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).SystemUpdateOauthClient(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_SystemUpdateOauthClient_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).SystemUpdateOauthClient(ctx, req.(*SystemUpdateOauthClientRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_SystemResetOauthSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SystemResetOauthSecretRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).SystemResetOauthSecret(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_SystemResetOauthSecret_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).SystemResetOauthSecret(ctx, req.(*SystemResetOauthSecretRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _OauthService_SystemDeleteOauthClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SystemDeleteOauthClientRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(OauthServiceServer).SystemDeleteOauthClient(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: OauthService_SystemDeleteOauthClient_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(OauthServiceServer).SystemDeleteOauthClient(ctx, req.(*SystemDeleteOauthClientRequest))
|
|
}
|
|
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: "SystemCreateOauthClient",
|
|
Handler: _OauthService_SystemCreateOauthClient_Handler,
|
|
},
|
|
{
|
|
MethodName: "SystemGetOauthClients",
|
|
Handler: _OauthService_SystemGetOauthClients_Handler,
|
|
},
|
|
{
|
|
MethodName: "SystemUpdateOauthClient",
|
|
Handler: _OauthService_SystemUpdateOauthClient_Handler,
|
|
},
|
|
{
|
|
MethodName: "SystemResetOauthSecret",
|
|
Handler: _OauthService_SystemResetOauthSecret_Handler,
|
|
},
|
|
{
|
|
MethodName: "SystemDeleteOauthClient",
|
|
Handler: _OauthService_SystemDeleteOauthClient_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "sso/oauth.proto",
|
|
}
|