Documentation ¶
Index ¶
- Variables
- func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer)
- type Session
- func (*Session) Descriptor() ([]byte, []int)deprecated
- func (x *Session) GetExpires() int64
- func (x *Session) GetId() *UserId
- func (x *Session) GetToken() *Token
- func (*Session) ProtoMessage()
- func (x *Session) ProtoReflect() protoreflect.Message
- func (x *Session) Reset()
- func (x *Session) String() string
- type Token
- type UnimplementedUsersServer
- type UnsafeUsersServer
- type UserId
- type UserInfo
- type UserPII
- type UsersClient
- type UsersServer
Constants ¶
This section is empty.
Variables ¶
var File_users_users_proto protoreflect.FileDescriptor
var Users_ServiceDesc = grpc.ServiceDesc{ ServiceName: "users.Users", HandlerType: (*UsersServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Register", Handler: _Users_Register_Handler, }, { MethodName: "Authenticate", Handler: _Users_Authenticate_Handler, }, { MethodName: "Authorize", Handler: _Users_Authorize_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "users/users.proto", }
Users_ServiceDesc is the grpc.ServiceDesc for Users service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUsersServer ¶
func RegisterUsersServer(s grpc.ServiceRegistrar, srv UsersServer)
Types ¶
type Session ¶
type Session struct { // The user id reffered to in this session. Id *UserId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The token assigned to this session. Token *Token `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // The time the session will expire. Expires int64 `protobuf:"varint,4,opt,name=expires,proto3" json:"expires,omitempty"` // contains filtered or unexported fields }
Session represents the encoded authorization of a user that has successfully completed the authentication process.
func (*Session) Descriptor
deprecated
func (*Session) GetExpires ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) ProtoReflect ¶
func (x *Session) ProtoReflect() protoreflect.Message
type Token ¶
type Token struct { // THe string encoded value of the token. Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Token represents a randomly generated token that is provided to the user for them to provide to other services to authorize.
func (*Token) Descriptor
deprecated
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
type UnimplementedUsersServer ¶
type UnimplementedUsersServer struct { }
UnimplementedUsersServer must be embedded to have forward compatible implementations.
func (UnimplementedUsersServer) Authenticate ¶
type UnsafeUsersServer ¶
type UnsafeUsersServer interface {
// contains filtered or unexported methods
}
UnsafeUsersServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UsersServer will result in compilation errors.
type UserId ¶
type UserId struct { // The string encoded value of the user id. Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
UserId represents the identity of the user account.
func (*UserId) Descriptor
deprecated
func (*UserId) ProtoMessage ¶
func (*UserId) ProtoMessage()
func (*UserId) ProtoReflect ¶
func (x *UserId) ProtoReflect() protoreflect.Message
type UserInfo ¶
type UserInfo struct { // The id of the user. Id *UserId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The encoded role names assigned to the user. Roles []string `protobuf:"bytes,2,rep,name=roles,proto3" json:"roles,omitempty"` // contains filtered or unexported fields }
UserInfo stores data about the user that can be provided to other services.
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
type UserPII ¶
type UserPII struct { // The unique name of the user. Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // The raw password value. Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
UserPII represents the users personal identifying information. This includes their username, password, and email address.
func (*UserPII) Descriptor
deprecated
func (*UserPII) GetPassword ¶
func (*UserPII) GetUsername ¶
func (*UserPII) ProtoMessage ¶
func (*UserPII) ProtoMessage()
func (*UserPII) ProtoReflect ¶
func (x *UserPII) ProtoReflect() protoreflect.Message
type UsersClient ¶
type UsersClient interface { // Register allows a new user to register an account // by providing their personal identifying information. Register(ctx context.Context, in *UserPII, opts ...grpc.CallOption) (*UserId, error) // Authenticate allows an existing user to access services // by providing their personal identifying information. Authenticate(ctx context.Context, in *UserPII, opts ...grpc.CallOption) (*Session, error) // Authorize allows external services to access information // about an authenticated user by the token provided to the // user during the authentication process. Authorize(ctx context.Context, in *Token, opts ...grpc.CallOption) (*UserInfo, error) }
UsersClient is the client API for Users 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 NewUsersClient ¶
func NewUsersClient(cc grpc.ClientConnInterface) UsersClient
type UsersServer ¶
type UsersServer interface { // Register allows a new user to register an account // by providing their personal identifying information. Register(context.Context, *UserPII) (*UserId, error) // Authenticate allows an existing user to access services // by providing their personal identifying information. Authenticate(context.Context, *UserPII) (*Session, error) // Authorize allows external services to access information // about an authenticated user by the token provided to the // user during the authentication process. Authorize(context.Context, *Token) (*UserInfo, error) // contains filtered or unexported methods }
UsersServer is the server API for Users service. All implementations must embed UnimplementedUsersServer for forward compatibility