Documentation
¶
Index ¶
- type InMemoryBruteForceRepository
- func (r *InMemoryBruteForceRepository) ClearAttempts(email string) error
- func (r *InMemoryBruteForceRepository) GetAttemptCount(email string, duration time.Duration) (int, error)
- func (r *InMemoryBruteForceRepository) GetAttemptCountByIP(ipAddress string, duration time.Duration) (int, error)
- func (r *InMemoryBruteForceRepository) GetLockoutInfo(email string) (*security.AccountLockout, error)
- func (r *InMemoryBruteForceRepository) IsAccountLocked(email string) (bool, error)
- func (r *InMemoryBruteForceRepository) LockAccount(email string, unlocksAt time.Time) error
- func (r *InMemoryBruteForceRepository) RecordAttempt(email, ipAddress string) error
- func (r *InMemoryBruteForceRepository) UnlockAccount(email string) error
- type OAuthProviderRegistry
- func (r *OAuthProviderRegistry) Get(providerID account.ProviderType) (account.OAuthProvider, error)
- func (r *OAuthProviderRegistry) List() []account.ProviderType
- func (r *OAuthProviderRegistry) Register(provider account.OAuthProvider) error
- func (r *OAuthProviderRegistry) Unregister(providerID account.ProviderType) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryBruteForceRepository ¶
type InMemoryBruteForceRepository struct {
// contains filtered or unexported fields
}
InMemoryBruteForceRepository is an in-memory implementation of security.InMemoryBruteForceRepository
func NewInMemoryBruteForceRepository ¶
func NewInMemoryBruteForceRepository() *InMemoryBruteForceRepository
NewInMemoryBruteForceRepository creates a new in-memory brute force repository
func (*InMemoryBruteForceRepository) ClearAttempts ¶
func (r *InMemoryBruteForceRepository) ClearAttempts(email string) error
ClearAttempts clears all failed attempts for an email
func (*InMemoryBruteForceRepository) GetAttemptCount ¶
func (r *InMemoryBruteForceRepository) GetAttemptCount(email string, duration time.Duration) (int, error)
GetAttemptCount returns the number of failed attempts in the last duration for an email
func (*InMemoryBruteForceRepository) GetAttemptCountByIP ¶
func (r *InMemoryBruteForceRepository) GetAttemptCountByIP(ipAddress string, duration time.Duration) (int, error)
GetAttemptCountByIP returns the number of failed attempts in the last duration for an IP
func (*InMemoryBruteForceRepository) GetLockoutInfo ¶
func (r *InMemoryBruteForceRepository) GetLockoutInfo(email string) (*security.AccountLockout, error)
GetLockoutInfo returns lockout information for an email
func (*InMemoryBruteForceRepository) IsAccountLocked ¶
func (r *InMemoryBruteForceRepository) IsAccountLocked(email string) (bool, error)
IsAccountLocked checks if an account is currently locked
func (*InMemoryBruteForceRepository) LockAccount ¶
func (r *InMemoryBruteForceRepository) LockAccount(email string, unlocksAt time.Time) error
LockAccount locks an account until the specified time
func (*InMemoryBruteForceRepository) RecordAttempt ¶
func (r *InMemoryBruteForceRepository) RecordAttempt(email, ipAddress string) error
RecordAttempt records a failed login attempt for an email
func (*InMemoryBruteForceRepository) UnlockAccount ¶
func (r *InMemoryBruteForceRepository) UnlockAccount(email string) error
UnlockAccount unlocks a locked account
type OAuthProviderRegistry ¶
type OAuthProviderRegistry struct {
// contains filtered or unexported fields
}
OAuthProviderRegistry implements account.OAuthProviderRegistry
func NewOAuthProviderRegistry ¶
func NewOAuthProviderRegistry() *OAuthProviderRegistry
NewOAuthProviderRegistry creates a new OAuth provider registry
func (*OAuthProviderRegistry) Get ¶
func (r *OAuthProviderRegistry) Get(providerID account.ProviderType) (account.OAuthProvider, error)
Get retrieves a provider by name
func (*OAuthProviderRegistry) List ¶
func (r *OAuthProviderRegistry) List() []account.ProviderType
List returns all registered providers
func (*OAuthProviderRegistry) Register ¶
func (r *OAuthProviderRegistry) Register(provider account.OAuthProvider) error
Register registers a new OAuth provider
func (*OAuthProviderRegistry) Unregister ¶
func (r *OAuthProviderRegistry) Unregister(providerID account.ProviderType) error
Unregister unregisters a provider (useful for testing)