Skip to content

Per-site HTTP basic auth (agent and control plane) - #24

Open
techgopal wants to merge 4 commits into
mainfrom
site-basic-auth
Open

techgopal wants to merge 4 commits into
mainfrom
site-basic-auth

Conversation

@techgopal

Copy link
Copy Markdown
Contributor

Adds HTTP basic auth in front of one site, enforced by Caddy.

  • Agent (sonnet-3, a45ef5c): SetRoute carries an optional bcrypt user/hash; the route gets Caddy's http_basic handler.
  • Control plane: table site_basic_auth (migration 0005, also adds the route_update job kind); GET/PUT/DELETE /api/v1/sites/{id}/basic-auth; the password is bcrypt-hashed (cost 12) on the blocking pool and never stored, returned or logged; a change enqueues a route_update job that leaves the site status alone.
  • .sqlx/ and openapi.json regenerated; CHANGELOG 0.1.7 entry.

Tests: new API test (validation, role guard, hash sent to the agent and verifies, removal), 3 job tests, scripts/test.sh green, fmt and clippy clean.

Not done: UI form and ui/ types (no node on the build box), scripts/e2e.sh.

…rol plane follows

Signed-off-by: gopal tathe <44522021+techgopal@users.noreply.github.com>
…ash, route_update job, /sites/{id}/basic-auth)

Signed-off-by: gopal tathe <44522021+techgopal@users.noreply.github.com>
…, 0398, 0410)

Signed-off-by: gopal tathe <44522021+techgopal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant