Auto-creation groups: test plan + missing env variables in Docker dev file (IFC-2522)#9355
Auto-creation groups: test plan + missing env variables in Docker dev file (IFC-2522)#9355polmichel wants to merge 4 commits into
Conversation
…-2522) Surface the auto-create groups security envs and the OIDC userinfo method in the dev docker-compose, and add the manual test plan for the full auto-create groups feature under dev/specs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 5/5
- This looks low risk and safe to merge: the only finding is a documentation metadata mismatch, not a functional or behavioral code issue.
- The issue in
dev/specs/infp-556-auto-create-groups/test-plan.mdis a title Jira key update (IFC-2522), so user-facing runtime impact is unlikely. - Pay close attention to
dev/specs/infp-556-auto-create-groups/test-plan.md- correct the Jira key in the title to keep tracking and traceability accurate.
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would require human review. This PR changes over 1700 lines across many frontend source files, including renaming types, adding new API functions, and refactoring Apollo Client usage to TanStack Query—changes that affect business logic and data fetching, with risk of introducing bugs in diff, IPAM, and task display...
Re-trigger cubic
Remove the group_auto_create idp/protocol filter probe (the frontend filter was dropped) and renumber the remaining probes. Add Scenario I covering the activity-feed UI: provider-as-subject titles, the event-type dropdown entries, the per-type detail view, and the auto-created group's own activity timeline. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Expand Scenario I step 4 into explicit steps: open the Groups panel, click into an auto-created group, and confirm the auto-create event is reachable from that group's own Activities tab. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Shadow auto-approve: would require human review. The PR includes a large-scale frontend refactor migrating Apollo Client hooks to TanStack Query across many files (diff refresh, conflict resolution, IPAM namespaces, validator details), along with interface renames and new domain layers, which touches core business logic and requires human review.
Re-trigger cubic
Summary
Test plan related to the Auto-creation user groups feature IFC-2521.
Expose missing environment variables in development-only Docker file.
PRs summary
PR 1: All the feature except front-end and events management
#9302
PR 2: Event management
#9325
PR 3: Internal and external documentation
#9340
Contains external documentation to validate.
PR 4: Front-end
#9365
Contains screenshot of the front-end UI after the development.
Test Plan
Also included as a markdown file in the changes.
Manual Test Plan — Auto-create Account Groups (IFC-2521 — INFP-556)
Manual / live-instance walkthrough for the full feature as merged into
develop:originattribute) — squashed under PR #9302 → developGroupAutoCreatedEvent,GroupAutoCreateRejectedEvent,GroupAutoCreateCappedEvent+ typed GraphQLEventsquery +group_auto_createfilter) — squashed under PR #9325 → developScenarios A–D restate the PR #9302 walkthrough; new event/origin/docs verifications are appended to each scenario and as scenarios E–H.
Prerequisites
groupsclaim — Keycloak in Docker is used below.adminto query the API/UI while the test user is signed in via SSO.0 — Bring up Keycloak and configure the backend
The deps, task-manager, and Keycloak run in Docker via
dev.deps; the API server, task worker, and frontend run natively.0a — Write the dev-override (Keycloak + dep ports for native reach)
0b — Drop the realm import
Write
development/keycloak/import/realm.json. The realm needs:ops-admins,ops-readers,data-engineers,noise-groupalice(firstName=Alice, lastName=Admin) inops-admins,data-engineers,noise-groupmy-oauth2with agroupsmapper (oidc-group-membership-mapper,full.path=false) andredirectUriscontaining bothhttp://localhost:8000/*andhttp://localhost:8080/*0c — Export the full backend config in the shell
0d — Bring the deps up
uv run invoke dev.deps # Neo4j + message bus + cache + task-manager + Keycloak0e — Start the API server, task worker, and frontend
Run each in its own shell so logs stay separate. Shells 1 and 2 must inherit the exports from 0c.
0f — Sanity-check the stack
Open http://localhost:8080 in a browser — the login page must show a "Continue with Keycloak" button.
To re-apply env changes mid-test, edit the export(s) and Ctrl-C → restart Shell 1 (and Shell 2 if you changed worker-side envs). Shell 3 doesn't need restarts.
Reusable GraphQL probes
Open the GraphQL sandbox as
adminat http://localhost:8000/graphql and keep these queries handy.Probe 1 — list every auto-create event in chronological order
Probe 2 — inspect
originon every account groupScenario A — Happy path, filter exclusion,
origin, and the created-eventalice/alicevia the Keycloak button.admin, open/role-management/groups.ops-adminsanddata-engineers, withaliceas a member of each.originisprovider1. The field is rendered read-only (no edit affordance).noise-groupis not present — it matched neither the captured name nor the filter.GroupAutoCreatedEventTypeevents. For each one:idp = "provider1",protocol = "oidc"triggering_user_name = "Alice Admin"source_pattern = "^(?P<name>(ops|data)-.*)$"origin_value = "provider1"(matches theoriginattribute on the group)group_idmatches the group's UUID from the UIgroup_nameisops-adminsordata-engineersorigin.valueis"provider1"on the two new rows and isnullon every pre-existing group (Infrahub Users, admin-seeded rows, etc.).Scenario B — Filter excludes unrelated claims (no event emitted)
Continuing from Scenario A:
group_nameisnoise-groupand no rejected event for it — filter exclusion is silent.noise-groupin the UI.Scenario C — Idempotency on the second login (no duplicate event)
aliceout and back in.GroupAutoCreatedEvent.origin).Scenario D — Per-login cap and
GroupAutoCreateCappedEventEdit the Keycloak realm to give a fresh user
carolmembership in ~12 newops-*groups (any names that match the filter and don't yet exist locally).Recreate Keycloak's data so the new realm import lands:
Keep
INFRAHUB_SECURITY_AUTO_CREATE_GROUPS_MAX_PER_LOGIN=5exported — no restart needed unless you changed the value.Sign in as
carol. Login must succeed.Server logs show
auth_groups.skip_claim_over_per_login_caplines, one per dropped claim, each carryingeffective_name=...andmax_per_login=5.UI: exactly 5 new
ops-*groups exist, each withorigin=provider1.Run Probe 1:
GroupAutoCreatedEventTypeevents (one per created group).GroupAutoCreateCappedEventTypeevent with:cap_value = 5dropped_countequals the number of matching claims beyond 5 (7 if you added 12)dropped_claimsis the verbatim list of those claim values (each entry length-truncated)idp = "provider1",protocol = "oidc",triggering_user_nameequals carol's display name (the OIDCnameclaim —firstName + lastNameas set in the realm)Sign
carolin a second time. Re-run Probe 1 — neither the created nor the capped event count changes (existing-group reuse is uncapped and not audited as creation).Scenario E — Rejected claim emits
GroupAutoCreateRejectedEventThe rejection path fires when a claim matches the filter but the captured name is not a usable Infrahub group identifier (empty, whitespace-only, etc.).
Add group
pad-(or any name that the filter captures into an empty/whitespace string) and put a userbobin it.Switch the backend's filter so the capture group can produce an empty string:
In Shell 1, Ctrl-C and re-run the API-server command from 0e (
uv run infrahub server start --listen 0.0.0.0 --port 8000) so the newINFRAHUB_SECURITY_AUTO_CREATE_GROUPS_FILTERis picked up.bob. Login must succeed.CoreAccountGroupnamed""or whitespace; the offending claim is dropped silently from the user's perspective.GroupAutoCreateRejectedEventTypeevent.rejected_claim_valueholds the original verbatim claim (pad-), length-truncated.idp = "provider1",protocol = "oidc",triggering_user_nameequals bob's display name (the OIDCnameclaim —firstName + lastNameas set in the realm).name.valueexists.Restore the original filter (
'^(?P<name>(ops|data)-.*)$') and Ctrl-C → re-run the API-server command from 0e in Shell 1 before moving on.Scenario F —
originis read-only and unset on non-auto-created groupsoriginis omitted fromCoreAccountGroupUpdateInputandCoreAccountGroupCreateInput, so every external write attempt fails at GraphQL parse time.For an auto-created group from Scenario A (e.g.
ops-admins):UI: detail page → click the Extra button (eye icon) in the Details card header →
originrow appears as read-only with the eye indicator and no edit affordance.GraphQL update attempt as
admin(replace<id>with the group's UUID):Expect a parse-time error:
Field 'origin' is not defined by type 'CoreAccountGroupUpdateInput'.Re-read with Probe 2 —origin.valueis still"provider1".For a manually-created group:
GraphQL create attempt supplying
origin:Expect a parse-time error:
Field 'origin' is not defined by type 'CoreAccountGroupCreateInput'.Re-run without the
originfield — the create succeeds; re-read via Probe 2 —origin.valueisnull.For a pre-existing group (any row that existed before the upgrade — e.g.
Infrahub Users,Super Administrators):origin.valueisnull— no migration backfill ran.Scenario G — Default-group fallback (no auto-create events)
Set:
Restart the native API server (Ctrl-C in Shell 1, re-run
uv run infrahub server start --listen 0.0.0.0 --port 8000).Sign in as
alice(whose claims match nothing under^nope-.*$).Server logs show
auth_groups.default_group_fallback_applied.aliceis a member of the default group; no new groups are created on this login.Run Probe 1 — the event counts are unchanged from before this scenario. The fallback path emits no auto-create events.
Scenario H — Docs polish (PR #9340)
Build the docs site and confirm the new content renders.
/docs/deploy-manage/user-management/sso/advanced-sso→ the "Auto-create groups from identity provider claims" section is present and ready for review./docs/reference/infrahub-events/group→ all three auto-create event types are present with full payload tables.Scenario I — Activity-feed UI for the auto-create events
Frontend verification of how the three events render. Run after Scenarios A, D and E have produced created, capped and rejected events. Sign in as
adminand open the Activities tab at http://localhost:8080/activities.provider1) in bold — not the triggering user, who appears only in the event detail view. Confirm the wording:ops-adminspad-rejected (invalid group name)5reached, 7 claims droppedIdentity Provider,Protocol,Triggering User,Group Name,Group ID,Source PatternandOrigin. The rejected detail showsRejected Claim; the capped detail showsCap Value,Dropped CountandDropped Claims.MAX_PER_LOGIN=20soops-team-06…12are created fresh.ops-team-06) to open its detail window.provider1 auto-created group ops-team-06event listed there, and clicking it opens the same event detail from step 3.ops-admins/data-engineers, carol'sops-team-01…05) do not show the event in their Activities tab — the related node is only attached to newly emitted events.Cleanup
Unset the per-scenario / SSO envs:
unset INFRAHUB_SECURITY_AUTO_CREATE_GROUPS_FILTER \ INFRAHUB_SECURITY_AUTO_CREATE_GROUPS_MAX_PER_LOGIN \ INFRAHUB_SECURITY_SSO_USER_DEFAULT_GROUPCtrl-C the
infrahub server startandprefect worker startshells. The Vite dev server (Shell 3) holds no state and can be left running between sessions — Ctrl-C it only if you want the port back. Thenuv run invoke dev.stopto take the deps + Keycloak down (ordev.destroyto also wipe Neo4j/message-bus volumes).Existing auto-created groups remain on the next bring-up; lifecycle/cleanup is INFP-536 and out of scope here.
Summary by cubic
Expose
INFRAHUB_SECURITY_AUTO_CREATE_GROUPS_FILTER,INFRAHUB_SECURITY_AUTO_CREATE_GROUPS_MAX_PER_LOGIN, andINFRAHUB_OIDC_PROVIDER1_USERINFO_METHODindevelopment/docker-compose.ymlto enable end-to-end testing of auto-create groups in dev. Update the manual test plan atdev/specs/infp-556-auto-create-groups/test-plan.mdwith Keycloak setup, reusable GraphQL probes, scenarios (MVP, audit events, per-login cap, default-group fallback, read-onlyorigin), add activity-feed UI tests with explicit group-window navigation steps, and remove the deprecated idp/protocol event-filter probe; supports IFC-2522.Written for commit 9e69659. Summary will update on new commits. Review in cubic