Conversation
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 focused delta linked in the description. Keep this draft until #146/#147 are accepted and the branch is rebased. Please check atomic CORS enforcement/reporting, rejected updates and restart reset. Issue #60 remains open for remaining configuration 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
PUT /api/v1/admin/configforcors.allowed_origins, the supported runtime-config slice of #60. A valid request replaces the whole list and publishes a rebuilt CORS handler together with the reported settings. Policies are immutable; concurrent updates are applied one at a time, and in-flight requests may finish under the old policy. GET reflects the current settings.Updates are runtime-only: no file/database write, no restart needed, and restart reloads saved configuration. Responses explicitly return
persisted: falseandrequires_restart: false. Invalid/unauthorized input changes nothing. Other CORS options, auth/credential fields and broker count remain unwritable; this does not invent a configurableingest.worker_count.Dependent draft on #146/#147. The branch starts at #147's exact commit; review the focused delta. It does not require the account PRs. Rebase onto accepted prerequisites before leaving draft.
Type of change
Checklist
Testing notes
Local and native Pi full checks, CI/CodeQL and focused Windows race tests pass. Tests cover required bounded JSON, unknown/immutable fields, invalid origins, origin normalization, unauthorized updates, unchanged state after errors, actual old/new preflight behavior, copied inputs/results, preserved exposed headers/options, concurrent requests/updates and reset on construction from saved settings. The request path loads the current policy; handlers are rebuilt only for updates.
A private instance of the exact combined binary changed real CORS enforcement and GET results together, retained Retry-After exposure, rejected unsupported updates without changing state, and restored saved defaults after an actual container restart. The key was absent from logs; the private instance/key file were removed without live MQTT. The preview includes this draft with account/rate-limit candidates, matching source, public APIs/WebSockets and advancing feeds. Its admin access remains disabled and its saved config/schema are unchanged.
AI-assisted implementation/testing uses the contributor's standing authorization without claiming a new specific human diff review.