Documentation ¶
Overview ¶
Package auth is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAuthenticationHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error
- func RegisterAuthenticationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthenticationClient) error
- func RegisterAuthenticationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthenticationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthenticationServer) error
- func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer)
- type AuthenticationClient
- type AuthenticationServer
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- type LoginResponse
- type UnimplementedAuthenticationServer
- type UnsafeAuthenticationServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetEmail() string
- func (x *User) GetFullName() string
- func (x *User) GetPassword() string
- func (x *User) GetShadow() bool
- func (x *User) GetUsername() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
Constants ¶
This section is empty.
Variables ¶
var Authentication_ServiceDesc = grpc.ServiceDesc{ ServiceName: "clouditor.Authentication", HandlerType: (*AuthenticationServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _Authentication_Login_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth.proto", }
Authentication_ServiceDesc is the grpc.ServiceDesc for Authentication service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_auth_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthenticationHandler ¶ added in v1.3.1
func RegisterAuthenticationHandler(ctx context.Context, mux *runtime.ServeMux, conn grpc.ClientConnInterface) error
RegisterAuthenticationHandler registers the http handlers for service Authentication to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthenticationHandlerClient ¶ added in v1.3.1
func RegisterAuthenticationHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthenticationClient) error
RegisterAuthenticationHandlerClient registers the http handlers for service Authentication to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthenticationClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthenticationClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuthenticationClient" to call the correct interceptors.
func RegisterAuthenticationHandlerFromEndpoint ¶ added in v1.3.1
func RegisterAuthenticationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAuthenticationHandlerFromEndpoint is same as RegisterAuthenticationHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthenticationHandlerServer ¶ added in v1.3.1
func RegisterAuthenticationHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthenticationServer) error
RegisterAuthenticationHandlerServer registers the http handlers for service Authentication to "mux". UnaryRPC :call AuthenticationServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthenticationHandlerFromEndpoint instead.
func RegisterAuthenticationServer ¶
func RegisterAuthenticationServer(s grpc.ServiceRegistrar, srv AuthenticationServer)
Types ¶
type AuthenticationClient ¶
type AuthenticationClient interface {
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
}
AuthenticationClient is the client API for Authentication 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.
func NewAuthenticationClient ¶
func NewAuthenticationClient(cc grpc.ClientConnInterface) AuthenticationClient
type AuthenticationServer ¶
type AuthenticationServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) // contains filtered or unexported methods }
AuthenticationServer is the server API for Authentication service. All implementations must embed UnimplementedAuthenticationServer for forward compatibility
type LoginRequest ¶
type LoginRequest struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
type LoginResponse ¶
type LoginResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // contains filtered or unexported fields }
func (*LoginResponse) Descriptor
deprecated
func (*LoginResponse) Descriptor() ([]byte, []int)
Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.
func (*LoginResponse) GetToken ¶
func (x *LoginResponse) GetToken() string
func (*LoginResponse) ProtoMessage ¶
func (*LoginResponse) ProtoMessage()
func (*LoginResponse) ProtoReflect ¶
func (x *LoginResponse) ProtoReflect() protoreflect.Message
func (*LoginResponse) Reset ¶
func (x *LoginResponse) Reset()
func (*LoginResponse) String ¶
func (x *LoginResponse) String() string
type UnimplementedAuthenticationServer ¶
type UnimplementedAuthenticationServer struct { }
UnimplementedAuthenticationServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthenticationServer) Login ¶
func (UnimplementedAuthenticationServer) Login(context.Context, *LoginRequest) (*LoginResponse, error)
type UnsafeAuthenticationServer ¶
type UnsafeAuthenticationServer interface {
// contains filtered or unexported methods
}
UnsafeAuthenticationServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthenticationServer will result in compilation errors.
type User ¶
type User struct { Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` FullName string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` Shadow bool `protobuf:"varint,5,opt,name=shadow,proto3" json:"shadow,omitempty"` // contains filtered or unexported fields }
A clouditor user
func (*User) Descriptor
deprecated
func (*User) GetFullName ¶
func (*User) GetPassword ¶
func (*User) GetUsername ¶
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message