A machine-only HTTP endpoint that returns 200 if the request's X-Auth-Request-Email is in the root .zddc admins: list, 403 otherwise. No body, no redirect — pure authorization decision intended to be polled by an upstream proxy's forward_auth directive. The motivating use case is gating /devshell/* (code-server) in the dev-shell pod on root-admin status before the request ever reaches code-server, which has no built-in ACL of its own. zddc-server's own routes keep the existing .zddc cascade ACL and don't go through this endpoint. Reuses zddc.IsAdmin (one cached map lookup) so the check is cheap enough to call on every request. Edits to /srv/.zddc propagate via the existing fsnotify watcher's policy-cache invalidation. Tests cover empty email, non-admin, admin, and the bootstrap state where no root .zddc exists (deny everyone — the safe default). Docs: zddc/README.md "Forward-auth target for upstream proxies" section + AGENTS.md notes bullet. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| archivehandler.go | ||
| archivehandler_test.go | ||
| authcheck.go | ||
| authcheck_test.go | ||
| cors.go | ||
| cors_test.go | ||
| directory.go | ||
| logring.go | ||
| logring_test.go | ||
| middleware.go | ||
| middleware_test.go | ||
| profilehandler.go | ||
| profilehandler_test.go | ||
| profilepage.go | ||
| profileprojects.go | ||
| projectshandler.go | ||
| projectshandler_test.go | ||
| static.go | ||
| zddc_assets.go | ||
| zddceditor.go | ||
| zddchandler.go | ||
| zddchandler_test.go | ||