profile

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2026 License: GPL-3.0 Imports: 31 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindOAuthCallbackLogic

type BindOAuthCallbackLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*BindOAuthCallbackLogic) BindOAuthCallback

func (l *BindOAuthCallbackLogic) BindOAuthCallback(req *dto.BindOAuthCallbackRequest) error

type BindOAuthLogic

type BindOAuthLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*BindOAuthLogic) BindOAuth

func (l *BindOAuthLogic) BindOAuth(req *dto.BindOAuthRequest) (resp *dto.BindOAuthResponse, err error)

type BindTelegramLogic

type BindTelegramLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

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

type GetDeviceListLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*GetDeviceListLogic) GetDeviceList

func (l *GetDeviceListLogic) GetDeviceList() (resp *dto.GetDeviceListResponse, err error)

type GetLoginLogLogic

type GetLoginLogLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*GetLoginLogLogic) GetLoginLog

func (l *GetLoginLogLogic) GetLoginLog(req *dto.GetLoginLogRequest) (resp *dto.GetLoginLogResponse, err error)

type GetOAuthMethodsLogic

type GetOAuthMethodsLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*GetOAuthMethodsLogic) GetOAuthMethods

func (l *GetOAuthMethodsLogic) GetOAuthMethods() (resp *dto.GetOAuthMethodsResponse, err error)

type OAuthMethodPolicy

type OAuthMethodPolicy interface {
	EnsureMethodEnabled(ctx context.Context, method string) error
}

OAuthMethodPolicy checks whether a requested authentication method is enabled; the sibling authentication subdomain's register policy satisfies it.

type QueryUserInfoLogic

type QueryUserInfoLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

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 NewService(deps Deps) *Service

func (*Service) BindOAuth

func (s *Service) BindOAuth(ctx context.Context, req *dto.BindOAuthRequest) (*dto.BindOAuthResponse, error)

func (*Service) BindOAuthCallback

func (s *Service) BindOAuthCallback(ctx context.Context, req *dto.BindOAuthCallbackRequest) error

func (*Service) BindTelegram

func (s *Service) BindTelegram(ctx context.Context) (*dto.BindTelegramResponse, error)

func (*Service) GetDeviceList

func (s *Service) GetDeviceList(ctx context.Context) (*dto.GetDeviceListResponse, error)

func (*Service) GetLoginLog

func (s *Service) GetLoginLog(ctx context.Context, req *dto.GetLoginLogRequest) (*dto.GetLoginLogResponse, error)

func (*Service) GetOAuthMethods

func (s *Service) GetOAuthMethods(ctx context.Context) (*dto.GetOAuthMethodsResponse, error)

func (*Service) QueryUserInfo

func (s *Service) QueryUserInfo(ctx context.Context) (*dto.User, error)

func (*Service) UnbindDevice

func (s *Service) UnbindDevice(ctx context.Context, req *dto.UnbindDeviceRequest) error

func (*Service) UnbindOAuth

func (s *Service) UnbindOAuth(ctx context.Context, req *dto.UnbindOAuthRequest) error

func (*Service) UnbindTelegram

func (s *Service) UnbindTelegram(ctx context.Context) error

func (*Service) UpdateBindEmail

func (s *Service) UpdateBindEmail(ctx context.Context, req *dto.UpdateBindEmailRequest) error

func (*Service) UpdateBindMobile

func (s *Service) UpdateBindMobile(ctx context.Context, req *dto.UpdateBindMobileRequest) error

func (*Service) UpdateUserNotify

func (s *Service) UpdateUserNotify(ctx context.Context, req *dto.UpdateUserNotifyRequest) error

func (*Service) UpdateUserPassword

func (s *Service) UpdateUserPassword(ctx context.Context, req *dto.UpdateUserPasswordRequest) error

func (*Service) UpdateUserRules

func (s *Service) UpdateUserRules(ctx context.Context, req *dto.UpdateUserRulesRequest) error

func (*Service) VerifyEmail

func (s *Service) VerifyEmail(ctx context.Context, req *dto.VerifyEmailRequest) error

type UnbindDeviceLogic

type UnbindDeviceLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UnbindDeviceLogic) UnbindDevice

func (l *UnbindDeviceLogic) UnbindDevice(req *dto.UnbindDeviceRequest) error

type UnbindOAuthLogic

type UnbindOAuthLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UnbindOAuthLogic) UnbindOAuth

func (l *UnbindOAuthLogic) UnbindOAuth(req *dto.UnbindOAuthRequest) error

type UnbindTelegramLogic

type UnbindTelegramLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UnbindTelegramLogic) UnbindTelegram

func (l *UnbindTelegramLogic) UnbindTelegram() error

type UpdateBindEmailLogic

type UpdateBindEmailLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UpdateBindEmailLogic) UpdateBindEmail

func (l *UpdateBindEmailLogic) UpdateBindEmail(req *dto.UpdateBindEmailRequest) error

type UpdateBindMobileLogic

type UpdateBindMobileLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UpdateBindMobileLogic) UpdateBindMobile

func (l *UpdateBindMobileLogic) UpdateBindMobile(req *dto.UpdateBindMobileRequest) error

type UpdateUserNotifyLogic

type UpdateUserNotifyLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UpdateUserNotifyLogic) UpdateUserNotify

func (l *UpdateUserNotifyLogic) UpdateUserNotify(req *dto.UpdateUserNotifyRequest) error

type UpdateUserPasswordLogic

type UpdateUserPasswordLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UpdateUserPasswordLogic) UpdateUserPassword

func (l *UpdateUserPasswordLogic) UpdateUserPassword(req *dto.UpdateUserPasswordRequest) error

type UpdateUserRulesLogic

type UpdateUserRulesLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*UpdateUserRulesLogic) UpdateUserRules

func (l *UpdateUserRulesLogic) UpdateUserRules(req *dto.UpdateUserRulesRequest) error

type VerifyEmailLogic

type VerifyEmailLogic struct {
	logger.Logger
	// contains filtered or unexported fields
}

func (*VerifyEmailLogic) VerifyEmail

func (l *VerifyEmailLogic) VerifyEmail(req *dto.VerifyEmailRequest) error

Jump to

Keyboard shortcuts

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