service

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: Apache-2.0 Imports: 52 Imported by: 3

README

Service

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is service providers.

Functions

func FindUserByUsernameAndValidatePwd

func FindUserByUsernameAndValidatePwd(ctx context.Context, um *biz.UserManager, username, password string) (*biz.User, error)

func MapBizRoleToApi

func MapBizRoleToApi(u *biz.Role, b *pb.Role)

func MapBizUserToApi

func MapBizUserToApi(ctx context.Context, u *biz.User, b blob.Factory) *pb.User

func NewHydra

func NewHydra(c *kconf.Security) *client.APIClient

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 (*AccountService) DeleteAddresses

func (*AccountService) GetAddresses

func (*AccountService) GetProfile

func (*AccountService) GetSettings

func (*AccountService) UpdateAddresses

func (*AccountService) UpdateAvatar

func (s *AccountService) UpdateAvatar(ctx http.Context) error

func (*AccountService) UpdateProfile

func (*AccountService) UpdateSettings

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 (*AuthService) ChangePasswordByPre

func (*AuthService) ForgetPassword

func (*AuthService) GetCsrfToken

func (*AuthService) Login

func (*AuthService) LoginPasswordless

func (*AuthService) Refresh

func (*AuthService) RefreshRememberToken

func (*AuthService) Register

func (*AuthService) SendForgetPasswordToken

func (s *AuthService) SendForgetPasswordToken(ctx context.Context, req *pb.ForgetPasswordTokenRequest) (*pb.ForgetPasswordTokenReply, error)

func (*AuthService) SendPasswordlessToken

func (*AuthService) Token

func (s *AuthService) Token(ctx context.Context, req *pb.TokenRequest) (*pb.TokenReply, error)

func (*AuthService) ValidatePassword

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 (*PermissionService) AddSubjectPermission

func (*PermissionService) CheckCurrent

func (*PermissionService) CheckForSubjects

CheckForSubjects internal api for remote permission checker

func (*PermissionService) GetCurrent

func (*PermissionService) ListSubjectPermission

func (*PermissionService) RemoveSubjectPermission

func (*PermissionService) UpdateSubjectPermission

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 (*RoleService) GetRole

func (s *RoleService) GetRole(ctx context.Context, req *pb.GetRoleRequest) (*pb.Role, error)

func (*RoleService) GetRolePermission

func (*RoleService) ListRoles

func (*RoleService) UpdateRole

func (s *RoleService) UpdateRole(ctx context.Context, req *pb.UpdateRoleRequest) (*pb.Role, error)

func (*RoleService) UpdateRolePermission

type UserRoleContrib

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

func NewUserRoleContrib

func NewUserRoleContrib(userRepo biz.UserRepo) *UserRoleContrib

func (*UserRoleContrib) Process

func (u *UserRoleContrib) Process(ctx context.Context, subject authz.Subject) ([]authz.Subject, error)

type UserService

type UserService struct {
	pb.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

func (*UserService) CheckUserTenant

CheckUserTenant internal api for check user tenant

func (*UserService) CheckUserTenantInternal

func (s *UserService) CheckUserTenantInternal(ctx context.Context, userId, tenantId string) (bool, error)

func (*UserService) CreateUser

func (s *UserService) CreateUser(ctx context.Context, req *pb.CreateUserRequest) (*pb.User, error)

func (*UserService) DeleteUser

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 (*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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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