memory

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

Get retrieves a provider by name

func (*OAuthProviderRegistry) List

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)

Jump to

Keyboard shortcuts

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