Documentation
¶
Overview ¶
Package user provides application services for user management.
Index ¶
- type Service
- func (s *Service) CreateUser(ctx context.Context, apiUser *v1.User) (*v1.User, error)
- func (s *Service) DeleteUser(ctx context.Context, uid uuid.UUID) error
- func (s *Service) GetMyProfile(ctx context.Context, email string) (*v1.UserProfileResponse, error)
- func (s *Service) GetUser(ctx context.Context, uid uuid.UUID, options *model.GetOptions) (*v1.User, error)
- func (s *Service) GetUserByEmail(ctx context.Context, email string) (*v1.User, error)
- func (s *Service) ListUsers(ctx context.Context, options *model.ListOptions) (*v1.ListResponse[v1.User], error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a struct that implements the UserManageUsecase interface.
func New ¶
func New( userUsecase userport.UserUsecase, roleUsecase userport.RoleUsecase, roleBindingPersistencePort userport.RoleBindingPersistencePort, rbacEnforcerPort userport.RBACEnforcerPort, rbacUsecase userport.RBACUsecase, passwordHasher *security.PasswordHasher, logger *slog.Logger, ) *Service
New creates a new instance of the Service struct.
func (*Service) CreateUser ¶
CreateUser implements applicationport.UserManageUsecase. When a password is supplied, the user is provisioned for basic (username/password) login: the plaintext is hashed (peppered + salted) and only the hash is persisted, and a "basic" identity + login-type label is attached so RBAC default-role enrollment works.
func (*Service) DeleteUser ¶
DeleteUser implements applicationport.UserManageUsecase.
func (*Service) GetMyProfile ¶
GetMyProfile implements applicationport.UserManageUsecase. Returns the user's profile together with all roles and the binding that granted each role.
func (*Service) GetUser ¶
func (s *Service) GetUser(ctx context.Context, uid uuid.UUID, options *model.GetOptions) (*v1.User, error)
GetUser implements applicationport.UserManageUsecase.
func (*Service) GetUserByEmail ¶
GetUserByEmail implements applicationport.UserManageUsecase.
func (*Service) ListUsers ¶
func (s *Service) ListUsers( ctx context.Context, options *model.ListOptions, ) (*v1.ListResponse[v1.User], error)
ListUsers implements applicationport.UserManageUsecase.