Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AccountLockout = apierrors.TooManyRequest.WithReason("AccountLockout")
View Source
var DependencySet = wire.NewSet( wire.Struct(new(StorageRedis), "*"), wire.Struct(new(Service), "*"), wire.Bind(new(Storage), new(*StorageRedis)), )
View Source
var ServiceLogger = slogutil.NewLogger("lockout")
Functions ¶
func NewErrLocked ¶
Types ¶
type LockoutSpec ¶
type LockoutSpec struct {
Name string
Arguments []string
Enabled bool
MaxAttempts int
HistoryDuration time.Duration
MinimumDuration time.Duration
MaximumDuration time.Duration
BackoffFactor float64
IsGlobal bool
}
func NewAccountAuthenticationSpecForAttempt ¶
func NewAccountAuthenticationSpecForAttempt(cfg *config.AuthenticationLockoutConfig, userID string, methods []config.AuthenticationLockoutMethod) LockoutSpec
func NewAccountAuthenticationSpecForCheck ¶
func NewAccountAuthenticationSpecForCheck(cfg *config.AuthenticationLockoutConfig, userID string) LockoutSpec
func (LockoutSpec) Key ¶
func (s LockoutSpec) Key() string
type MakeAttemptResult ¶
func (*MakeAttemptResult) ErrorIfLocked ¶
func (m *MakeAttemptResult) ErrorIfLocked() error
type Service ¶
type Service struct {
Storage Storage
}
func (*Service) ClearAttempts ¶
func (*Service) MakeAttempts ¶
func (s *Service) MakeAttempts(ctx context.Context, spec LockoutSpec, contributor string, attempts int) (result *MakeAttemptResult, err error)
type StorageRedis ¶
func (StorageRedis) Clear ¶
func (s StorageRedis) Clear(ctx context.Context, spec LockoutSpec, contributor string) (err error)
Click to show internal directories.
Click to hide internal directories.