Add live-reservation router add/remove/replace (ADR-0008) - #63
Draft
struanb wants to merge 2 commits into
Draft
Conversation
Lets a permission-holding developer add/remove/replace routers on a live reservation, gated by new addContainerRouter/removeContainerRouter role permissions, can_on(develop) standing, and a profile-level userRouters opt-in for add (bypassed by default for admins). Server API + CLI only; Vue UI is designed but not yet built (see the ADR). Reservation::Mutate stays a dumb data-mutation layer: it validates that an already-resolved auth allow-list and initial access level are mutually consistent, but decides neither. User.pm resolves both - defaulting the initial access level to 'owner' if the caller owns the reservation, else 'developer' (falling back to the auth list's first entry if that preference isn't permitted), overridable via an explicit --access; the auth list defaults to every known level unless narrowed via --auth (comma-separated and/or repeatable). See docs/adr/0008-router-mutation.md for the full design and alternatives considered. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zoMS7ycYeL4kHsztZ29yy
cli/README.md gets a new "Router management" section (list/add/replace/remove, --auth, --access) alongside the existing user/role/profile sections; usage.md gets a short cross-reference noting that adding/removing a devtainer's routers is CLI-only for now, since the UI doesn't have this yet. ADR-0008's Status line and Consequences section dropped their "Vue UI not yet built" framing - an ADR records the architecture decision, not a snapshot of what's shipped, since the UI's build/ship order is a separate call that may change independently of anything decided here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012zoMS7ycYeL4kHsztZ29yy
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.
Summary
Lets a permission-holding developer add/remove/replace routers on a live reservation
(previously frozen at launch), gated by two new role permissions and a profile-level opt-in:
addContainerRouter,removeContainerRouter.can_on(develop)(owner unconditionally, or a named developer).Profile.userRouters(off by default; bypassed bydefault for
role='admin').type=user; removal doesn't depend on that stamp - anyrouter (admin-authored or self-added) is removable once permission + standing hold, except the
auto-injected
ide/sshrouters, which can never be removed through this feature.meta.accessvalue defaults to'owner'if the caller owns the reservation, else'developer'(falling back to the allowed-levels list's first entry if that preference isn'tpermitted) - overridable per-call via
--access. The allowed-levels list itself defaults toevery known level unless narrowed via
--auth(comma-separated and/or repeatable).gatewayMode(deprecated) makesaddfail closed outright.Full design, rationale, and alternatives considered:
docs/adr/0008-router-mutation.md.Scope: server API + CLI only. The Vue UI surface (devtainer edit-state controls, admin
permission-screen entries) is designed but not yet built - opening as draft for that reason, and
so review can land on the API/CLI shape first.
Testing
./test.sh(full static suite): all green.t/integration/tests/04_access_and_http.pySection F (41 tests): permission/standing/profile-gate denial and admin bypass,
type=user+ default-access-level correctness (owner-adds vsdeveloper-adds), duplicate-name collision,
ide-type hard-block, removal by a non-creatorshared developer, replace carrying (or correctly not carrying) access forward,
--auth/--accessinteraction including comma-separated and repeated-flag forms, and genuine live-HTTPreachability of an admin-added router against the already-running test nginx container. All
passing live against a running instance.
🤖 Generated with Claude Code
https://claude.ai/code/session_012zoMS7ycYeL4kHsztZ29yy