Skip to content

feat: add login attempt schema and storage for rate limiting#530

Open
lakhansamani wants to merge 1 commit intomainfrom
feat/login-attempt-schema-storage
Open

feat: add login attempt schema and storage for rate limiting#530
lakhansamani wants to merge 1 commit intomainfrom
feat/login-attempt-schema-storage

Conversation

@lakhansamani
Copy link
Copy Markdown
Contributor

Summary

  • Adds LoginAttempt schema to track individual login attempts (email, IP, success, timestamp)
  • Implements AddLoginAttempt, CountFailedLoginAttemptsSince (sliding window), DeleteLoginAttemptsBefore (cleanup)
  • Supports all 6 DB providers (SQL/GORM, MongoDB, ArangoDB, Cassandra, DynamoDB, Couchbase)
  • Creates table/collection with indexes on email and attempted_at for efficient sliding window queries
  • Includes integration tests for add, count, and delete operations

Related

Ref: RFC #501

Test plan

  • Run go build ./... — compiles clean
  • Run integration tests: go test -p 1 -v -run TestLoginAttempts ./internal/integration_tests/
  • Verify sliding window count returns only failures within time window

🤖 Generated with Claude Code

…miting

Add LoginAttempt schema to track individual login attempts with email,
IP address, success status, and timestamp. Implements AddLoginAttempt,
CountFailedLoginAttemptsSince (for sliding window lockout), and
DeleteLoginAttemptsBefore (for cleanup) across all 6 DB providers.
Includes integration tests. Ref: RFC #501.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant