Skip to content

fix(api): /v3/groups/manages parses list-format roles + cleanup stale app contracts - #577

Merged
jacoby149 merged 3 commits into
devfrom
fix/groups-manages-roles-list-format
Aug 12, 2026
Merged

fix(api): /v3/groups/manages parses list-format roles + cleanup stale app contracts#577
jacoby149 merged 3 commits into
devfrom
fix/groups-manages-roles-list-format

Conversation

@jacoby149

Copy link
Copy Markdown
Owner

Two bugs fixed:

1. Groups not showing under 'Manage' tabget_groups_manages expected roles stored as a dict ({"admin": {"permissions": [...]}}) but all groups store roles as a list ([{"name": "owner", "permissions": [...]}]). The .get(my_role) call silently returned {} on lists, so no groups ever matched. Now parses both formats with backward compat.

2. Stale app contracts — Added /v3/app-contracts/cleanup endpoint to tombstone contracts where allowed_origin is a service name (like web10-docs-hello-demo) instead of a URL. Call POST /v3/app-contracts/cleanup once to clean up your contracts list.

320 tests pass (1 pre-existing failure unrelated).

… app contracts

get_groups_manages expected roles as a dict but all groups store roles as a list of {name, services, permissions}. Now parses both formats with backward compat.

Also added /v3/app-contracts/cleanup endpoint to tombstone stale contracts where allowed_origin is a service name instead of a URL.
@jacoby149
jacoby149 force-pushed the fix/groups-manages-roles-list-format branch from 9c1dffc to 77912a2 Compare August 12, 2026 05:45
Apps cannot directly create or revoke app contracts — they must go through
the popup consent flow. The /add and /revoke endpoints now check the Origin
header against CORS_SERVICE_MANAGERS (auth.localhost, auth.dev.web10.app,
auth.web10.app). Non-authenticator origins get 403.
@jacoby149
jacoby149 force-pushed the fix/groups-manages-roles-list-format branch from 846e7f6 to 2e3c654 Compare August 12, 2026 06:05
SDK: contractOnReady sends both ACR and GCR in one postMessage.
Authenticator: pendingContracts holds both types, normalizeContracts
parses ACR (allowed_origin+permissions) and GCR (app_origin+action+params).
ConsentView: shows both types with distinct badges (access request /
group request), GCR rows show action+group name+join policy.
approveContract handles ACR (applyACR) and GCR (applyGCR → create group).
approveAll handles both types. Legacy aliases kept for backward compat.
Demos: stripped ensureAppContract — contracts now only created by
authenticator after user consent.
@jacoby149
jacoby149 force-pushed the fix/groups-manages-roles-list-format branch from 2e3c654 to 44ca587 Compare August 12, 2026 06:06
@jacoby149
jacoby149 merged commit 515513b into dev Aug 12, 2026
13 checks passed
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