Repository navigation
[M2.3c4c1] Manage scoped resource role bindings - #91
Merged
Merged
Conversation
5 tasks done
samuelmbabhazi
force-pushed
the
feat/m2.3c4b-membership-commands
branch
from
November 5, 2026 14:50
e536f50 to
407dfb3
Compare
samuelmbabhazi
changed the base branch from
feat/m2.3c4b-membership-commands
to
main
November 5, 2026 14:51
samuelmbabhazi
force-pushed
the
feat/m2.3c4c1-resource-bindings
branch
from
November 5, 2026 14:52
90f1fb7 to
189c640
Compare
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
…ed scope (#92) ## Task M2.3c4c2, stacked on #91. This completes the application-layer M2.3c slice; HTTP authorization, project tokens and UI remain M2.3d/e/f. Review in order; no automatic merge. ## What changed and why Add the organization member directory and scope-authorized resource administration queries. Resource views distinguish organization authority, inherited project roles and direct environment overrides, including inactive members whose grants need cleanup. Project/environment administrators see only applicable authority; the full organization directory requires organization-level member management. Effective bindings and pagination use one SQL snapshot, avoiding inconsistent results when a grant changes between membership and relation queries. Queries select only administration metadata and reuse the existing bounded, descending-UUID pagination helper. CI also exposed an existing quota race: a later request could acquire the shared IP row before an earlier request, producing a spurious 429 even for quotas without progressive delay. Only progressive policies now check the next-allowed timestamp; count/window limits remain enforced. A PostgreSQL regression fails before the correction and passes afterward. ## How it was tested - All 196 real-PostgreSQL integration tests passed before the quota correction; the five authentication/quota tests pass afterward, including the new ordering regression. - Eleven targeted catalog/administration tests pass with 104 members, direct/inherited roles, explicit downgrades, scope denials, live changes and pooled-context cleanup. - New query/pagination application coverage: 100% statements/functions/lines, 95% branches. - API/web/domain lint, typechecks, tests and builds pass; Go tests and buf lint pass. - All eight Chromium/HTTPS/PostgreSQL browser scenarios pass after the quota correction. - Parent PR #91 passed all enabled CI/security and browser checks. CodeQL remains skipped by repository configuration. ## Security considerations The actor's current account version and scope authority are checked within the query transaction. SQL binds every value and includes organization/project/environment predicates before pagination. Results include email/active status only for authorized administration; no credential fields are queried. No new mutation, dependency, shell invocation or secret exposure path. ## Checklist - [x] M2.3c4c2 acceptance met; M2.3c marked complete in PLAN - [x] SPEC documents scope visibility and effective-role fields - [x] Full integration and local workspace checks pass - [x] Read-only queries add no state mutation requiring audit - [x] No secrets or generated artifacts edited manually ## CI execution blocked GitHub Actions did not start the latest jobs. Its annotation reports failed recent account payments or an insufficient spending limit. No runner steps executed. The account owner must resolve Billing & plans and rerun the workflows; this is not a passing CI result. CodeQL remains separately disabled by repository configuration.
5 tasks done
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 5, 2026
… enrollment errors (#109) ## Task Review follow-ups for #90, #91 and #102, plus two rule-audit items. Refs #22 ## What changed **No directory oracle (#90, #91)** - `AccountMutationAuthority.confirmPassword()` checks the caller's password without locks. - `MembershipCommands.add` and `BindingCommands.assign` call it before answering `resource_not_found` for an unknown address. An unknown account and a wrong password now give the same 401, so these commands cannot list the instance's verified accounts or an organization's members. The success path still pays one Argon2id verification. **Environment overrides (#91)** - An administrator of a single environment can no longer create or remove an environment override for a member who administers the whole project. Before, the project admin could not undo such a restriction. - Project admins and organization owners/admins are unaffected. **Explicit response fields (#102)** - `resourceDto` spread whole store rows into responses. It is replaced by `organizationDto`, `projectDto`, `environmentDto`, `memberViewDto` and `bindingViewDto`, which list every field. A future column cannot reach session or bearer clients without a DTO change. - The HTTP test asserts the exact key sets for project and environment details. **Rule audit items** - The agent's enrollment error keeps its gRPC code (wrapped with `%w`) and still drops the remote text. Its test fails without the fix (`Unknown`). - An `eslint-disable` gains its justification. - SPEC: directory lookup ordering, the environment-override rule (section 7), and bearer status codes (401 for bad tokens or token-less routes, 403 for scope gaps checked before any lookup, so nothing leaks). ## How it was tested - Local gate on the branch: lint, typecheck, unit tests and build for all projects; go vet, go test and golangci-lint; no generated-code drift; Semgrep and Prettier. - New integration tests: same 401 for unknown and existing accounts on membership add and binding assign; environment admin refused on a project admin, owner allowed. - CI is unavailable (account spending limit), so integration tests did not run. ## Checklist - [x] Local gate passes - [x] Tests added - [x] No new shell invocation and no new secret exposure path - [x] Audit events unchanged (refused commands write nothing) - [x] SPEC updated
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.
Task
M2.3c4c1, stacked on #90. Review in order; no automatic merge.
What changed and why
Add audited project/environment role assignment and removal with fresh password/MFA proof and ordered actor/subject locks. Assignment resolves only an exact existing organization member by email after scope authorization; it cannot add organization membership or grant ownership. New/changed bindings require an active verified member. Removal also works for disabled or subsequently promoted accounts.
Live scope checks honor explicit environment downgrades: a project administrator downgraded in an environment cannot remove that restriction themselves. Removing an override can restore inherited rights, so removal invalidates credentials just like assignment. Self-changes return a rotated session; unchanged/absent grants preserve credential versions and audit proof confirmation.
How it was tested
Security considerations
Scope administrators do not receive a global account directory. Resource ancestry and membership are rechecked under account/organization locks before writing. Binding updates cannot change their tenant, parent resource or membership. Audits and credential invalidation commit together. No new dependency, shell invocation or credential exposure path. CodeQL remains skipped by repository configuration.
Checklist