Skip to content

Invite links gql#2745

Draft
GregorShear wants to merge 2 commits intomasterfrom
greg/invite_links
Draft

Invite links gql#2745
GregorShear wants to merge 2 commits intomasterfrom
greg/invite_links

Conversation

@GregorShear
Copy link
Contributor

Adds createInviteLink and redeemInviteLink GraphQL mutations as the first step in migrating invite links from the directive system to GraphQL. This runs parallel to the existing directive-based flow.

Changes:

  • New invite_links table with RLS policy restricting management to prefix admins
  • createInviteLink mutation — admin creates an invite for a catalog prefix with a given capability, optional use limit, and description
  • redeemInviteLink mutation — authenticated user redeems a token to receive a user_grant, with optional sub-prefix narrowing. Atomically decrements uses_remaining and distinguishes "not found" from "exhausted" errors
  • Tests covering: create + redeem happy path, requested sub-prefix, unauthorized create, invalid token, exhausted link, out-of-scope prefix

Context: Phase 1 of the SSO & user management initiative (invite link migration → SSO enforcement → SCIM deprovisioning).

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)

@GregorShear GregorShear force-pushed the greg/invite_links branch 2 times, most recently from d617dba to cb796df Compare March 9, 2026 16:41
Add a new invite_links table, a gql query and two mutations (createInviteLink, redeemInviteLink)
Delete consumed rows instead of decrementing a counter
Add deleteInviteLink mutation for admin revocation
Add cursor-based pagination to inviteLinks query
Add reusable nested filter pattern (InviteLinksFilter + BoolFilter)
Dual-write triggers for backward compatibility with directives
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