feat(install): download the agent from the API endpoint, drop the proxy (VAPP-35) #50
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/vapp-35-repoint-download-to-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Repoints the agent-binary download in the enrollment flow straight at the API server's public download endpoint and removes this frontend's
/agent/<id>proxy, so the agent install path no longer transits the frontend (parent epic VS-54).Changes
get_group_installbuildsagent_urlas<server_url>/api/v1/agent/binary/<id>?token=<install-token>, whereserver_urlis the same authoritativeGroupServerhost the corrected.vagentalready uses (VS-55). It mints the scoped, expiring install token (VS-57) from the backend'sGET /agentbinaries/install-tokenover the operator's session, so the unattended device-sidecurl(which has novervain_session) is authorized./agent/{id}route and theagent_proxyhandler;maincollapses back to a plaindioxus::launchnow that no custom axum route is needed. Drops the helpers that only served the proxy (browser_host,browser_origin,cookie_value) and the deadcookie_valuetest.?in?token=.Coordination
Pairs with vervain-server #74 (VS-56) (the download endpoint) and #77 (VS-57) (the install-token mint +
?token=gate). The path string/api/v1/agent/binarymirrorsvervain-web'swire_paths::AGENT_BINARY_DOWNLOAD_PATH. Deploy together: the apps change references the server's wire contract.CORS / cross-origin
The admin "Download agent" button is a plain top-level
<a href>navigation, not afetch, so a cross-origin download fromapi.vervain.a8n.systemsis not CORS-gated; the install token authorizes it.Acceptance criteria
/agent/{id}route +agent_proxyremoved, no dangling references (clippy--features server -- -D warningsclean).Test
cargo clippy --all-targets --features server -- -D warningsclean,cargo check --target wasm32-unknown-unknownclean,cargo test --features server --bin vervain-appgreen (19 passed),cargo fmt --checkclean.The install snippet's agent-binary download now points straight at the API server's public endpoint (vervain-server VS-56, /api/v1/agent/binary/<id>), built from the same authoritative server_url the corrected GroupServer uses, instead of this frontend's /agent/<id> proxy. The agent install path no longer transits the frontend (parent VS-54). get_group_install mints a scoped, expiring install token (VS-57) from the backend's /agentbinaries/install-token over the operator's session and appends it as ?token=, so the unattended device-side curl - which carries no vervain_session - is authorized. The snippet single-quotes the URL so the shell does not glob the ?. Removes the /agent/{id} route and the agent_proxy handler, collapsing main back to a plain dioxus::launch now that no custom axum route is needed, plus the helpers that only served the proxy: browser_host, browser_origin, cookie_value, and the cookie_value test. The admin "Download agent" button is a plain top-level anchor navigation, so the cross-origin download from the API host is not CORS-gated; the install token authorizes it. #VAPP-35 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>