Conversation
This was referenced Sep 13, 2026
Open
Contributor
Author
|
@MrAlders0n please review this change with your Claude agent as part of the September 13 Beacon review batch. The current candidate is Early review is requested on the config-only delta linked in the description. Keep this draft until prerequisite #146 is merged and the branch is rebased. Please check secret exclusion and agreement with effective CORS settings. Issue #60 remains open for the remaining scope. |
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 this PR does
Add protected
GET /api/v1/admin/configas the first read-only slice of #60. It reports selected startup settings: CORS options with Beacon defaults applied, whether auth is configured, and the number of configured broker workers. It never serializes the full Config/environment or exposes credential fields, broker addresses, channel material or internal paths. The CORS lists are copied at router construction and use the same resolved values passed to the middleware.Depends on #146; merge auth first. This draft reuses that PR's exact commit as its parent. Review the config-only diff; the full dev diff includes the pending auth prerequisite. It will be rebased to the accepted auth baseline before leaving draft.
Missing config still disables admin access with 503; invalid credentials return 401. Valid credentials can read this endpoint with
Cache-Control: no-store. Public routes and CORS preflights remain unchanged. Configuration writes/account operations stay in later slices of #60;broker_countis an actual configured-broker count, not the proposed but nonexistent tunableworker_countsetting. Swagger describes this operation's required Authorization header without adding global authentication to public endpoints.Type of change
Checklist
go build ./...passesgofmt -l .is emptygo vet ./...passesgo test ./...passesTesting notes
Local and native Pi full Go checks and focused Windows router/middleware race checks pass. Tests cover default/custom options, an exact response-field whitelist, credential omission, caller-slice mutation, stable repeated reads, denied requests, rejected writes, all existing admin-auth paths/methods and public CORS behavior. Native PostgreSQL integration tests ran without skipping. CI and CodeQL pass.
The exact combined ARM64 binary returned the expected configuration whitelist with a temporary private key; missing/wrong/duplicate/query/form credentials were rejected, and the key was absent from logs. That temporary instance used an isolated database and no live MQTT; its container/key file were removed. The Canadaverse preview includes this draft with prior candidates and matching corresponding source. Public admin access remains deliberately disabled; both feeds, public REST/CORS and WebSocket checks pass. The preceding server/web pair remains available for rollback.
AI-assisted implementation and testing under the contributor's standing authorization; no separate human review of this final diff is claimed.