local_user

package
v0.0.0-...-f4fdb20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 21 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_interservice_local_user_users_proto protoreflect.FileDescriptor

Functions

func RegisterUsersMgmtServiceServer

func RegisterUsersMgmtServiceServer(s *grpc.Server, srv UsersMgmtServiceServer)

Types

type CreateUserReq

type CreateUserReq struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" toml:"id,omitempty" mapstructure:"id,omitempty"`
	// forbid empty strings
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"`
	// Note: we're explicitly more strict than email (RFC 1034), although PGV
	// knows how to validate an email address using
	//
	//	[(validate.rules).string.email = true];
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty" toml:"email,omitempty" mapstructure:"email,omitempty"`
	// Note: password validation happens in the service's handler
	Password string `` /* 129-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CreateUserReq) Descriptor deprecated

func (*CreateUserReq) Descriptor() ([]byte, []int)

Deprecated: Use CreateUserReq.ProtoReflect.Descriptor instead.

func (*CreateUserReq) GetEmail

func (x *CreateUserReq) GetEmail() string

func (*CreateUserReq) GetId

func (x *CreateUserReq) GetId() string

func (*CreateUserReq) GetName

func (x *CreateUserReq) GetName() string

func (*CreateUserReq) GetPassword

func (x *CreateUserReq) GetPassword() string

func (*CreateUserReq) ProtoMessage

func (*CreateUserReq) ProtoMessage()

func (*CreateUserReq) ProtoReflect

func (x *CreateUserReq) ProtoReflect() protoreflect.Message

func (*CreateUserReq) Reset

func (x *CreateUserReq) Reset()

func (*CreateUserReq) String

func (x *CreateUserReq) String() string

func (*CreateUserReq) Validate

func (m *CreateUserReq) Validate() error

Validate checks the field values on CreateUserReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type CreateUserReqValidationError

type CreateUserReqValidationError struct {
	// contains filtered or unexported fields
}

CreateUserReqValidationError is the validation error returned by CreateUserReq.Validate if the designated constraints aren't met.

func (CreateUserReqValidationError) Cause

Cause function returns cause value.

func (CreateUserReqValidationError) Error

Error satisfies the builtin error interface

func (CreateUserReqValidationError) ErrorName

func (e CreateUserReqValidationError) ErrorName() string

ErrorName returns error name.

func (CreateUserReqValidationError) Field

Field function returns field value.

func (CreateUserReqValidationError) Key

Key function returns key value.

func (CreateUserReqValidationError) Reason

Reason function returns reason value.

type DeleteUserResp

type DeleteUserResp struct {
	// contains filtered or unexported fields
}

func (*DeleteUserResp) Descriptor deprecated

func (*DeleteUserResp) Descriptor() ([]byte, []int)

Deprecated: Use DeleteUserResp.ProtoReflect.Descriptor instead.

func (*DeleteUserResp) ProtoMessage

func (*DeleteUserResp) ProtoMessage()

func (*DeleteUserResp) ProtoReflect

func (x *DeleteUserResp) ProtoReflect() protoreflect.Message

func (*DeleteUserResp) Reset

func (x *DeleteUserResp) Reset()

func (*DeleteUserResp) String

func (x *DeleteUserResp) String() string

func (*DeleteUserResp) Validate

func (m *DeleteUserResp) Validate() error

Validate checks the field values on DeleteUserResp with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type DeleteUserRespValidationError

type DeleteUserRespValidationError struct {
	// contains filtered or unexported fields
}

DeleteUserRespValidationError is the validation error returned by DeleteUserResp.Validate if the designated constraints aren't met.

func (DeleteUserRespValidationError) Cause

Cause function returns cause value.

func (DeleteUserRespValidationError) Error

Error satisfies the builtin error interface

func (DeleteUserRespValidationError) ErrorName

func (e DeleteUserRespValidationError) ErrorName() string

ErrorName returns error name.

func (DeleteUserRespValidationError) Field

Field function returns field value.

func (DeleteUserRespValidationError) Key

Key function returns key value.

func (DeleteUserRespValidationError) Reason

Reason function returns reason value.

type Email

type Email struct {
	Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty" toml:"email,omitempty" mapstructure:"email,omitempty"` // forbid empty strings;
	// contains filtered or unexported fields
}

func (*Email) Descriptor deprecated

func (*Email) Descriptor() ([]byte, []int)

Deprecated: Use Email.ProtoReflect.Descriptor instead.

func (*Email) GetEmail

func (x *Email) GetEmail() string

func (*Email) ProtoMessage

func (*Email) ProtoMessage()

func (*Email) ProtoReflect

func (x *Email) ProtoReflect() protoreflect.Message

func (*Email) Reset

func (x *Email) Reset()

func (*Email) String

func (x *Email) String() string

func (*Email) Validate

func (m *Email) Validate() error

Validate checks the field values on Email with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type EmailValidationError

type EmailValidationError struct {
	// contains filtered or unexported fields
}

EmailValidationError is the validation error returned by Email.Validate if the designated constraints aren't met.

func (EmailValidationError) Cause

func (e EmailValidationError) Cause() error

Cause function returns cause value.

func (EmailValidationError) Error

func (e EmailValidationError) Error() string

Error satisfies the builtin error interface

func (EmailValidationError) ErrorName

func (e EmailValidationError) ErrorName() string

ErrorName returns error name.

func (EmailValidationError) Field

func (e EmailValidationError) Field() string

Field function returns field value.

func (EmailValidationError) Key

func (e EmailValidationError) Key() bool

Key function returns key value.

func (EmailValidationError) Reason

func (e EmailValidationError) Reason() string

Reason function returns reason value.

type GetUsersReq

type GetUsersReq struct {
	// contains filtered or unexported fields
}

func (*GetUsersReq) Descriptor deprecated

func (*GetUsersReq) Descriptor() ([]byte, []int)

Deprecated: Use GetUsersReq.ProtoReflect.Descriptor instead.

func (*GetUsersReq) ProtoMessage

func (*GetUsersReq) ProtoMessage()

func (*GetUsersReq) ProtoReflect

func (x *GetUsersReq) ProtoReflect() protoreflect.Message

func (*GetUsersReq) Reset

func (x *GetUsersReq) Reset()

func (*GetUsersReq) String

func (x *GetUsersReq) String() string

func (*GetUsersReq) Validate

func (m *GetUsersReq) Validate() error

Validate checks the field values on GetUsersReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type GetUsersReqValidationError

type GetUsersReqValidationError struct {
	// contains filtered or unexported fields
}

GetUsersReqValidationError is the validation error returned by GetUsersReq.Validate if the designated constraints aren't met.

func (GetUsersReqValidationError) Cause

Cause function returns cause value.

func (GetUsersReqValidationError) Error

Error satisfies the builtin error interface

func (GetUsersReqValidationError) ErrorName

func (e GetUsersReqValidationError) ErrorName() string

ErrorName returns error name.

func (GetUsersReqValidationError) Field

Field function returns field value.

func (GetUsersReqValidationError) Key

Key function returns key value.

func (GetUsersReqValidationError) Reason

Reason function returns reason value.

type UnimplementedUsersMgmtServiceServer

type UnimplementedUsersMgmtServiceServer struct {
}

UnimplementedUsersMgmtServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedUsersMgmtServiceServer) CreateUser

func (*UnimplementedUsersMgmtServiceServer) DeleteUser

func (*UnimplementedUsersMgmtServiceServer) GetUser

func (*UnimplementedUsersMgmtServiceServer) GetUsers

func (*UnimplementedUsersMgmtServiceServer) UpdateSelf

func (*UnimplementedUsersMgmtServiceServer) UpdateUser

type UpdateSelfReq

type UpdateSelfReq struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" toml:"id,omitempty" mapstructure:"id,omitempty"`
	Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty" toml:"email,omitempty" mapstructure:"email,omitempty"`
	Name  string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"`
	// Note: for UpdateSelfReq, the password and previous_password are optional,
	// but if passed, they must both be passed.
	Password         string `` /* 129-byte string literal not displayed */
	PreviousPassword string `` /* 187-byte string literal not displayed */
	// contains filtered or unexported fields
}

See UpdateUserReq for other relevant comments.

func (*UpdateSelfReq) Descriptor deprecated

func (*UpdateSelfReq) Descriptor() ([]byte, []int)

Deprecated: Use UpdateSelfReq.ProtoReflect.Descriptor instead.

func (*UpdateSelfReq) GetEmail

func (x *UpdateSelfReq) GetEmail() string

func (*UpdateSelfReq) GetId

func (x *UpdateSelfReq) GetId() string

func (*UpdateSelfReq) GetName

func (x *UpdateSelfReq) GetName() string

func (*UpdateSelfReq) GetPassword

func (x *UpdateSelfReq) GetPassword() string

func (*UpdateSelfReq) GetPreviousPassword

func (x *UpdateSelfReq) GetPreviousPassword() string

func (*UpdateSelfReq) ProtoMessage

func (*UpdateSelfReq) ProtoMessage()

func (*UpdateSelfReq) ProtoReflect

func (x *UpdateSelfReq) ProtoReflect() protoreflect.Message

func (*UpdateSelfReq) Reset

func (x *UpdateSelfReq) Reset()

func (*UpdateSelfReq) String

func (x *UpdateSelfReq) String() string

func (*UpdateSelfReq) Validate

func (m *UpdateSelfReq) Validate() error

Validate checks the field values on UpdateSelfReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UpdateSelfReqValidationError

type UpdateSelfReqValidationError struct {
	// contains filtered or unexported fields
}

UpdateSelfReqValidationError is the validation error returned by UpdateSelfReq.Validate if the designated constraints aren't met.

func (UpdateSelfReqValidationError) Cause

Cause function returns cause value.

func (UpdateSelfReqValidationError) Error

Error satisfies the builtin error interface

func (UpdateSelfReqValidationError) ErrorName

func (e UpdateSelfReqValidationError) ErrorName() string

ErrorName returns error name.

func (UpdateSelfReqValidationError) Field

Field function returns field value.

func (UpdateSelfReqValidationError) Key

Key function returns key value.

func (UpdateSelfReqValidationError) Reason

Reason function returns reason value.

type UpdateUserReq

type UpdateUserReq struct {

	// TODO (tc) Unfortunately ID is not returned by Dex in UpdatePassword.
	// We currently have ID being returned as part of our update contract
	// for the gateway API. The only way we are currently populating that
	// is by passing back to the user exactly what they gave us in the update request.
	// This isn't ideal, but we have a few options that aren't ideal either:
	//
	// 1. Call ListPasswords on every update, find our user, and populate the ID field,
	// then deprecate the ID field as in input into our update APIs.
	//
	// 2.  Break our public API (not an option afaik).
	//
	// 3. Wait until my GetPassword API merges into Dex and call that on every
	// update to get the ID, then deprecate the ID field as in input into our update APIs.
	// This is probably the best option.
	// https://github.com/dexidp/dex/pull/1271
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" toml:"id,omitempty" mapstructure:"id,omitempty"`
	// Currently, this validation doesn't make much sense, since user's can't change their
	// email (aka username) via update, but leaving it in since 1) it doesn't hurt and
	// 2) keep it consistent if we allow it in the future.
	Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty" toml:"email,omitempty" mapstructure:"email,omitempty"`
	Name  string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"`
	// Note: for UpdateUserReq, the password is optional
	Password string `` /* 129-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*UpdateUserReq) Descriptor deprecated

func (*UpdateUserReq) Descriptor() ([]byte, []int)

Deprecated: Use UpdateUserReq.ProtoReflect.Descriptor instead.

func (*UpdateUserReq) GetEmail

func (x *UpdateUserReq) GetEmail() string

func (*UpdateUserReq) GetId

func (x *UpdateUserReq) GetId() string

func (*UpdateUserReq) GetName

func (x *UpdateUserReq) GetName() string

func (*UpdateUserReq) GetPassword

func (x *UpdateUserReq) GetPassword() string

func (*UpdateUserReq) ProtoMessage

func (*UpdateUserReq) ProtoMessage()

func (*UpdateUserReq) ProtoReflect

func (x *UpdateUserReq) ProtoReflect() protoreflect.Message

func (*UpdateUserReq) Reset

func (x *UpdateUserReq) Reset()

func (*UpdateUserReq) String

func (x *UpdateUserReq) String() string

func (*UpdateUserReq) Validate

func (m *UpdateUserReq) Validate() error

Validate checks the field values on UpdateUserReq with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UpdateUserReqValidationError

type UpdateUserReqValidationError struct {
	// contains filtered or unexported fields
}

UpdateUserReqValidationError is the validation error returned by UpdateUserReq.Validate if the designated constraints aren't met.

func (UpdateUserReqValidationError) Cause

Cause function returns cause value.

func (UpdateUserReqValidationError) Error

Error satisfies the builtin error interface

func (UpdateUserReqValidationError) ErrorName

func (e UpdateUserReqValidationError) ErrorName() string

ErrorName returns error name.

func (UpdateUserReqValidationError) Field

Field function returns field value.

func (UpdateUserReqValidationError) Key

Key function returns key value.

func (UpdateUserReqValidationError) Reason

Reason function returns reason value.

type User

type User struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" toml:"id,omitempty" mapstructure:"id,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty" toml:"name,omitempty" mapstructure:"name,omitempty"`
	Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty" toml:"email,omitempty" mapstructure:"email,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

func (*User) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) Validate

func (m *User) Validate() error

Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UserValidationError

type UserValidationError struct {
	// contains filtered or unexported fields
}

UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.

func (UserValidationError) Cause

func (e UserValidationError) Cause() error

Cause function returns cause value.

func (UserValidationError) Error

func (e UserValidationError) Error() string

Error satisfies the builtin error interface

func (UserValidationError) ErrorName

func (e UserValidationError) ErrorName() string

ErrorName returns error name.

func (UserValidationError) Field

func (e UserValidationError) Field() string

Field function returns field value.

func (UserValidationError) Key

func (e UserValidationError) Key() bool

Key function returns key value.

func (UserValidationError) Reason

func (e UserValidationError) Reason() string

Reason function returns reason value.

type Users

type Users struct {
	Users map[string]*User `` /* 205-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Users) Descriptor deprecated

func (*Users) Descriptor() ([]byte, []int)

Deprecated: Use Users.ProtoReflect.Descriptor instead.

func (*Users) GetUsers

func (x *Users) GetUsers() map[string]*User

func (*Users) ProtoMessage

func (*Users) ProtoMessage()

func (*Users) ProtoReflect

func (x *Users) ProtoReflect() protoreflect.Message

func (*Users) Reset

func (x *Users) Reset()

func (*Users) String

func (x *Users) String() string

func (*Users) Validate

func (m *Users) Validate() error

Validate checks the field values on Users with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type UsersMgmtServiceClient

type UsersMgmtServiceClient interface {
	GetUsers(ctx context.Context, in *GetUsersReq, opts ...grpc.CallOption) (*Users, error)
	GetUser(ctx context.Context, in *Email, opts ...grpc.CallOption) (*User, error)
	CreateUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*User, error)
	DeleteUser(ctx context.Context, in *Email, opts ...grpc.CallOption) (*DeleteUserResp, error)
	UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*User, error)
	UpdateSelf(ctx context.Context, in *UpdateSelfReq, opts ...grpc.CallOption) (*User, error)
}

UsersMgmtServiceClient is the client API for UsersMgmtService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type UsersMgmtServiceServer

type UsersMgmtServiceServer interface {
	GetUsers(context.Context, *GetUsersReq) (*Users, error)
	GetUser(context.Context, *Email) (*User, error)
	CreateUser(context.Context, *CreateUserReq) (*User, error)
	DeleteUser(context.Context, *Email) (*DeleteUserResp, error)
	UpdateUser(context.Context, *UpdateUserReq) (*User, error)
	UpdateSelf(context.Context, *UpdateSelfReq) (*User, error)
}

UsersMgmtServiceServer is the server API for UsersMgmtService service.

type UsersMgmtServiceServerMock

type UsersMgmtServiceServerMock struct {
	GetUsersFunc   func(context.Context, *GetUsersReq) (*Users, error)
	GetUserFunc    func(context.Context, *Email) (*User, error)
	CreateUserFunc func(context.Context, *CreateUserReq) (*User, error)
	DeleteUserFunc func(context.Context, *Email) (*DeleteUserResp, error)
	UpdateUserFunc func(context.Context, *UpdateUserReq) (*User, error)
	UpdateSelfFunc func(context.Context, *UpdateSelfReq) (*User, error)
	// contains filtered or unexported fields
}

UsersMgmtServiceServerMock is the mock-what-you-want struct that stubs all not-overridden methods with "not implemented" returns

func NewUsersMgmtServiceServerMock

func NewUsersMgmtServiceServerMock() *UsersMgmtServiceServerMock

NewUsersMgmtServiceServerMock gives you a fresh instance of UsersMgmtServiceServerMock.

func NewUsersMgmtServiceServerMockWithoutValidation

func NewUsersMgmtServiceServerMockWithoutValidation() *UsersMgmtServiceServerMock

NewUsersMgmtServiceServerMockWithoutValidation gives you a fresh instance of UsersMgmtServiceServerMock which does not attempt to validate requests before passing them to their respective '*Func'.

func (*UsersMgmtServiceServerMock) CreateUser

func (m *UsersMgmtServiceServerMock) CreateUser(ctx context.Context, req *CreateUserReq) (*User, error)

func (*UsersMgmtServiceServerMock) DeleteUser

func (m *UsersMgmtServiceServerMock) DeleteUser(ctx context.Context, req *Email) (*DeleteUserResp, error)

func (*UsersMgmtServiceServerMock) GetUser

func (m *UsersMgmtServiceServerMock) GetUser(ctx context.Context, req *Email) (*User, error)

func (*UsersMgmtServiceServerMock) GetUsers

func (m *UsersMgmtServiceServerMock) GetUsers(ctx context.Context, req *GetUsersReq) (*Users, error)

func (*UsersMgmtServiceServerMock) Reset

func (m *UsersMgmtServiceServerMock) Reset()

Reset resets all overridden functions

func (*UsersMgmtServiceServerMock) UpdateSelf

func (m *UsersMgmtServiceServerMock) UpdateSelf(ctx context.Context, req *UpdateSelfReq) (*User, error)

func (*UsersMgmtServiceServerMock) UpdateUser

func (m *UsersMgmtServiceServerMock) UpdateUser(ctx context.Context, req *UpdateUserReq) (*User, error)

type UsersValidationError

type UsersValidationError struct {
	// contains filtered or unexported fields
}

UsersValidationError is the validation error returned by Users.Validate if the designated constraints aren't met.

func (UsersValidationError) Cause

func (e UsersValidationError) Cause() error

Cause function returns cause value.

func (UsersValidationError) Error

func (e UsersValidationError) Error() string

Error satisfies the builtin error interface

func (UsersValidationError) ErrorName

func (e UsersValidationError) ErrorName() string

ErrorName returns error name.

func (UsersValidationError) Field

func (e UsersValidationError) Field() string

Field function returns field value.

func (UsersValidationError) Key

func (e UsersValidationError) Key() bool

Key function returns key value.

func (UsersValidationError) Reason

func (e UsersValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL