| // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| // versions: |
| // - protoc-gen-go-grpc v1.2.0 |
| // - protoc v3.21.7 |
| // source: go.chromium.org/luci/auth/loginsessionspb/service.proto |
| |
| package loginsessionspb |
| |
| 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.32.0 or later. |
| const _ = grpc.SupportPackageIsVersion7 |
| |
| // LoginSessionsClient is the client API for LoginSessions 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 LoginSessionsClient interface { |
| // CreateLoginSession creates a new login session in PENDING state. |
| // |
| // The returned message contains a new session with auto-generated random `id` |
| // and `password`. It's the only reply that has `password` populated. Both |
| // `id` and `password` are needed to get the up-to-date state of the session |
| // in GetLoginSession. |
| // |
| // Returns: |
| // INVALID_ARGUMENT: when missing required fields. |
| // PERMISSION_DENIED: when `oauth_client_id` is not recognized or some |
| // requested scopes are forbidden from use. |
| CreateLoginSession(ctx context.Context, in *CreateLoginSessionRequest, opts ...grpc.CallOption) (*LoginSession, error) |
| // GetLoginSession returns the current up-to-date state of a login session. |
| // |
| // The state changes based on interaction with the user in the browser (via |
| // a flow launched by visiting `login_flow_url`) and with passage of time. |
| // |
| // Returns: |
| // INVALID_ARGUMENT: when missing required fields. |
| // NOT_FOUND: if the session is not found, expired long time ago or the |
| // password doesn't match. |
| GetLoginSession(ctx context.Context, in *GetLoginSessionRequest, opts ...grpc.CallOption) (*LoginSession, error) |
| } |
| |
| type loginSessionsClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewLoginSessionsClient(cc grpc.ClientConnInterface) LoginSessionsClient { |
| return &loginSessionsClient{cc} |
| } |
| |
| func (c *loginSessionsClient) CreateLoginSession(ctx context.Context, in *CreateLoginSessionRequest, opts ...grpc.CallOption) (*LoginSession, error) { |
| out := new(LoginSession) |
| err := c.cc.Invoke(ctx, "/luci.auth.loginsessions.LoginSessions/CreateLoginSession", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *loginSessionsClient) GetLoginSession(ctx context.Context, in *GetLoginSessionRequest, opts ...grpc.CallOption) (*LoginSession, error) { |
| out := new(LoginSession) |
| err := c.cc.Invoke(ctx, "/luci.auth.loginsessions.LoginSessions/GetLoginSession", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| // LoginSessionsServer is the server API for LoginSessions service. |
| // All implementations must embed UnimplementedLoginSessionsServer |
| // for forward compatibility |
| type LoginSessionsServer interface { |
| // CreateLoginSession creates a new login session in PENDING state. |
| // |
| // The returned message contains a new session with auto-generated random `id` |
| // and `password`. It's the only reply that has `password` populated. Both |
| // `id` and `password` are needed to get the up-to-date state of the session |
| // in GetLoginSession. |
| // |
| // Returns: |
| // INVALID_ARGUMENT: when missing required fields. |
| // PERMISSION_DENIED: when `oauth_client_id` is not recognized or some |
| // requested scopes are forbidden from use. |
| CreateLoginSession(context.Context, *CreateLoginSessionRequest) (*LoginSession, error) |
| // GetLoginSession returns the current up-to-date state of a login session. |
| // |
| // The state changes based on interaction with the user in the browser (via |
| // a flow launched by visiting `login_flow_url`) and with passage of time. |
| // |
| // Returns: |
| // INVALID_ARGUMENT: when missing required fields. |
| // NOT_FOUND: if the session is not found, expired long time ago or the |
| // password doesn't match. |
| GetLoginSession(context.Context, *GetLoginSessionRequest) (*LoginSession, error) |
| mustEmbedUnimplementedLoginSessionsServer() |
| } |
| |
| // UnimplementedLoginSessionsServer must be embedded to have forward compatible implementations. |
| type UnimplementedLoginSessionsServer struct { |
| } |
| |
| func (UnimplementedLoginSessionsServer) CreateLoginSession(context.Context, *CreateLoginSessionRequest) (*LoginSession, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method CreateLoginSession not implemented") |
| } |
| func (UnimplementedLoginSessionsServer) GetLoginSession(context.Context, *GetLoginSessionRequest) (*LoginSession, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method GetLoginSession not implemented") |
| } |
| func (UnimplementedLoginSessionsServer) mustEmbedUnimplementedLoginSessionsServer() {} |
| |
| // UnsafeLoginSessionsServer may be embedded to opt out of forward compatibility for this service. |
| // Use of this interface is not recommended, as added methods to LoginSessionsServer will |
| // result in compilation errors. |
| type UnsafeLoginSessionsServer interface { |
| mustEmbedUnimplementedLoginSessionsServer() |
| } |
| |
| func RegisterLoginSessionsServer(s grpc.ServiceRegistrar, srv LoginSessionsServer) { |
| s.RegisterService(&LoginSessions_ServiceDesc, srv) |
| } |
| |
| func _LoginSessions_CreateLoginSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(CreateLoginSessionRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(LoginSessionsServer).CreateLoginSession(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/luci.auth.loginsessions.LoginSessions/CreateLoginSession", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(LoginSessionsServer).CreateLoginSession(ctx, req.(*CreateLoginSessionRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _LoginSessions_GetLoginSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(GetLoginSessionRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(LoginSessionsServer).GetLoginSession(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/luci.auth.loginsessions.LoginSessions/GetLoginSession", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(LoginSessionsServer).GetLoginSession(ctx, req.(*GetLoginSessionRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| // LoginSessions_ServiceDesc is the grpc.ServiceDesc for LoginSessions service. |
| // It's only intended for direct use with grpc.RegisterService, |
| // and not to be introspected or modified (even as a copy) |
| var LoginSessions_ServiceDesc = grpc.ServiceDesc{ |
| ServiceName: "luci.auth.loginsessions.LoginSessions", |
| HandlerType: (*LoginSessionsServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "CreateLoginSession", |
| Handler: _LoginSessions_CreateLoginSession_Handler, |
| }, |
| { |
| MethodName: "GetLoginSession", |
| Handler: _LoginSessions_GetLoginSession_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{}, |
| Metadata: "go.chromium.org/luci/auth/loginsessionspb/service.proto", |
| } |