Documentation
¶
Overview ¶
Package profile implements the self-service identity subdomain of the identity module: account info, credentials, third-party bindings, devices and notification preferences. Only the module facade may reach it.
Index ¶
- type BindOAuthCallbackLogic
- type BindOAuthLogic
- type BindTelegramLogic
- type Deps
- type GetDeviceListLogic
- type GetLoginLogLogic
- type GetOAuthMethodsLogic
- type OAuthMethodPolicy
- type QueryUserInfoLogic
- type Service
- func (s *Service) BindOAuth(ctx context.Context, req *dto.BindOAuthRequest) (*dto.BindOAuthResponse, error)
- func (s *Service) BindOAuthCallback(ctx context.Context, req *dto.BindOAuthCallbackRequest) error
- func (s *Service) BindTelegram(ctx context.Context) (*dto.BindTelegramResponse, error)
- func (s *Service) GetDeviceList(ctx context.Context) (*dto.GetDeviceListResponse, error)
- func (s *Service) GetLoginLog(ctx context.Context, req *dto.GetLoginLogRequest) (*dto.GetLoginLogResponse, error)
- func (s *Service) GetOAuthMethods(ctx context.Context) (*dto.GetOAuthMethodsResponse, error)
- func (s *Service) QueryUserInfo(ctx context.Context) (*dto.User, error)
- func (s *Service) UnbindDevice(ctx context.Context, req *dto.UnbindDeviceRequest) error
- func (s *Service) UnbindOAuth(ctx context.Context, req *dto.UnbindOAuthRequest) error
- func (s *Service) UnbindTelegram(ctx context.Context) error
- func (s *Service) UpdateBindEmail(ctx context.Context, req *dto.UpdateBindEmailRequest) error
- func (s *Service) UpdateBindMobile(ctx context.Context, req *dto.UpdateBindMobileRequest) error
- func (s *Service) UpdateUserNotify(ctx context.Context, req *dto.UpdateUserNotifyRequest) error
- func (s *Service) UpdateUserPassword(ctx context.Context, req *dto.UpdateUserPasswordRequest) error
- func (s *Service) UpdateUserRules(ctx context.Context, req *dto.UpdateUserRulesRequest) error
- func (s *Service) VerifyEmail(ctx context.Context, req *dto.VerifyEmailRequest) error
- type UnbindDeviceLogic
- type UnbindOAuthLogic
- type UnbindTelegramLogic
- type UpdateBindEmailLogic
- type UpdateBindMobileLogic
- type UpdateUserNotifyLogic
- type UpdateUserPasswordLogic
- type UpdateUserRulesLogic
- type VerifyEmailLogic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindOAuthCallbackLogic ¶
func (*BindOAuthCallbackLogic) BindOAuthCallback ¶
func (l *BindOAuthCallbackLogic) BindOAuthCallback(req *dto.BindOAuthCallbackRequest) error
type BindOAuthLogic ¶
func (*BindOAuthLogic) BindOAuth ¶
func (l *BindOAuthLogic) BindOAuth(req *dto.BindOAuthRequest) (resp *dto.BindOAuthResponse, err error)
type BindTelegramLogic ¶
func (*BindTelegramLogic) BindTelegram ¶
func (l *BindTelegramLogic) BindTelegram() (resp *dto.BindTelegramResponse, err error)
type Deps ¶
type Deps struct {
Users repository.UserRepo
UserAuth repository.UserAuthRepo
Auth repository.AuthRepo
Devices repository.UserDeviceRepo
UserCache repository.UserCacheRepo
Logs repository.LogRepo
// Wallet is the billing-domain read port for the account view.
Wallet repository.WalletRepo
Redis *redis.Client
// Store carries the identity-scoped transaction for device unbinding.
Store repository.Store
Policy OAuthMethodPolicy
// EmailDomains snapshots the runtime-mutable email domain-suffix policy.
EmailDomains func() (domainList string, restrict bool)
// SiteHost snapshots the runtime-mutable site host that anchors the
// OAuth redirect allowlist.
SiteHost func() string
// TelegramBotName snapshots the runtime-mutable Telegram bot name.
TelegramBotName func() string
// NotifyUnbind sends the best-effort Telegram unbind notice through the
// runtime-configured bot.
NotifyUnbind func(userID, chatID int64) error
}
Deps declares the subdomain's dependencies; the module facade forwards them from the composition root.
type GetDeviceListLogic ¶
func (*GetDeviceListLogic) GetDeviceList ¶
func (l *GetDeviceListLogic) GetDeviceList() (resp *dto.GetDeviceListResponse, err error)
type GetLoginLogLogic ¶
func (*GetLoginLogLogic) GetLoginLog ¶
func (l *GetLoginLogLogic) GetLoginLog(req *dto.GetLoginLogRequest) (resp *dto.GetLoginLogResponse, err error)
type GetOAuthMethodsLogic ¶
func (*GetOAuthMethodsLogic) GetOAuthMethods ¶
func (l *GetOAuthMethodsLogic) GetOAuthMethods() (resp *dto.GetOAuthMethodsResponse, err error)
type OAuthMethodPolicy ¶
OAuthMethodPolicy checks whether a requested authentication method is enabled; the sibling authentication subdomain's register policy satisfies it.
type QueryUserInfoLogic ¶
func (*QueryUserInfoLogic) QueryUserInfo ¶
func (l *QueryUserInfoLogic) QueryUserInfo() (resp *dto.User, err error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the profile subdomain entry point used by the identity facade.
func NewService ¶
func (*Service) BindOAuth ¶
func (s *Service) BindOAuth(ctx context.Context, req *dto.BindOAuthRequest) (*dto.BindOAuthResponse, error)
func (*Service) BindOAuthCallback ¶
func (*Service) BindTelegram ¶
func (*Service) GetDeviceList ¶
func (*Service) GetLoginLog ¶
func (s *Service) GetLoginLog(ctx context.Context, req *dto.GetLoginLogRequest) (*dto.GetLoginLogResponse, error)
func (*Service) GetOAuthMethods ¶
func (*Service) QueryUserInfo ¶
func (*Service) UnbindDevice ¶
func (*Service) UnbindOAuth ¶
func (*Service) UpdateBindEmail ¶
func (*Service) UpdateBindMobile ¶
func (*Service) UpdateUserNotify ¶
func (*Service) UpdateUserPassword ¶
func (*Service) UpdateUserRules ¶
func (*Service) VerifyEmail ¶
type UnbindDeviceLogic ¶
func (*UnbindDeviceLogic) UnbindDevice ¶
func (l *UnbindDeviceLogic) UnbindDevice(req *dto.UnbindDeviceRequest) error
type UnbindOAuthLogic ¶
func (*UnbindOAuthLogic) UnbindOAuth ¶
func (l *UnbindOAuthLogic) UnbindOAuth(req *dto.UnbindOAuthRequest) error
type UnbindTelegramLogic ¶
func (*UnbindTelegramLogic) UnbindTelegram ¶
func (l *UnbindTelegramLogic) UnbindTelegram() error
type UpdateBindEmailLogic ¶
func (*UpdateBindEmailLogic) UpdateBindEmail ¶
func (l *UpdateBindEmailLogic) UpdateBindEmail(req *dto.UpdateBindEmailRequest) error
type UpdateBindMobileLogic ¶
func (*UpdateBindMobileLogic) UpdateBindMobile ¶
func (l *UpdateBindMobileLogic) UpdateBindMobile(req *dto.UpdateBindMobileRequest) error
type UpdateUserNotifyLogic ¶
func (*UpdateUserNotifyLogic) UpdateUserNotify ¶
func (l *UpdateUserNotifyLogic) UpdateUserNotify(req *dto.UpdateUserNotifyRequest) error
type UpdateUserPasswordLogic ¶
func (*UpdateUserPasswordLogic) UpdateUserPassword ¶
func (l *UpdateUserPasswordLogic) UpdateUserPassword(req *dto.UpdateUserPasswordRequest) error
type UpdateUserRulesLogic ¶
func (*UpdateUserRulesLogic) UpdateUserRules ¶
func (l *UpdateUserRulesLogic) UpdateUserRules(req *dto.UpdateUserRulesRequest) error
type VerifyEmailLogic ¶
func (*VerifyEmailLogic) VerifyEmail ¶
func (l *VerifyEmailLogic) VerifyEmail(req *dto.VerifyEmailRequest) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.