Repository navigation
Add organization members and Keycloak sync functions - #21
Merged
Merged
Conversation
Regenerate from PDC 0.43.0, which adds the Keycloak identity, disabledAt, members, and formerMembers to Organization and a GET /organizations bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PDC fills its user and organization cache only through POST /users/sync and /organizations/sync, which need a token with the kc-admin-api scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kc-admin-api scope belongs in the realm (PDC's realm.json and its Keycloak checklist), not in runtime setup. The sync integration test skips until Keycloak offers the scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KeycloakAdmin.set_user_enabled lets the sync integration test disable a member and see PDC mark them disabled. The get_organizations test now checks the synced organization appears instead of only parsing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The grantee validator rejected any type it didn't name, so a grant to all funders failed to parse. It now reads the keys each type requires from one table, treats every other type as keyless, and its tests cover every PermissionGrantGranteeType. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The grantee tests derived expected keys from the validator's own table, so a wrong entry passed. They now state the keyed types literally and still cover every other type as keyless. AGENTS.md says to parametrize over enums but write expectations as literals. Drop the reference verb from the changelog; it was already supported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Grantee-key and sync-status tests now list an expected outcome for every enum member, parametrize over that list, and assert it covers the enum. A new member such as allChangemakers fails one named test until someone records how it behaves. AGENTS.md states the pattern. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PDC's realm.json lacks the kc-admin-api scope, so the sync integration test skipped. just/patch_realm.py adds the scope and organization roles from the pending service realm change, and warns once upstream defines it. CI now starts the stack with `just pdc up` so it gets the patch too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
This brings us up to date with 0.43.0, which pulled in two big changes: an |
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.
Regenerates the client from PDC 0.43.0, so
Organizationcarries its Keycloak identity,disabled_at,members, andformer_members, and adds functions to run PDC's Keycloak sync, which is the only way PDC fills that membership data.Changes
_generated.pyrefreshed. Codegen also picked up the sync task models and theallFundersgrantee type. Breaking:Organization.keycloak_organization_idis now required.get_organizationswalks the organizations bundle.sync_users_from_keycloakandsync_organizations_from_keycloakstart a sync task and poll it, raisingKeycloakSyncErroron failure or timeout.KeycloakClientCredentialsProvidertakes an optionalscope, since the sync endpoints requirekc-admin-api.KeycloakAdmin.set_user_enabledenables or disables a Keycloak user.pdc_api.testingaddsuser_payload, andorganization_payloadsends the new fields.allFundersgrantee type. The validator reads each type's required key from one table and treats every other type as keyless. The tests list the expected keys for every grantee type and fail by name when the enum gains one they don't list, asallChangemakerswill.scope, andset_user_enabled. AGENTS.md asks tests to list an expected outcome for every enum member and assert that list covers the enum; Fail by name when the spec adds a grant context or input type #22 tracks the existing tests that still list them.Notes
PDC's realm doesn't offer the
kc-admin-apiscope the sync endpoints need (Keycloak 26.8.2 creates it for new and migrated realms, not imported ones). Until service'srealm.jsondefines it,just/patch_realm.pyadds it to the downloaded realm, along with the organization roles thepdc-admingroup needs, and warns once upstream defines it so we know to delete the script. CI now starts the stack withjust pdc up, so it gets the patch too, and the sync integration test runs instead of skipping.membersisNoneboth when the caller can't see membership and when PDC hasn't synced the org yet.🤖 Generated with Claude Code