feat(nhis): count NHIs as members in the org limits - #162
Merged
Merged
Conversation
NHIs hold an org membership and act with its role, so they now consume a store_nb_members slot: getNbMembers counts them, NHI creation is refused with a 429 when the org is full, and NHI creation/deletion recompute the counter. The UI disables NHI creation at the limit and refreshes the limits after NHI changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NHIs now consume a
store_nb_membersslot, like human members:getNbMembersno longer filters out NHIs, so every existing recompute (user deletion, cleanup cron, SSO sync, invitations) includes them.POST /api/organizations/:id/nhisis refused with a 429 (maxNbMembers) when the org is full; NHI creation and deletion recompute the counter.Why: an NHI holds an org membership and acts with its role, so it should count against the org's member quota.
Heads-up:
consumptionuntil their next member change (no migration included).store_nb_members.consumptionis read by external services through the limits endpoint; their numbers will grow for orgs with NHIs, and it can now exceed the default (human only) member listing count.