feat(admin): /admin config surface (API + control plane)#2081
Draft
nicoloboschi wants to merge 1 commit into
Draft
feat(admin): /admin config surface (API + control plane)#2081nicoloboschi wants to merge 1 commit into
nicoloboschi wants to merge 1 commit into
Conversation
Server-level admin surface, gated by HINDSIGHT_API_ENABLE_ADMIN_API with an optional, independent HINDSIGHT_API_ADMIN_TOKEN: - API: GET /admin/config returns the resolved HindsightConfig with credentials redacted (set -> "***", unset -> null) via the credential denylist plus a name-suffix heuristic; features.admin_api exposed on /version. - Control plane: top-level /admin page reusing the shared (now data-driven) Sidebar with a single "Configuration" item + a dedicated AdminHeader; server proxy forwards an independent HINDSIGHT_CP_ADMIN_TOKEN to /admin/*. - Regenerated OpenAPI spec + Python/TS/Go clients; docs + .env.example; admin i18n across all locales. Groundwork for the visibility leg of #2034. The connectivity test + health surfacing land separately as a per-bank health endpoint.
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
Adds a server-level admin surface at
/admin(API + control plane), gated byHINDSIGHT_API_ENABLE_ADMIN_API(off by default) with an optional, independentHINDSIGHT_API_ADMIN_TOKEN. First capability: a read-only, redacted view of the resolved server-level configuration.This is the visibility leg of #2034 (server-level config was previously invisible in the Control Plane). The higher-value parts of #2034 — a connectivity test and health surfacing — are intentionally not in this PR; they land as a separate per-bank health endpoint (see #747), since LLM config is hierarchical and a probe belongs at bank altitude.
What's included
API
GET /admin/config→ resolvedHindsightConfigwith credentials redacted ("***"when set,nullwhen unset). Redaction = credential denylist ∪ name-suffix heuristic.require_adminguard: 404 when disabled, 401 when a token is configured and missing/wrong (hmac.compare_digest), open when no token.features.admin_apion/version.config.py(enable_admin_api,admin_api_token; the token is itself a credential field).Control plane
/adminpage reusing the shared (now data-driven)Sidebarwith a single Configuration item + a dedicatedAdminHeader(no bank chrome)./api/admin/configforwarding an independentHINDSIGHT_CP_ADMIN_TOKEN.admin_apifeature flag; admin i18n across all 10 locales.Generated / docs
configuration.md,.env.example.Tests
tests/test_admin_api.py— disabled→404, enabled→200, token enforcement, credential redaction (incl. provider keys that fall back to the LLM key),/versionflag.Known follow-ups (deliberately out of scope)
Draft until
/code-reviewis run and the redaction guard decision is made.