feat(server): self-contained enrollment bundle + one-time fetch endpoint; drop legacy .vagent minting #89
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/VS-69-enroll-bundle-fetch"
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?
Stamp the agent mTLS
domaininto the enrollment bundle and add a single-use bundle-fetch endpoint so a headless host can fetch-and-install in one line (VS-69).New config
VERVAIN_AGENT_PUBLIC_DOMAIN(host:port) names the externally reachable agent mTLS endpoint, distinct fromVERVAIN_BASE_URL(the browser/Traefik 443 host) because the mTLS port is dialed directly. Precedence issettings.agent_public_domain-> env -> derived from the public host plus the agent bind port;read_agent_public_domainreturnsNoneonly when nothing is set and no host can be derived, and the mint refuses rather than ship a domain-less bundle.POST /api/v1/enroll-tokensnow returns the fullbootstrap.json(withdomain) inline plus a one-timebundle_token, and stores the bundle keyed by the SHA-256 hash of that token.GET /api/v1/enroll-bundle?token=returns the stored bundle once and consumes it atomically: valid -> 200, unknown/empty token -> 401, already-used or expired -> 410. The endpoint is unauthenticated (the target host has no session) but per-IP rate-limited (reusing the token-bucket limiter, nowIpRateLimiter) and single-use. Only the token hash is stored, so a DB leak yields no usable token and there is no constant-time-compare obligation. New DB schema v3 adds theenroll_bundlestable withinsert_enroll_bundle/consume_enroll_bundle.Delete the legacy
.vagent/GroupServerminting: removedgroupsettings.rs, its module declaration, and the/groupsettings+/groupsettings.ashxroutes (root and per-domain). A guard test asserts those routes now 404 and mint no.vagentbody, so the removal is enforced mechanically.#VS-69