feat(groups): add AuthKit Groups support - #60
Merged
Merged
Conversation
Issue #57: the emulator had no `/organizations/{org}/groups` routes, so SDK consumers testing AuthKit Groups had nothing to hit, and the five `group.*` events were declared in the generated catalog but never fired. This implements all nine spec endpoints, wires the events to collection hooks (so seeded and API-created groups emit identically), and makes groups seedable nested under `organizations` — mirroring `memberships` — so a test suite can pre-populate groups without setup calls.
Greptile SummaryThis PR adds complete AuthKit Groups support, including API routes, persistence, events, seed configuration, validation, and generated support documentation.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
|
When `groups` were configured alongside a truthy non-array `memberships` value, the groups validation block called `.map()` on that invalid value and threw a `TypeError`, crashing startup and `--validate-config` instead of returning the structured memberships error the validator had already recorded. Guard the cross-reference with `Array.isArray`, mirroring the memberships block's own check.
A non-object group entry such as `groups: [null]` dereferenced `group.name` and threw a `TypeError`, crashing startup and `--validate-config` instead of returning a structured error. Record an "each group must be an object" error and skip the property checks, matching the validator's structured-error approach.
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.
Summary
/organizations/{org}/groups, add/list/remove organization memberships to/from a group, andGET /user_management/organization_memberships/{om}/groups— closing the gap from Groups support? #57, where the emulator had nogroupsroutes.group.*events (created/updated/deleted,member_added/member_removed) to collection hooks, so seeded and API-created groups emit identically. The events were already declared in the generated catalog but never fired.groupsnest underorganizations, mirroringmemberships; members join by email (the same join key memberships use, since om ids are generated at startup). The config validator cross-references each member against the org'smembershipsand rejects typos/dangling references at startup.UserlandUserOrganizationMembershipBaseshape (no embeddeduser/roles), via a newformatMembershipBasehelper.Closes #57