Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisableUseCase ¶
type DisableUseCase struct {
Logger models.Logger
EventBus models.EventBus
TOTPRepo TOTPRepository
}
func NewDisableUseCase ¶
func NewDisableUseCase( logger models.Logger, eventBus models.EventBus, totpRepo TOTPRepository, ) *DisableUseCase
type EnableUseCase ¶
type EnableUseCase struct {
Config *types.TOTPPluginConfig
Logger models.Logger
EventBus models.EventBus
UserService rootservices.UserService
TokenService rootservices.TokenService
Verification rootservices.VerificationService
TOTPService *services.TOTPService
BackupCodeService *services.BackupCodeService
TOTPRepo TOTPRepository
}
func NewEnableUseCase ¶
func NewEnableUseCase( config *types.TOTPPluginConfig, logger models.Logger, eventBus models.EventBus, userService rootservices.UserService, tokenService rootservices.TokenService, verificationService rootservices.VerificationService, totpService *services.TOTPService, backupCodeService *services.BackupCodeService, totpRepo TOTPRepository, ) *EnableUseCase
func (*EnableUseCase) Enable ¶
func (uc *EnableUseCase) Enable(ctx context.Context, userID string, issuer string) (*types.EnableResult, error)
type GenerateBackupCodesUseCase ¶
type GenerateBackupCodesUseCase struct {
BackupCodeService *services.BackupCodeService
TOTPRepo TOTPRepository
}
func NewGenerateBackupCodesUseCase ¶
func NewGenerateBackupCodesUseCase( backupCodeService *services.BackupCodeService, totpRepo TOTPRepository, ) *GenerateBackupCodesUseCase
type GetTOTPURIUseCase ¶
type GetTOTPURIUseCase struct {
Config *types.TOTPPluginConfig
UserService rootservices.UserService
TokenService rootservices.TokenService
TOTPService *services.TOTPService
TOTPRepo TOTPReadRepository
}
func NewGetTOTPURIUseCase ¶
func NewGetTOTPURIUseCase( config *types.TOTPPluginConfig, userService rootservices.UserService, tokenService rootservices.TokenService, totpService *services.TOTPService, totpRepo TOTPReadRepository, ) *GetTOTPURIUseCase
func (*GetTOTPURIUseCase) GetTOTPURI ¶
type TOTPCreateRepository ¶
type TOTPReadRepository ¶
type TOTPRepository ¶
type TOTPRepository interface {
TOTPReadRepository
TOTPWriteRepository
TOTPCreateRepository
TOTPTrustedDeviceRepository
}
type TOTPWriteRepository ¶
type TOTPWriteRepository interface {
DeleteByUserID(ctx context.Context, userID string) error
SetEnabled(ctx context.Context, userID string, enabled bool) error
UpdateBackupCodes(ctx context.Context, userID, backupCodes string) error
CompareAndSwapBackupCodes(ctx context.Context, userID, expectedBackupCodes, newBackupCodes string) (bool, error)
}
type UseCases ¶
type UseCases struct {
Enable *EnableUseCase
Disable *DisableUseCase
GetTOTPURI *GetTOTPURIUseCase
VerifyTOTP *VerifyTOTPUseCase
GenerateBackupCodes *GenerateBackupCodesUseCase
VerifyBackupCode *VerifyBackupCodeUseCase
}
type VerifyBackupCodeUseCase ¶
type VerifyBackupCodeUseCase struct {
GlobalConfig *models.Config
Config *types.TOTPPluginConfig
Logger models.Logger
EventBus models.EventBus
TokenService rootservices.TokenService
SessionService rootservices.SessionService
UserService rootservices.UserService
VerificationService rootservices.VerificationService
BackupCodeService *services.BackupCodeService
TOTPRepo TOTPRepository
}
func NewVerifyBackupCodeUseCase ¶
func NewVerifyBackupCodeUseCase( globalConfig *models.Config, config *types.TOTPPluginConfig, logger models.Logger, eventBus models.EventBus, tokenService rootservices.TokenService, sessionService rootservices.SessionService, userService rootservices.UserService, verificationService rootservices.VerificationService, backupCodeService *services.BackupCodeService, totpRepo TOTPRepository, ) *VerifyBackupCodeUseCase
type VerifyTOTPUseCase ¶
type VerifyTOTPUseCase struct {
GlobalConfig *models.Config
Config *types.TOTPPluginConfig
Logger models.Logger
EventBus models.EventBus
TokenService rootservices.TokenService
SessionService rootservices.SessionService
UserService rootservices.UserService
VerificationService rootservices.VerificationService
TOTPService *services.TOTPService
TOTPRepo TOTPRepository
}
func NewVerifyTOTPUseCase ¶
func NewVerifyTOTPUseCase( globalConfig *models.Config, config *types.TOTPPluginConfig, logger models.Logger, eventBus models.EventBus, tokenService rootservices.TokenService, sessionService rootservices.SessionService, userService rootservices.UserService, verificationService rootservices.VerificationService, totpService *services.TOTPService, totpRepo TOTPRepository, ) *VerifyTOTPUseCase
Click to show internal directories.
Click to hide internal directories.