Repository navigation
[M2.3f1b2] Web: members and roles - #185
Merged
Merged
Conversation
Signed-off-by: review <[email protected]>
4 tasks done
samuelmbabhazi
added a commit
that referenced
this pull request
Nov 7, 2026
## What changed - **Scope picker in the token form.** Until now every token created in the UI got `profile.read` only, so it could do nothing else. The form now offers: profile only (default), or an organization, optionally narrowed to a project and an environment, with permissions ticked one by one. Nothing is granted until it is ticked, and creating a token with no permission is refused. - **Tie to a project.** With a project chosen, a token can be bound to it. - **Project token panel** on the project page: tokens tied to the project, with revocation. - **Panels hide on refusal.** The access panel (#185) and the new token panel render nothing when the API answers 403 or 404. Before, a project viewer saw an error and a form they could not use. - **Token list** says what each scope reaches. ## Why PLAN M2.3f1b3, the last part of M2.3f1. ## How it was tested - `token-scope-picker.spec.ts`: default grant, nothing granted until ticked, narrowing drops permissions the level no longer offers, binding only on request and cleared with the project, everything cleared on an organization change, profile only when organizations cannot load. - `token-form-store.spec.ts`: the grant and project reach the request, and an empty grant sends nothing. - `access.spec.ts`: listing and revoking project tokens, and hiding panels on 404. Local gate only (CI off). Not exercised in a real browser or against a running API, so the API's acceptance of these scope shapes rests on reading `parseApiScopes`, not on a run. ## Security considerations - Least privilege by default: no permission is preselected. - The picker offers only permissions a bearer token can use on a route today, at a level where they can match: `audit.read` on one project would grant nothing, so it is not offered. `member.manage` stays out because those routes are session only. - **That list is a hand-kept copy of `docs/generated/route-role-matrix.md`**, and no test ties them together. A new bearer route needs an entry here. A stale list only hides an option; it cannot widen access. - The API still verifies every scope against the owner's live authority at creation and on each use. The token secret keeps the existing show-once handling. ## Checklist - [x] Tests, including refusals - [x] No new shell invocation, no new secret exposure path - [x] Audit events already emitted by the API routes - [x] PLAN updated Signed-off-by: review <[email protected]> Co-authored-by: review <[email protected]>
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.
What changed
/orgs/:id/members): list, add an existing account, change a role, remove.ReauthForm: the shared password and code form these commands need. It is reusable and clears credentials. A six-digit value is sent astotp, a 32-hex one asrecovery.PagedList: a cursor list that keeps what is shown when extending fails and drops stale answers.Why
PLAN M2.3f1b2. The membership and binding routes existed (M2.3d4b, M2.3d4c) without screens.
How it was tested
Web tests in
access.spec.ts, through the real routes with a stubbed fetch:viewer.Local gate only (CI off). Not exercised in a real browser or against a running API. Integration tests of the underlying routes predate this PR.
Security considerations
No new route. Every command still needs the password and second factor the API already demands; the API remains the authority for permissions, ordered locks and the last-owner rule. Passwords stay in the form only until the request succeeds.
MutationRunnerkeeps retry snapshots in private fields, and the form is destroyed with the component. A self role change rotates credentials through cookies only, whichbrowserRequestreads on each call, so nothing extra is stored.The UI offers these actions to everyone who can open the page, since the API exposes no effective permissions to it yet. A member without rights gets the API's refusal.
Checklist