Repository navigation
Require target-group membership to create an app from every entry - #38
Merged
Merged
Conversation
…ntry A user outside every group could not use the AI entry but could pick any group in the template wizard and create an app there, because POST /api/console/apps and the wizard only checked that the group existed. Every creation entry (AI, templates, existing code, image, Excel) now offers only the caller's effective groups (direct membership plus descendants), and a user with no group sees the existing guidance with every entry disabled. POST /api/console/apps requires the same membership as build sessions, with no Console-admin exception. Moving an existing app (PATCH) is unchanged (APT-1151). The development mocks apply the production rules. APT-1128
…t app outside the user's groups
Security review follow-ups for APT-1128:
- POST /api/console/apps and the first POST /api/console/apps/{id}/bind of an
unbound record resolve fresh Directory membership, so a user removed from a group
cannot create or bind into it on a cached view. Already-bound records keep 409.
- Resuming a wizard whose kept app sits in a group the user has left is blocked
instead of moving the app.
- The mocks authorize a build-session group before an idempotent replay and return
production's error for an unknown create group.
APT-1128
The mock bind route now requires membership of an unbound app's current group, with production's 400 body and no Console-admin exception, and keeps production's 409 for an already-bound app. APT-1128
Contributor
Author
|
Merging on the owner's decision (2026-11-16, relayed by the PO lead): APT-1128 creation rule. Head |
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.
朝の 5 行(森さん向け)
d1002c5454)は「マージしてよい。後続つき」(後続: mock の bind の入力の形の検査が本番と違う。P3、本番の権限には関係しない)。全文はpo/lead-2026-11-14/reviews/builder-console-apt1128-review.md。What
On Console 0.5.9/0.5.10 a Project Editor who belongs to no Console group could not use the AI entry but could pick any group in the template wizard and create an app there:
POST /api/console/appsand the wizard only checked that the group existed. Owner decision (APT-1128): creation from every entry requires membership of the target group, with no Console-admin exception; the AI build-session path already enforced exactly this (cmd/server/internal/store/build_sessions.go).Change
Server (
cmd/server/internal/api):POST /api/console/appsand the firstPOST /api/console/apps/{id}/bindof an unbound record require the target (resp. current) group to be in the caller's effective groups (direct + descendants), resolved freshly from Directory per request (not the 60s cached view). Rejection: existing 400groupId must be one of your directory groups. Already-bound records keep 409. Directory unavailable -> 503console_link_unavailable.PATCH(moving an existing app) is unchanged; tracked as APT-1151.Web (
web/src):?group=/ current group is used only when it is one of them. A user with no group sees the existing guidance and every entry (including Excel and direct entry URLs) is disabled before any draft, app or session is created.Verification
go test -count=1 ./cmd/server/...with the PostgreSQL integration DB,go vet,gofmt.typecheck,typecheck:e2e,check:response-boundaries,check:console-schema,bun test src, and 10 mock e2e story files (34 stories, incl. newapp-create-group-rule.mock.spec.ts).d1002c5454— Go tests/vet and the full web set (2073 unit tests, 34 mock stories) passed on the committed content; typecheck, typecheck:e2e, response-boundaries, console-schema and the touched unit files (184 tests) re-run ond1002c5454itself (results in the PR comment).Not verified on a live estate yet (will be checked on ink as part of the 0.5.11 candidate).
Follow-ups: mock bind body validation parity (P3); APT-1151 (move rule).
APT-1128