Skip to content

feat(auth): add per-account auth rate limits#544

Open
slint wants to merge 1 commit intoinveniosoftware:masterfrom
slint:limit-frogot-password
Open

feat(auth): add per-account auth rate limits#544
slint wants to merge 1 commit intoinveniosoftware:masterfrom
slint:limit-frogot-password

Conversation

@slint
Copy link
Member

@slint slint commented Feb 13, 2026

  • Enforce per-account limits on forgot-password, login, and send-confirmation flows using user-id limiter keys.
  • Add configurable rate-limit and key-prefix settings for each protected flow.

Screenshots

CleanShot 2026-02-19 at 22 43 11@2x CleanShot 2026-02-19 at 22 44 27@2x CleanShot 2026-02-19 at 22 45 42@2x

@slint slint moved this to In review 🔍 in Sprint Q1/2026 Feb 13, 2026
@slint slint force-pushed the limit-frogot-password branch from 948b91a to 0a5e077 Compare February 15, 2026 13:56
@slint slint changed the title feat(auth): add forgot-password per-email rate limit feat(auth): add per-account auth rate limits Feb 15, 2026
@slint slint force-pushed the limit-frogot-password branch 3 times, most recently from 568ee4c to 8ed0a3a Compare February 15, 2026 14:43
Copy link
Contributor

@ntarocco ntarocco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

)
"""Message shown when forgot-password per-account rate limit is exceeded."""

ACCOUNTS_LOGIN_RATELIMIT = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to have None as default? Or maybe a good value instead as a default?
Same for all the other endpoints.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if Flask-Limiter is enabled by default in all instances... In invenio-app we always initialize the extension, but I'm not sure if there's another config flag that actually "enables" it.

I wanted to go around this assumption by not configuring any of the limits here. This is something we could do in invenio-app-rdm though where we have already configured e.g. Redis for the rate-limiting storage.

- Enforce per-account limits on forgot-password, login, and send-confirmation flows using user-id limiter keys.
- Add configurable rate-limit and key-prefix settings for each protected flow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review 🔍

Development

Successfully merging this pull request may close these issues.

2 participants