Repository navigation
feat(apps): deliver proxy host lifecycle events to covered apps - #603
Merged
Merged
Conversation
The Owner can approve all proxy hosts instead of selected ones for reading and probing. The grant uses the allProxyHosts scope with the resource "all" and also covers hosts created later. The core lets it cover a requested proxyHosts scope only for read and probe, refuses approvals that mix it with selected hosts, and the web authority accepts it only there. Managing owned hosts cannot use it. The host listing now returns the enabled state, all domains, an upstream summary with targets and the failover pool, and a probe revision derived from the host monitoring availability revision. It never returns certificates, access policies, trusted CA material or other secrets. The approval dialog offers "All proxy hosts" for read and probe. Refs #591 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The runtime context listed a grant for all proxy hosts with its allProxyHosts scope, which an authorization request cannot take. It now reports the proxyHosts scope that the grant covers, the form authorization requests use. Set up the listing test fixtures inside the cleanup block, and declare managing owned hosts there so that only the scope refuses it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every platform write path now records exactly one event per change for each installation whose published read or probe grant covers the host, in the transaction that makes the change: proxyHostCreated, proxyHostUpdated, proxyHostEnabled, proxyHostDisabled and proxyHostRemoved. A save that changes nothing records nothing. The central create, update and delete helpers record the events, so the host form, Docker discovery, imports, certificate job creation and app-owned hosts are covered. The paths that write hosts directly do too: enable and disable, bulk actions, certificate job requests and bindings, certificate deletion and trusted CA replacement, which changes the probe revision of the hosts that verify against it. An app that changes its own host through an owned-host operation keeps receiving only its operation event. Replay lets a grant for all proxy hosts see the events of every host. The event log writes live in event-log.server.ts, so admin write paths record events without loading the runtime authority. Refs #591 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
5 of 13 tasks
5 of 13 tasks
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
PR 2 of 2 for #591, stacked on #601. It replaces #602, whose history held a test UUID that Gitleaks flags as a key. Apps now receive durable host lifecycle events for changes from every platform write path, on the existing event stream with cursors.
Events (
server/AppRuntime/host-events.server.ts)proxyHostCreated,proxyHostUpdated,proxyHostEnabled,proxyHostDisabledandproxyHostRemoved, with the platform host ID asresourceId.recordProxyHostEventsInTransactionruns in the transaction that makes the change. For every installation whose published read or probe grant covers the host, it records one event per change, so an event exists exactly when the change commits.proxyHostChangedecides the event type from the stored settings before and after:proxyHostUpdatedwhen anything the listing reflects besides the enabled state changed;Write paths
proxyHostChanged/proxyHostRemoved), never a second one for the same change.Replay
Related issue
Closes #591 together with #601 (merge #601 first).
Refs RentnerProxy/app-monitoring#1
Type of change
Testing
bun run typecheckandbun run lintare clean; the changed files are formatted.test:tson Windows: 2272 passed. The 41 failures are thetests/toolingDocker, release and backup script tests that fail the same way onmainin this environment; CI runs them on Linux.host-events.test.ts: a save without a change records nothing; an enabled transition alone is reported as such; any other change, also with an enabled transition, is one update.proxy-hosts.db.test.ts: the host form records the following events, in this order, for an app with all proxy hosts: create, an unchanged save (no event), an update, disable, enable, a bulk disable, delete. An app with a per-host probe grant gets the changes after its grant, and an app without one gets nothing. Replay from a cursor continues after it without repeating an event.trusted-cas.db.test.ts: replacing a CA records one update for the host that verifies against it, and none for the other host.certificates.db.test.ts: deleting a certificate records one update for each detached proxy host.certificate-jobs-worker.db.test.ts: binding an issued certificate records one update.host-events.db.test.ts: the acting installation is left out; read wins over probe with one event per change and app; a rolled-back change leaves no event.host-operations.db.test.ts,proxy-host-listing.db.test.ts,authority.db.test.tsandcertificate-jobs-creation.db.test.tsstill pass.Checklist
Breaking changes
None. Apps without a read or probe grant see no new events.
🤖 Generated with Claude Code