Repository navigation
Spec: the Console API, /api/v1 behind scoped tokens - #1777
Merged
Merged
Conversation
Console API: serve read views as CLI JSON under /api/v1
Publish the Console API's generated OpenAPI description
A read token could load Security finding titles, severities and advisory URLs from history, status and peek, and could read a Security session trace. Those records stay available to a caller that has the security scope.
Reconcile OpenAPI discovery with bearer scopes and whoami, preserving route parity, compact help and documentation for both branches. Validation: formatting, all-target Clippy, 62 site tests, 126 Console browser tests and 42 focused route/API/token/help tests passed. The full affected-test run stopped after 760 passes on an already-loaded systemd transient scope; its exact merge_run retry passed.
Console API: tokens, bearer authentication and whoami
…ures (#1758) Apache appends the client it saw onto the first X-Forwarded-For header and leaves a later duplicate unchanged. Count failures against that first header.
Limit failed Console tokens and passwords per client address
Preserve scoped API actions, mutation auditing and routed CSRF checks while integrating the upstream per-address authentication failure limiter. Combine both branches' Console documentation and regenerate the user manual. Validation: - cargo fmt --check passed. - cargo clippy --all-targets --locked -- -D warnings passed. - scripts/affected-tests origin/issue-1753: 62 site tests and 126 Console browser tests passed; the locked build passed. - Full Rust attempt: 1552 passed, 1 failed, 82 skipped, 2222 not run after systemd refused an already-loaded transient scope in a Scoring fixture. The exact failing Scoring test passed immediately when rerun alone.
Console API: scoped actions and mutation auditing
A session with Act and without security could read finding records from the Stop confirmation page. Peek already refuses that view. Stop itself still requires only Act.
Enforce Console account scopes and named-person token requests
A read token could open an ordinary Command's span and waterfall routes and receive a Security session prompt. Those routes now skip Security session files, as the log routes already do, and the regression test keeps the ordinary session visible.
JacobStephens2
marked this pull request as ready for review
November 6, 2026 01:57
This was referenced Nov 6, 2026
Merged
Closed
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
Each Console now serves
/api/v1for the views and actions it already offers. The page remains server-rendered; CLI, page and API use shared handlers and CLI JSON values.read, expiry, last use and immediate revocation. Bearer transport requires HTTPS or a direct connection to 127.0.0.1; failed tokens/passwords share per-address limiting.securityprotects Security run details; Other-account Commands remain read-only.runandadminare reserved for Spec C; token management and address permissions remain CLI-only.whoamiand generated OpenAPI; documents the API in the guide and site.This whole-Spec review fixed missing Theme import/look reads, read-token access to retained logs without Command records, duplicated scope parsing and the manual's unrestricted-session claim.
Evidence
Execution evidence
Test seams: the binary's CLI and Console HTTP interface over fixture Command records; the route table's CLI/OpenAPI parity checks; browser sign-in and scoped page controls.
cargo test --test console api::theme_import_is_available_through_the_versioned_api -- --exactBefore: failed with
left: 404, right: 200. After:1 passed; 0 failed.cargo test --test console api::existing_look_read_has_its_declared_api_route -- --exactBefore: failed with
left: 404, right: 200. After:1 passed; 0 failed.cargo test --test console api::read_token_can_read_an_ordinary_log_without_a_command_record -- --exactBefore: failed with
left: 422, right: 200. After:1 passed; 0 failed.cargo test --test console api::read_token_can_list_available_themes_without_changing_the_console -- --exactBefore: failed with
left: 405, right: 200. After:1 passed; 0 failed.The import regression also checks custom Theme persistence, missing
act, invalid Theme documents and Console-log attribution. The route-parity guard now accounts for shared GET/POST API paths, retaining its negative checks for extra or undocumented routes.NEXTEST_TEST_THREADS=3 CARGO_BUILD_JOBS=2 scripts/affected-tests main: site 62/62 and Console browser 127/127 passed. Rust stopped after 1,031 passes on an unchanged Pickup fixture test; its exact isolated rerun passed.cargo test --bin thirdshift console::tests -- --test-threads=3: 10 passed, including the negative route/OpenAPI parity checks.cargo fmt --checkandcargo clippy --all-targets -- -D warnings: passed.Exact resumed command and isolated reruns
The last four commands each returned
1 passed; 0 failed. The affected tests and scope implementation are unchanged by this Spec; full logs are retained in.affected-tests/.Visual evidence
Captured and inspected the same fixture Inbox at 1440×900 and 390×844, before on
mainand after with a read-only session. Restricted sessions hide Security navigation, Dismiss, Themes and section controls. PNG pairs are retained beside this Session's review reports. They are not published because this Session forbids pushing, including the skill's git-pushed Gist workflow.Review coverage
Standards: 2 findings, both fixed. Spec: 2 findings, both fixed. Each reviewer read all 78 changed files, including generated
site/docs/index.html, and reviewed the nine-file fix delta. No changed file was left unread; no generated-output exclusions. Reports andsummary.jsonare retained with the Session trace.Merge Danger
Door: two-way
The binary and scoped configuration can be rolled back; no destructive data migration.
Blast Radius: Console
Console readers, authenticated actions, token/account authorization and audit records.
Unaddressed findings
Standards
None. Both findings were addressed.
Spec
None. Both findings were reproduced and addressed.
Security
None. The introduced finding was reproduced with a failing proof-of-concept and fixed: a read token received a Security session prompt from the span and waterfall routes of an ordinary Command. The test failed before the change and passes after it.
Closes #1753
Built with codex codex-cli 0.164.0 · gpt-6.1-sol · xhigh
Security review outcome
No unaddressed introduced findings.
Tickets