security_protection

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BruteForceService

type BruteForceService struct {
	// contains filtered or unexported fields
}

BruteForceService provides operations for brute force protection

func NewBruteForceService

func NewBruteForceService(repo security.BruteForceRepository, config *security.BruteForceConfig) *BruteForceService

NewBruteForceService creates a new brute force service

func (*BruteForceService) CheckLoginAttempt

func (s *BruteForceService) CheckLoginAttempt(email, ipAddress string) error

CheckLoginAttempt checks if a login can be attempted for the given email Returns an error if the account is locked

func (*BruteForceService) ClearAttempts

func (s *BruteForceService) ClearAttempts(email string) error

ClearAttempts clears all failed attempts for an email and unlocks the account

func (*BruteForceService) GetLockoutInfo

func (s *BruteForceService) GetLockoutInfo(email string) (*security.AccountLockout, error)

GetLockoutInfo gets lockout information for an account

func (*BruteForceService) RecordFailedAttempt

func (s *BruteForceService) RecordFailedAttempt(email, ipAddress string) error

RecordFailedAttempt records a failed login attempt and locks the account if threshold is exceeded

Jump to

Keyboard shortcuts

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