From ef7cf1e5c81d8c9ee88b2921cc5cdc5b86d081bc Mon Sep 17 00:00:00 2001 From: devops-bot Date: Mon, 27 Apr 2026 16:36:06 +0000 Subject: [PATCH] Update protobuf definitions: 63296224 By allanger Commit link: https://gitea.badhouseplants.net/softplayer/softplayer-proto/commit/63296224668fee1720b8bb810a40637fda0d8fed Pipeline link: https://ci.badhouseplants.net/repos/34/pipeline/44 --- pkg/accounts/v1/accounts_v1.pb.go | 38 ++-- pkg/accounts/v1/accounts_v1_grpc.pb.go | 276 ++++++++++++++++++------- 2 files changed, 221 insertions(+), 93 deletions(-) diff --git a/pkg/accounts/v1/accounts_v1.pb.go b/pkg/accounts/v1/accounts_v1.pb.go index de4c457..022be23 100644 --- a/pkg/accounts/v1/accounts_v1.pb.go +++ b/pkg/accounts/v1/accounts_v1.pb.go @@ -1,4 +1,4 @@ -/// This file has messages for describing environments +/// Protobuf definitions for the accounts service. // Code generated by protoc-gen-go. DO NOT EDIT. // versions: @@ -441,12 +441,14 @@ const file_accounts_v1_accounts_v1_proto_rawDesc = "" + "\x16IsEmailVerifiedRequest\x12,\n" + "\x04data\x18\x01 \x01(\v2\x18.accounts.v1.AccountDataR\x04data\"5\n" + "\x17IsEmailVerifiedResponse\x12\x1a\n" + - "\bverified\x18\x01 \x01(\bR\bverified2\x89\x03\n" + - "\x0fAccountsService\x12>\n" + + "\bverified\x18\x01 \x01(\bR\bverified2\xf1\x02\n" + + "\x15AccountsNoAuthService\x12>\n" + "\x06SignUp\x12\x1a.accounts.v1.SignUpRequest\x1a\x16.google.protobuf.Empty\"\x00\x12>\n" + "\x06SignIn\x12\x1a.accounts.v1.SignInRequest\x1a\x16.google.protobuf.Empty\"\x00\x12L\n" + "\rResetPassword\x12!.accounts.v1.ResetPasswordRequest\x1a\x16.google.protobuf.Empty\"\x00\x12H\n" + - "\vNewPassword\x12\x1f.accounts.v1.NewPasswordRequest\x1a\x16.google.protobuf.Empty\"\x00\x12^\n" + + "\vNewPassword\x12\x1f.accounts.v1.NewPasswordRequest\x1a\x16.google.protobuf.Empty\"\x00\x12@\n" + + "\fRefreshToken\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x002t\n" + + "\x12AccountAuthService\x12^\n" + "\x0fIsEmailVerified\x12#.accounts.v1.IsEmailVerifiedRequest\x1a$.accounts.v1.IsEmailVerifiedResponse\"\x00BIZGgitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts/v1b\x06proto3" var ( @@ -482,18 +484,20 @@ var file_accounts_v1_accounts_v1_proto_depIdxs = []int32{ 1, // 5: accounts.v1.NewPasswordRequest.data:type_name -> accounts.v1.AccountData 0, // 6: accounts.v1.NewPasswordRequest.password:type_name -> accounts.v1.AccountPassword 1, // 7: accounts.v1.IsEmailVerifiedRequest.data:type_name -> accounts.v1.AccountData - 2, // 8: accounts.v1.AccountsService.SignUp:input_type -> accounts.v1.SignUpRequest - 3, // 9: accounts.v1.AccountsService.SignIn:input_type -> accounts.v1.SignInRequest - 4, // 10: accounts.v1.AccountsService.ResetPassword:input_type -> accounts.v1.ResetPasswordRequest - 5, // 11: accounts.v1.AccountsService.NewPassword:input_type -> accounts.v1.NewPasswordRequest - 6, // 12: accounts.v1.AccountsService.IsEmailVerified:input_type -> accounts.v1.IsEmailVerifiedRequest - 8, // 13: accounts.v1.AccountsService.SignUp:output_type -> google.protobuf.Empty - 8, // 14: accounts.v1.AccountsService.SignIn:output_type -> google.protobuf.Empty - 8, // 15: accounts.v1.AccountsService.ResetPassword:output_type -> google.protobuf.Empty - 8, // 16: accounts.v1.AccountsService.NewPassword:output_type -> google.protobuf.Empty - 7, // 17: accounts.v1.AccountsService.IsEmailVerified:output_type -> accounts.v1.IsEmailVerifiedResponse - 13, // [13:18] is the sub-list for method output_type - 8, // [8:13] is the sub-list for method input_type + 2, // 8: accounts.v1.AccountsNoAuthService.SignUp:input_type -> accounts.v1.SignUpRequest + 3, // 9: accounts.v1.AccountsNoAuthService.SignIn:input_type -> accounts.v1.SignInRequest + 4, // 10: accounts.v1.AccountsNoAuthService.ResetPassword:input_type -> accounts.v1.ResetPasswordRequest + 5, // 11: accounts.v1.AccountsNoAuthService.NewPassword:input_type -> accounts.v1.NewPasswordRequest + 8, // 12: accounts.v1.AccountsNoAuthService.RefreshToken:input_type -> google.protobuf.Empty + 6, // 13: accounts.v1.AccountAuthService.IsEmailVerified:input_type -> accounts.v1.IsEmailVerifiedRequest + 8, // 14: accounts.v1.AccountsNoAuthService.SignUp:output_type -> google.protobuf.Empty + 8, // 15: accounts.v1.AccountsNoAuthService.SignIn:output_type -> google.protobuf.Empty + 8, // 16: accounts.v1.AccountsNoAuthService.ResetPassword:output_type -> google.protobuf.Empty + 8, // 17: accounts.v1.AccountsNoAuthService.NewPassword:output_type -> google.protobuf.Empty + 8, // 18: accounts.v1.AccountsNoAuthService.RefreshToken:output_type -> google.protobuf.Empty + 7, // 19: accounts.v1.AccountAuthService.IsEmailVerified:output_type -> accounts.v1.IsEmailVerifiedResponse + 14, // [14:20] is the sub-list for method output_type + 8, // [8:14] is the sub-list for method input_type 8, // [8:8] is the sub-list for extension type_name 8, // [8:8] is the sub-list for extension extendee 0, // [0:8] is the sub-list for field type_name @@ -512,7 +516,7 @@ func file_accounts_v1_accounts_v1_proto_init() { NumEnums: 0, NumMessages: 8, NumExtensions: 0, - NumServices: 1, + NumServices: 2, }, GoTypes: file_accounts_v1_accounts_v1_proto_goTypes, DependencyIndexes: file_accounts_v1_accounts_v1_proto_depIdxs, diff --git a/pkg/accounts/v1/accounts_v1_grpc.pb.go b/pkg/accounts/v1/accounts_v1_grpc.pb.go index ca098c9..6c84952 100644 --- a/pkg/accounts/v1/accounts_v1_grpc.pb.go +++ b/pkg/accounts/v1/accounts_v1_grpc.pb.go @@ -1,4 +1,4 @@ -/// This file has messages for describing environments +/// Protobuf definitions for the accounts service. // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: @@ -22,257 +22,381 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - AccountsService_SignUp_FullMethodName = "/accounts.v1.AccountsService/SignUp" - AccountsService_SignIn_FullMethodName = "/accounts.v1.AccountsService/SignIn" - AccountsService_ResetPassword_FullMethodName = "/accounts.v1.AccountsService/ResetPassword" - AccountsService_NewPassword_FullMethodName = "/accounts.v1.AccountsService/NewPassword" - AccountsService_IsEmailVerified_FullMethodName = "/accounts.v1.AccountsService/IsEmailVerified" + AccountsNoAuthService_SignUp_FullMethodName = "/accounts.v1.AccountsNoAuthService/SignUp" + AccountsNoAuthService_SignIn_FullMethodName = "/accounts.v1.AccountsNoAuthService/SignIn" + AccountsNoAuthService_ResetPassword_FullMethodName = "/accounts.v1.AccountsNoAuthService/ResetPassword" + AccountsNoAuthService_NewPassword_FullMethodName = "/accounts.v1.AccountsNoAuthService/NewPassword" + AccountsNoAuthService_RefreshToken_FullMethodName = "/accounts.v1.AccountsNoAuthService/RefreshToken" ) -// AccountsServiceClient is the client API for AccountsService service. +// AccountsNoAuthServiceClient is the client API for AccountsNoAuthService 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. // // * -// Service for handling environments -type AccountsServiceClient interface { +// Service for handling accounts that do not require authentication +type AccountsNoAuthServiceClient interface { + // Create a new user SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Sing in into an existing account SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Reset the password, if it was lost ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Set the new password after reset NewPassword(ctx context.Context, in *NewPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error) + // Send the refresh token request, token should be passed in the metadata. + // This rpc does requier auth, but it should be handled not on the middleware level, + // that's why it set in the NoAuth service + RefreshToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) } -type accountsServiceClient struct { +type accountsNoAuthServiceClient struct { cc grpc.ClientConnInterface } -func NewAccountsServiceClient(cc grpc.ClientConnInterface) AccountsServiceClient { - return &accountsServiceClient{cc} +func NewAccountsNoAuthServiceClient(cc grpc.ClientConnInterface) AccountsNoAuthServiceClient { + return &accountsNoAuthServiceClient{cc} } -func (c *accountsServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *accountsNoAuthServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, AccountsService_SignUp_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, AccountsNoAuthService_SignUp_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *accountsServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *accountsNoAuthServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, AccountsService_SignIn_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, AccountsNoAuthService_SignIn_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *accountsServiceClient) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *accountsNoAuthServiceClient) ResetPassword(ctx context.Context, in *ResetPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, AccountsService_ResetPassword_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, AccountsNoAuthService_ResetPassword_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *accountsServiceClient) NewPassword(ctx context.Context, in *NewPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { +func (c *accountsNoAuthServiceClient) NewPassword(ctx context.Context, in *NewPasswordRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, AccountsService_NewPassword_FullMethodName, in, out, cOpts...) + err := c.cc.Invoke(ctx, AccountsNoAuthService_NewPassword_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *accountsServiceClient) IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error) { +func (c *accountsNoAuthServiceClient) RefreshToken(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(IsEmailVerifiedResponse) - err := c.cc.Invoke(ctx, AccountsService_IsEmailVerified_FullMethodName, in, out, cOpts...) + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, AccountsNoAuthService_RefreshToken_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -// AccountsServiceServer is the server API for AccountsService service. -// All implementations should embed UnimplementedAccountsServiceServer +// AccountsNoAuthServiceServer is the server API for AccountsNoAuthService service. +// All implementations should embed UnimplementedAccountsNoAuthServiceServer // for forward compatibility. // // * -// Service for handling environments -type AccountsServiceServer interface { +// Service for handling accounts that do not require authentication +type AccountsNoAuthServiceServer interface { + // Create a new user SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error) + // Sing in into an existing account SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error) + // Reset the password, if it was lost ResetPassword(context.Context, *ResetPasswordRequest) (*emptypb.Empty, error) + // Set the new password after reset NewPassword(context.Context, *NewPasswordRequest) (*emptypb.Empty, error) - IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error) + // Send the refresh token request, token should be passed in the metadata. + // This rpc does requier auth, but it should be handled not on the middleware level, + // that's why it set in the NoAuth service + RefreshToken(context.Context, *emptypb.Empty) (*emptypb.Empty, error) } -// UnimplementedAccountsServiceServer should be embedded to have +// UnimplementedAccountsNoAuthServiceServer 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 UnimplementedAccountsServiceServer struct{} +type UnimplementedAccountsNoAuthServiceServer struct{} -func (UnimplementedAccountsServiceServer) SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error) { +func (UnimplementedAccountsNoAuthServiceServer) SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error) { return nil, status.Error(codes.Unimplemented, "method SignUp not implemented") } -func (UnimplementedAccountsServiceServer) SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error) { +func (UnimplementedAccountsNoAuthServiceServer) SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error) { return nil, status.Error(codes.Unimplemented, "method SignIn not implemented") } -func (UnimplementedAccountsServiceServer) ResetPassword(context.Context, *ResetPasswordRequest) (*emptypb.Empty, error) { +func (UnimplementedAccountsNoAuthServiceServer) ResetPassword(context.Context, *ResetPasswordRequest) (*emptypb.Empty, error) { return nil, status.Error(codes.Unimplemented, "method ResetPassword not implemented") } -func (UnimplementedAccountsServiceServer) NewPassword(context.Context, *NewPasswordRequest) (*emptypb.Empty, error) { +func (UnimplementedAccountsNoAuthServiceServer) NewPassword(context.Context, *NewPasswordRequest) (*emptypb.Empty, error) { return nil, status.Error(codes.Unimplemented, "method NewPassword not implemented") } -func (UnimplementedAccountsServiceServer) IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error) { - return nil, status.Error(codes.Unimplemented, "method IsEmailVerified not implemented") +func (UnimplementedAccountsNoAuthServiceServer) RefreshToken(context.Context, *emptypb.Empty) (*emptypb.Empty, error) { + return nil, status.Error(codes.Unimplemented, "method RefreshToken not implemented") } -func (UnimplementedAccountsServiceServer) testEmbeddedByValue() {} +func (UnimplementedAccountsNoAuthServiceServer) testEmbeddedByValue() {} -// UnsafeAccountsServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AccountsServiceServer will +// UnsafeAccountsNoAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountsNoAuthServiceServer will // result in compilation errors. -type UnsafeAccountsServiceServer interface { - mustEmbedUnimplementedAccountsServiceServer() +type UnsafeAccountsNoAuthServiceServer interface { + mustEmbedUnimplementedAccountsNoAuthServiceServer() } -func RegisterAccountsServiceServer(s grpc.ServiceRegistrar, srv AccountsServiceServer) { - // If the following call panics, it indicates UnimplementedAccountsServiceServer was +func RegisterAccountsNoAuthServiceServer(s grpc.ServiceRegistrar, srv AccountsNoAuthServiceServer) { + // If the following call panics, it indicates UnimplementedAccountsNoAuthServiceServer 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(&AccountsService_ServiceDesc, srv) + s.RegisterService(&AccountsNoAuthService_ServiceDesc, srv) } -func _AccountsService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _AccountsNoAuthService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignUpRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AccountsServiceServer).SignUp(ctx, in) + return srv.(AccountsNoAuthServiceServer).SignUp(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AccountsService_SignUp_FullMethodName, + FullMethod: AccountsNoAuthService_SignUp_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServiceServer).SignUp(ctx, req.(*SignUpRequest)) + return srv.(AccountsNoAuthServiceServer).SignUp(ctx, req.(*SignUpRequest)) } return interceptor(ctx, in, info, handler) } -func _AccountsService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _AccountsNoAuthService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SignInRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AccountsServiceServer).SignIn(ctx, in) + return srv.(AccountsNoAuthServiceServer).SignIn(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AccountsService_SignIn_FullMethodName, + FullMethod: AccountsNoAuthService_SignIn_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServiceServer).SignIn(ctx, req.(*SignInRequest)) + return srv.(AccountsNoAuthServiceServer).SignIn(ctx, req.(*SignInRequest)) } return interceptor(ctx, in, info, handler) } -func _AccountsService_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _AccountsNoAuthService_ResetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ResetPasswordRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AccountsServiceServer).ResetPassword(ctx, in) + return srv.(AccountsNoAuthServiceServer).ResetPassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AccountsService_ResetPassword_FullMethodName, + FullMethod: AccountsNoAuthService_ResetPassword_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServiceServer).ResetPassword(ctx, req.(*ResetPasswordRequest)) + return srv.(AccountsNoAuthServiceServer).ResetPassword(ctx, req.(*ResetPasswordRequest)) } return interceptor(ctx, in, info, handler) } -func _AccountsService_NewPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _AccountsNoAuthService_NewPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(NewPasswordRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AccountsServiceServer).NewPassword(ctx, in) + return srv.(AccountsNoAuthServiceServer).NewPassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AccountsService_NewPassword_FullMethodName, + FullMethod: AccountsNoAuthService_NewPassword_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServiceServer).NewPassword(ctx, req.(*NewPasswordRequest)) + return srv.(AccountsNoAuthServiceServer).NewPassword(ctx, req.(*NewPasswordRequest)) } return interceptor(ctx, in, info, handler) } -func _AccountsService_IsEmailVerified_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IsEmailVerifiedRequest) +func _AccountsNoAuthService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AccountsServiceServer).IsEmailVerified(ctx, in) + return srv.(AccountsNoAuthServiceServer).RefreshToken(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: AccountsService_IsEmailVerified_FullMethodName, + FullMethod: AccountsNoAuthService_RefreshToken_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountsServiceServer).IsEmailVerified(ctx, req.(*IsEmailVerifiedRequest)) + return srv.(AccountsNoAuthServiceServer).RefreshToken(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } -// AccountsService_ServiceDesc is the grpc.ServiceDesc for AccountsService service. +// AccountsNoAuthService_ServiceDesc is the grpc.ServiceDesc for AccountsNoAuthService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var AccountsService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "accounts.v1.AccountsService", - HandlerType: (*AccountsServiceServer)(nil), +var AccountsNoAuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "accounts.v1.AccountsNoAuthService", + HandlerType: (*AccountsNoAuthServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "SignUp", - Handler: _AccountsService_SignUp_Handler, + Handler: _AccountsNoAuthService_SignUp_Handler, }, { MethodName: "SignIn", - Handler: _AccountsService_SignIn_Handler, + Handler: _AccountsNoAuthService_SignIn_Handler, }, { MethodName: "ResetPassword", - Handler: _AccountsService_ResetPassword_Handler, + Handler: _AccountsNoAuthService_ResetPassword_Handler, }, { MethodName: "NewPassword", - Handler: _AccountsService_NewPassword_Handler, + Handler: _AccountsNoAuthService_NewPassword_Handler, }, { - MethodName: "IsEmailVerified", - Handler: _AccountsService_IsEmailVerified_Handler, + MethodName: "RefreshToken", + Handler: _AccountsNoAuthService_RefreshToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "accounts/v1/accounts_v1.proto", +} + +const ( + AccountAuthService_IsEmailVerified_FullMethodName = "/accounts.v1.AccountAuthService/IsEmailVerified" +) + +// AccountAuthServiceClient is the client API for AccountAuthService 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. +// +// * +// Service for handling accounts that do require authentication +// Tokens should be sent via metadata, so the service is able to authenticate a user for a request +type AccountAuthServiceClient interface { + // Is email for the current account verified + IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error) +} + +type accountAuthServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewAccountAuthServiceClient(cc grpc.ClientConnInterface) AccountAuthServiceClient { + return &accountAuthServiceClient{cc} +} + +func (c *accountAuthServiceClient) IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(IsEmailVerifiedResponse) + err := c.cc.Invoke(ctx, AccountAuthService_IsEmailVerified_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AccountAuthServiceServer is the server API for AccountAuthService service. +// All implementations should embed UnimplementedAccountAuthServiceServer +// for forward compatibility. +// +// * +// Service for handling accounts that do require authentication +// Tokens should be sent via metadata, so the service is able to authenticate a user for a request +type AccountAuthServiceServer interface { + // Is email for the current account verified + IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error) +} + +// UnimplementedAccountAuthServiceServer 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 UnimplementedAccountAuthServiceServer struct{} + +func (UnimplementedAccountAuthServiceServer) IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error) { + return nil, status.Error(codes.Unimplemented, "method IsEmailVerified not implemented") +} +func (UnimplementedAccountAuthServiceServer) testEmbeddedByValue() {} + +// UnsafeAccountAuthServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AccountAuthServiceServer will +// result in compilation errors. +type UnsafeAccountAuthServiceServer interface { + mustEmbedUnimplementedAccountAuthServiceServer() +} + +func RegisterAccountAuthServiceServer(s grpc.ServiceRegistrar, srv AccountAuthServiceServer) { + // If the following call panics, it indicates UnimplementedAccountAuthServiceServer 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(&AccountAuthService_ServiceDesc, srv) +} + +func _AccountAuthService_IsEmailVerified_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IsEmailVerifiedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountAuthServiceServer).IsEmailVerified(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AccountAuthService_IsEmailVerified_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountAuthServiceServer).IsEmailVerified(ctx, req.(*IsEmailVerifiedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AccountAuthService_ServiceDesc is the grpc.ServiceDesc for AccountAuthService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AccountAuthService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "accounts.v1.AccountAuthService", + HandlerType: (*AccountAuthServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "IsEmailVerified", + Handler: _AccountAuthService_IsEmailVerified_Handler, }, }, Streams: []grpc.StreamDesc{},