From 44d5bf37e99d054aa4425dfd84b8d18cefd343f5 Mon Sep 17 00:00:00 2001 From: nstarikov Date: Tue, 11 Aug 2026 13:11:24 +0300 Subject: [PATCH] remove dzen basic auth gate --- dzen-assistant/Caddyfile.server | 5 ----- .../docs/superpowers/plans/2026-08-11-passkey-auth.md | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dzen-assistant/Caddyfile.server b/dzen-assistant/Caddyfile.server index e811d24..bfed183 100644 --- a/dzen-assistant/Caddyfile.server +++ b/dzen-assistant/Caddyfile.server @@ -537,11 +537,6 @@ dzen.nstarikov.ru { import snippet_block_bots import snippet_security_headers - @admin path /admin* /api* - basic_auth @admin { - admin $2a$14$P4L2AQE5GrhdJ9UWy2sNHuRryJarO3pReiGVVs3VGe/hX.ObQaqbO - } - handle { reverse_proxy dzen-assistant-api:8000 } diff --git a/dzen-assistant/docs/superpowers/plans/2026-08-11-passkey-auth.md b/dzen-assistant/docs/superpowers/plans/2026-08-11-passkey-auth.md index 808ccc8..ca06acf 100644 --- a/dzen-assistant/docs/superpowers/plans/2026-08-11-passkey-auth.md +++ b/dzen-assistant/docs/superpowers/plans/2026-08-11-passkey-auth.md @@ -2,9 +2,9 @@ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. -**Goal:** Replace repeated Basic Auth prompts on `dzen.nstarikov.ru` with Face ID, Touch ID, Windows Hello, or another WebAuthn passkey while retaining a guarded emergency Basic Auth path. +**Goal:** Replace repeated Basic Auth prompts on `dzen.nstarikov.ru` with VK ID for the allowlisted VK user and Face ID, Touch ID, Windows Hello, or another WebAuthn passkey. -**Architecture:** FastAPI will own authentication for `/admin` and `/api`: public WebAuthn challenge endpoints issue registration and authentication options, verification creates an HttpOnly session cookie, and a middleware protects all other admin/API routes. SQLite stores passkey credentials and sessions. Caddy will stop applying Basic Auth to the main host; the existing Basic Auth configuration remains available on a separate emergency host until passkey login is verified. +**Architecture:** FastAPI will own authentication for `/admin` and `/api`: VK ID bootstrap is restricted to `vk_user_id=32018`, WebAuthn challenge endpoints issue registration and authentication options, verification creates an HttpOnly session cookie, and middleware protects all other admin/API routes. SQLite stores passkey credentials and sessions. Caddy no longer applies Basic Auth to the main host. **Tech Stack:** FastAPI, SQLAlchemy/SQLite, `webauthn` Python package, browser WebAuthn API, React/Vite, Caddy. @@ -32,7 +32,7 @@ - [ ] Add registration options/verification and authentication options/verification using `generate_*_options`, `verify_*_response`, and JSON helpers from `webauthn`. - [ ] Set and clear Secure, HttpOnly, SameSite=Lax session cookies. - [ ] Permit only auth bootstrap/challenge/verify/health without a session; require a session for `/admin`, `/api`, and logs WebSockets. -- [ ] Keep first-device registration guarded by the existing Basic Auth during migration. +- [ ] Keep first-device registration guarded by an authenticated VK ID session. ### Task 3: Add passkey UI @@ -51,7 +51,7 @@ - Modify: `Caddyfile.server` - Modify: `Caddyfile.snippet` if needed -- [ ] Remove Basic Auth from the main `dzen.nstarikov.ru` route while keeping an emergency host/path protected by Basic Auth. +- [ ] Remove Basic Auth from the main `dzen.nstarikov.ru` route. - [ ] Validate Caddy configuration, deploy API/admin/Caddy changes, and verify HTTPS origin and cookie behavior. - [ ] Test registration and login on iPhone Safari/PWA and a desktop platform authenticator. @@ -59,4 +59,4 @@ - [ ] Run `python3 -m py_compile app/*.py` and `npm --prefix admin run build`. - [ ] Verify unauthenticated API returns `401`, authenticated API returns `200`, `/feed` remains public, and WebSocket logs accept the session cookie. -- [ ] Verify the emergency Basic Auth path remains reachable before removing any old credential mechanism. +- [ ] Verify the VK allowlist and passkey session boundary; no Basic Auth fallback remains on the main host.