Skip to content

fix(api): rate limit invites per organization - #9041

Open
jdolle wants to merge 1 commit into
mainfrom
jdolle/8933-invite-by-email-ratelimit
Open

jdolle wants to merge 1 commit into
mainfrom
jdolle/8933-invite-by-email-ratelimit

Conversation

@jdolle

@jdolle jdolle commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Background

The rate limit on Mutation.inviteToOrganizationByEmail has not worked as intended since #8577 moved it to Redis. The window was 5,000 seconds instead of 5 (6 invites per ~83 minutes), it was counted per client IP, and it ran before the permission check. It also threw a GraphQL error instead of using the mutation's error result.

Resolves #8933

Description

API only (OrganizationManager.inviteByEmail):

  • The limit is now 30 invites per minute per organization.
  • It is checked after the organization is resolved and member:modify is authorized, so only callers allowed to invite consume it.
  • Hitting it returns the mutation's error result with the same message. There is no schema change and the web app already shows this error. Public API clients that detected the limit through top-level errors will now find it in error.message.

One unit test covers the window, the per-organization key, the ordering and the result shape.

Checklist

  • Access control
  • Error handling and logging
  • Testing

@jdolle jdolle self-assigned this Dec 4, 2026
@theguild-bot

Copy link
Copy Markdown
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/laboratory 0.4.2-alpha-20261204222554-bfffcfcbb6f4858b2d5a181574f9523e1fd57457 npm ↗︎ unpkg ↗︎
@graphql-hive/render-laboratory 0.2.1-alpha-20261204222554-bfffcfcbb6f4858b2d5a181574f9523e1fd57457 npm ↗︎ unpkg ↗︎
hive 15.10.0-alpha-20261204222554-bfffcfcbb6f4858b2d5a181574f9523e1fd57457 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/arm64

Image Tags: 15.10.0-alpha-bfffcfc, bfffcfc, bfffcfcbb6f4858b2d5a181574f9523e1fd57457

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

inviteByEmail rate limit is keyed by client IP, runs before authorization, and is far too lenient

2 participants