Documentation ¶
Index ¶
- Variables
- func FindUserByUsernameAndValidatePwd(ctx context.Context, um *biz.UserManager, username, password string) (*biz.User, error)
- func MapBizRoleToApi(u *biz.Role, b *pb.Role)
- func MapBizUserToApi(ctx context.Context, u *biz.User, b blob.Factory) *pb.User
- func NewHydra(c *kconf.Security) *client.APIClient
- type AccountService
- func (s *AccountService) CreateAddresses(ctx context.Context, req *pb.CreateAddressesRequest) (*pb.CreateAddressReply, error)
- func (s *AccountService) DeleteAddresses(ctx context.Context, req *pb.DeleteAddressRequest) (*pb.DeleteAddressesReply, error)
- func (s *AccountService) GetAddresses(ctx context.Context, req *pb.GetAddressesRequest) (*pb.GetAddressesReply, error)
- func (s *AccountService) GetProfile(ctx context.Context, req *pb.GetProfileRequest) (*pb.GetProfileResponse, error)
- func (s *AccountService) GetSettings(ctx context.Context, req *pb.GetSettingsRequest) (*pb.GetSettingsResponse, error)
- func (s *AccountService) UpdateAddresses(ctx context.Context, req *pb.UpdateAddressesRequest) (*pb.UpdateAddressesReply, error)
- func (s *AccountService) UpdateAvatar(ctx http.Context) error
- func (s *AccountService) UpdateProfile(ctx context.Context, req *pb.UpdateProfileRequest) (*pb.UpdateProfileResponse, error)
- func (s *AccountService) UpdateSettings(ctx context.Context, req *pb.UpdateSettingsRequest) (*pb.UpdateSettingsResponse, error)
- type AuthService
- func (s *AuthService) ChangePasswordByForget(ctx context.Context, req *pb.ChangePasswordByForgetRequest) (*pb.ChangePasswordByForgetReply, error)
- func (s *AuthService) ChangePasswordByPre(ctx context.Context, req *pb.ChangePasswordByPreRequest) (*pb.ChangePasswordByPreReply, error)
- func (s *AuthService) ForgetPassword(ctx context.Context, req *pb.ForgetPasswordRequest) (*pb.ForgetPasswordReply, error)
- func (s *AuthService) GetCsrfToken(ctx context.Context, req *pb.GetCsrfTokenRequest) (*pb.GetCsrfTokenResponse, error)
- func (s *AuthService) Login(ctx context.Context, req *pb.LoginAuthRequest) (*pb.LoginAuthReply, error)
- func (s *AuthService) LoginPasswordless(ctx context.Context, req *pb.LoginPasswordlessRequest) (*pb.LoginPasswordlessReply, error)
- func (s *AuthService) Refresh(ctx context.Context, req *pb.RefreshTokenAuthRequest) (*pb.RefreshTokenAuthReply, error)
- func (s *AuthService) RefreshRememberToken(ctx context.Context, req *pb.RefreshRememberTokenRequest) (*pb.RefreshRememberTokenReply, error)
- func (s *AuthService) Register(ctx context.Context, req *pb.RegisterAuthRequest) (*pb.RegisterAuthReply, error)
- func (s *AuthService) SendForgetPasswordToken(ctx context.Context, req *pb.ForgetPasswordTokenRequest) (*pb.ForgetPasswordTokenReply, error)
- func (s *AuthService) SendPasswordlessToken(ctx context.Context, req *pb.PasswordlessTokenAuthRequest) (*pb.PasswordlessTokenAuthReply, error)
- func (s *AuthService) Token(ctx context.Context, req *pb.TokenRequest) (*pb.TokenReply, error)
- func (s *AuthService) ValidatePassword(ctx context.Context, req *pb.ValidatePasswordRequest) (*pb.ValidatePasswordReply, error)
- type GrpcServerRegister
- type HttpServerRegister
- type PermissionService
- func (s *PermissionService) AddSubjectPermission(ctx context.Context, req *pb.AddSubjectPermissionRequest) (*pb.AddSubjectPermissionResponse, error)
- func (s *PermissionService) CheckCurrent(ctx context.Context, req *pb.CheckPermissionRequest) (*pb.CheckPermissionReply, error)
- func (s *PermissionService) CheckForSubjects(ctx context.Context, req *pb.CheckSubjectsPermissionRequest) (*pb.CheckSubjectsPermissionReply, error)
- func (s *PermissionService) GetCurrent(ctx context.Context, req *pb.GetCurrentPermissionRequest) (*pb.GetCurrentPermissionReply, error)
- func (s *PermissionService) ListSubjectPermission(ctx context.Context, req *pb.ListSubjectPermissionRequest) (*pb.ListSubjectPermissionResponse, error)
- func (s *PermissionService) RemoveSubjectPermission(ctx context.Context, req *pb.RemoveSubjectPermissionRequest) (*pb.RemoveSubjectPermissionReply, error)
- func (s *PermissionService) UpdateSubjectPermission(ctx context.Context, req *pb.UpdateSubjectPermissionRequest) (*pb.UpdateSubjectPermissionResponse, error)
- type RoleService
- func (s *RoleService) CreateRole(ctx context.Context, req *pb.CreateRoleRequest) (*pb.Role, error)
- func (s *RoleService) DeleteRole(ctx context.Context, req *pb.DeleteRoleRequest) (*pb.DeleteRoleResponse, error)
- func (s *RoleService) GetRole(ctx context.Context, req *pb.GetRoleRequest) (*pb.Role, error)
- func (s *RoleService) GetRolePermission(ctx context.Context, req *pb.GetRolePermissionRequest) (*pb.GetRolePermissionResponse, error)
- func (s *RoleService) ListRoles(ctx context.Context, req *pb.ListRolesRequest) (*pb.ListRolesResponse, error)
- func (s *RoleService) UpdateRole(ctx context.Context, req *pb.UpdateRoleRequest) (*pb.Role, error)
- func (s *RoleService) UpdateRolePermission(ctx context.Context, req *pb.UpdateRolePermissionRequest) (*pb.UpdateRolePermissionResponse, error)
- type UserRoleContrib
- type UserService
- func (s *UserService) CheckUserTenant(ctx context.Context, req *pb.CheckUserTenantRequest) (*pb.CheckUserTenantReply, error)
- func (s *UserService) CheckUserTenantInternal(ctx context.Context, userId, tenantId string) (bool, error)
- func (s *UserService) CreateUser(ctx context.Context, req *pb.CreateUserRequest) (*pb.User, error)
- func (s *UserService) DeleteUser(ctx context.Context, req *pb.DeleteUserRequest) (*pb.DeleteUserResponse, error)
- func (s *UserService) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.User, error)
- func (s *UserService) GetUserRoles(ctx context.Context, req *pb.GetUserRoleRequest) (*pb.GetUserRoleReply, error)
- func (s *UserService) InviteUser(ctx context.Context, req *pb.InviteUserRequest) (*pb.InviteUserReply, error)
- func (s *UserService) ListUsers(ctx context.Context, req *pb.ListUsersRequest) (*pb.ListUsersResponse, error)
- func (s *UserService) UpdateAvatar(ctx http.Context) error
- func (s *UserService) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.User, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet( NewGrpcServerRegister, NewHttpServerRegister, NewUserRoleContrib, NewUserService, wire.Bind(new(v12.UserServiceServer), new(*UserService)), NewAccountService, wire.Bind(new(v13.AccountServer), new(*AccountService)), NewAuthService, wire.Bind(new(v14.AuthServer), new(*AuthService)), NewRoleServiceService, wire.Bind(new(v1.RoleServiceServer), new(*RoleService)), NewPermissionService, wire.Bind(new(v15.PermissionServiceServer), new(*PermissionService)), NewHydra, api.NewUserTenantContrib, api.NewRefreshProvider, uhttp.NewAuth)
ProviderSet is service providers.
Functions ¶
func MapBizUserToApi ¶
Types ¶
type AccountService ¶
type AccountService struct { pb.UnimplementedAccountServer // contains filtered or unexported fields }
func NewAccountService ¶
func NewAccountService(um *biz.UserManager, blob blob.Factory, tenantService v13.TenantServiceServer, userSetting biz.UserSettingRepo, userAddr biz.UserAddressRepo, normalizer biz.LookupNormalizer) *AccountService
func (*AccountService) CreateAddresses ¶
func (s *AccountService) CreateAddresses(ctx context.Context, req *pb.CreateAddressesRequest) (*pb.CreateAddressReply, error)
func (*AccountService) DeleteAddresses ¶
func (s *AccountService) DeleteAddresses(ctx context.Context, req *pb.DeleteAddressRequest) (*pb.DeleteAddressesReply, error)
func (*AccountService) GetAddresses ¶
func (s *AccountService) GetAddresses(ctx context.Context, req *pb.GetAddressesRequest) (*pb.GetAddressesReply, error)
func (*AccountService) GetProfile ¶
func (s *AccountService) GetProfile(ctx context.Context, req *pb.GetProfileRequest) (*pb.GetProfileResponse, error)
func (*AccountService) GetSettings ¶
func (s *AccountService) GetSettings(ctx context.Context, req *pb.GetSettingsRequest) (*pb.GetSettingsResponse, error)
func (*AccountService) UpdateAddresses ¶
func (s *AccountService) UpdateAddresses(ctx context.Context, req *pb.UpdateAddressesRequest) (*pb.UpdateAddressesReply, error)
func (*AccountService) UpdateAvatar ¶
func (s *AccountService) UpdateAvatar(ctx http.Context) error
func (*AccountService) UpdateProfile ¶
func (s *AccountService) UpdateProfile(ctx context.Context, req *pb.UpdateProfileRequest) (*pb.UpdateProfileResponse, error)
func (*AccountService) UpdateSettings ¶
func (s *AccountService) UpdateSettings(ctx context.Context, req *pb.UpdateSettingsRequest) (*pb.UpdateSettingsResponse, error)
type AuthService ¶
type AuthService struct { pb.UnimplementedAuthServer // contains filtered or unexported fields }
func NewAuthService ¶
func NewAuthService(um *biz.UserManager, rm *biz.RoleManager, token jwt.Tokenizer, config *jwt.TokenizerConfig, pwdValidator biz.PasswordValidator, refreshTokenRepo biz.RefreshTokenRepo, emailer biz.EmailSender, security *conf.Security, authz authz.Service, trust api2.TrustedContextValidator, logger klog.Logger) *AuthService
func (*AuthService) ChangePasswordByForget ¶
func (s *AuthService) ChangePasswordByForget(ctx context.Context, req *pb.ChangePasswordByForgetRequest) (*pb.ChangePasswordByForgetReply, error)
func (*AuthService) ChangePasswordByPre ¶
func (s *AuthService) ChangePasswordByPre(ctx context.Context, req *pb.ChangePasswordByPreRequest) (*pb.ChangePasswordByPreReply, error)
func (*AuthService) ForgetPassword ¶
func (s *AuthService) ForgetPassword(ctx context.Context, req *pb.ForgetPasswordRequest) (*pb.ForgetPasswordReply, error)
func (*AuthService) GetCsrfToken ¶
func (s *AuthService) GetCsrfToken(ctx context.Context, req *pb.GetCsrfTokenRequest) (*pb.GetCsrfTokenResponse, error)
func (*AuthService) Login ¶
func (s *AuthService) Login(ctx context.Context, req *pb.LoginAuthRequest) (*pb.LoginAuthReply, error)
func (*AuthService) LoginPasswordless ¶
func (s *AuthService) LoginPasswordless(ctx context.Context, req *pb.LoginPasswordlessRequest) (*pb.LoginPasswordlessReply, error)
func (*AuthService) Refresh ¶
func (s *AuthService) Refresh(ctx context.Context, req *pb.RefreshTokenAuthRequest) (*pb.RefreshTokenAuthReply, error)
func (*AuthService) RefreshRememberToken ¶
func (s *AuthService) RefreshRememberToken(ctx context.Context, req *pb.RefreshRememberTokenRequest) (*pb.RefreshRememberTokenReply, error)
func (*AuthService) Register ¶
func (s *AuthService) Register(ctx context.Context, req *pb.RegisterAuthRequest) (*pb.RegisterAuthReply, error)
func (*AuthService) SendForgetPasswordToken ¶
func (s *AuthService) SendForgetPasswordToken(ctx context.Context, req *pb.ForgetPasswordTokenRequest) (*pb.ForgetPasswordTokenReply, error)
func (*AuthService) SendPasswordlessToken ¶
func (s *AuthService) SendPasswordlessToken(ctx context.Context, req *pb.PasswordlessTokenAuthRequest) (*pb.PasswordlessTokenAuthReply, error)
func (*AuthService) Token ¶
func (s *AuthService) Token(ctx context.Context, req *pb.TokenRequest) (*pb.TokenReply, error)
func (*AuthService) ValidatePassword ¶
func (s *AuthService) ValidatePassword(ctx context.Context, req *pb.ValidatePasswordRequest) (*pb.ValidatePasswordReply, error)
type GrpcServerRegister ¶
type GrpcServerRegister server.GrpcServiceRegister
func NewGrpcServerRegister ¶
func NewGrpcServerRegister(user *UserService, account *AccountService, auth *AuthService, role *RoleService, permission *PermissionService) GrpcServerRegister
type HttpServerRegister ¶
type HttpServerRegister server.HttpServiceRegister
func NewHttpServerRegister ¶
func NewHttpServerRegister(user *UserService, resEncoder khttp.EncodeResponseFunc, errEncoder khttp.EncodeErrorFunc, account *AccountService, auth *AuthService, role *RoleService, permission *PermissionService, authHttp *uhttp.Auth, dataCfg *kconf.Data, authzSrv authz.Service, factory blob.Factory) HttpServerRegister
type PermissionService ¶
type PermissionService struct { pb.UnimplementedPermissionServiceServer // contains filtered or unexported fields }
func NewPermissionService ¶
func NewPermissionService(auth authz.Service, permissionMgr authz.PermissionManagementService, sr authz.SubjectResolver, trust api2.TrustedContextValidator) *PermissionService
func (*PermissionService) AddSubjectPermission ¶
func (s *PermissionService) AddSubjectPermission(ctx context.Context, req *pb.AddSubjectPermissionRequest) (*pb.AddSubjectPermissionResponse, error)
func (*PermissionService) CheckCurrent ¶
func (s *PermissionService) CheckCurrent(ctx context.Context, req *pb.CheckPermissionRequest) (*pb.CheckPermissionReply, error)
func (*PermissionService) CheckForSubjects ¶
func (s *PermissionService) CheckForSubjects(ctx context.Context, req *pb.CheckSubjectsPermissionRequest) (*pb.CheckSubjectsPermissionReply, error)
CheckForSubjects internal api for remote permission checker
func (*PermissionService) GetCurrent ¶
func (s *PermissionService) GetCurrent(ctx context.Context, req *pb.GetCurrentPermissionRequest) (*pb.GetCurrentPermissionReply, error)
func (*PermissionService) ListSubjectPermission ¶
func (s *PermissionService) ListSubjectPermission(ctx context.Context, req *pb.ListSubjectPermissionRequest) (*pb.ListSubjectPermissionResponse, error)
func (*PermissionService) RemoveSubjectPermission ¶
func (s *PermissionService) RemoveSubjectPermission(ctx context.Context, req *pb.RemoveSubjectPermissionRequest) (*pb.RemoveSubjectPermissionReply, error)
func (*PermissionService) UpdateSubjectPermission ¶
func (s *PermissionService) UpdateSubjectPermission(ctx context.Context, req *pb.UpdateSubjectPermissionRequest) (*pb.UpdateSubjectPermissionResponse, error)
type RoleService ¶
type RoleService struct { pb.UnimplementedRoleServiceServer // contains filtered or unexported fields }
func NewRoleServiceService ¶
func NewRoleServiceService(repo *biz.RoleManager, auth authz.Service, permissionMgr authz.PermissionManagementService) *RoleService
func (*RoleService) CreateRole ¶
func (s *RoleService) CreateRole(ctx context.Context, req *pb.CreateRoleRequest) (*pb.Role, error)
func (*RoleService) DeleteRole ¶
func (s *RoleService) DeleteRole(ctx context.Context, req *pb.DeleteRoleRequest) (*pb.DeleteRoleResponse, error)
func (*RoleService) GetRole ¶
func (s *RoleService) GetRole(ctx context.Context, req *pb.GetRoleRequest) (*pb.Role, error)
func (*RoleService) GetRolePermission ¶
func (s *RoleService) GetRolePermission(ctx context.Context, req *pb.GetRolePermissionRequest) (*pb.GetRolePermissionResponse, error)
func (*RoleService) ListRoles ¶
func (s *RoleService) ListRoles(ctx context.Context, req *pb.ListRolesRequest) (*pb.ListRolesResponse, error)
func (*RoleService) UpdateRole ¶
func (s *RoleService) UpdateRole(ctx context.Context, req *pb.UpdateRoleRequest) (*pb.Role, error)
func (*RoleService) UpdateRolePermission ¶
func (s *RoleService) UpdateRolePermission(ctx context.Context, req *pb.UpdateRolePermissionRequest) (*pb.UpdateRolePermissionResponse, error)
type UserRoleContrib ¶
type UserRoleContrib struct {
// contains filtered or unexported fields
}
func NewUserRoleContrib ¶
func NewUserRoleContrib(userRepo biz.UserRepo) *UserRoleContrib
type UserService ¶
type UserService struct { pb.UnimplementedUserServiceServer // contains filtered or unexported fields }
func NewUserService ¶
func NewUserService(um *biz.UserManager, rm *biz.RoleManager, auth authz.Service, blob blob.Factory, trust api2.TrustedContextValidator, l klog.Logger) *UserService
func (*UserService) CheckUserTenant ¶
func (s *UserService) CheckUserTenant(ctx context.Context, req *pb.CheckUserTenantRequest) (*pb.CheckUserTenantReply, error)
CheckUserTenant internal api for check user tenant
func (*UserService) CheckUserTenantInternal ¶
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(ctx context.Context, req *pb.CreateUserRequest) (*pb.User, error)
func (*UserService) DeleteUser ¶
func (s *UserService) DeleteUser(ctx context.Context, req *pb.DeleteUserRequest) (*pb.DeleteUserResponse, error)
func (*UserService) GetUser ¶
func (s *UserService) GetUser(ctx context.Context, req *pb.GetUserRequest) (*pb.User, error)
func (*UserService) GetUserRoles ¶
func (s *UserService) GetUserRoles(ctx context.Context, req *pb.GetUserRoleRequest) (*pb.GetUserRoleReply, error)
func (*UserService) InviteUser ¶
func (s *UserService) InviteUser(ctx context.Context, req *pb.InviteUserRequest) (*pb.InviteUserReply, error)
func (*UserService) ListUsers ¶
func (s *UserService) ListUsers(ctx context.Context, req *pb.ListUsersRequest) (*pb.ListUsersResponse, error)
func (*UserService) UpdateAvatar ¶
func (s *UserService) UpdateAvatar(ctx http.Context) error
func (*UserService) UpdateUser ¶
func (s *UserService) UpdateUser(ctx context.Context, req *pb.UpdateUserRequest) (*pb.User, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.