260 Commits

Author SHA1 Message Date
cf42a32800 fix(auth): eliminate competing deleteCookie on login verify and ensure proper session persistence 2026-08-24 15:32:26 -07:00
3c57dfbc78 fix(merge): clean up merge conflicts in auth-session.ts and main.test.ts 2026-08-24 15:15:15 -07:00
09ed9de178
Merge pull request #23 from mrteye/feat-tier-1-ingress-control-217564989939913720
feat(auth-api): implement Tier 1 Traefik Ingress Control & Bypass Matrix

Key additions:
1. **Dynamic Bypass Matix:** Implemented native Deno path prefix routing and IPv4 CIDR subnet allowlisting directly inside the edge proxy sub-request without needing database lookups, ensuring <30μs latency. 
2. **Dual-Response Protocol (Unregistered Fallback):** Unregistered domains properly redirect web browsers to a central SSR 404/Error page (`/errors/unregistered`), while APIs/headless clients receive strict 403 JSON payloads. 
3. **Guest Sandboxes & In-Flight Promotion:** Introduced `POST /api/guests/sandbox` to rapidly provision ephemeral passkey-less sessions, and updated the WebAuthn verification endpoint to detect and promote those sessions without destroying their continuous UI state.
4. **Docs & UI:** Created `TIER1_INGRESS_SPEC.md` and wired up all dynamic bypass properties into the Admin Application Registry dashboard.
2026-08-24 15:13:41 -07:00
7230a4d7ea
Merge branch 'main' into feat-tier-1-ingress-control-217564989939913720 2026-08-24 15:13:20 -07:00
google-labs-jules[bot]
2ac6252bff feat(auth-api): implement Tier 1 Traefik Ingress Control & Bypass Matrix
- Add idempotent migrations for `is_public`, `bypass_paths`, and `allowed_cidrs` in `server/db.ts`.
- Update `AppRecord` and `getAppByHost` in `server/auth-session.ts` to cache bypass rules in Valkey.
- Implement native Deno, fast-path prefix (`isPathBypassed`) and CIDR matchers (`isIpAllowed`).
- Update `GET /api/forward-auth` to evaluate dynamic rules and properly return 302/403 for unregistered domains.
- Create `ui/components/UnregisteredAppPage.tsx` SSR view for browser fallbacks.
- Update `AdminAppsPage.tsx` to handle the new ingress settings visually and post to `/api/admin/apps`.
- Add `POST /api/guests/sandbox` to generate ephemeral Valkey guest sessions.
- Update `POST /api/register/verify` to detect `upgrade_session` and promote guests to full users in-flight.
- Add `docs/TIER1_INGRESS_SPEC.md`.
- Ensure tests run cleanly and add comprehensive unit test cases for the bypass matrix.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 22:08:43 +00:00
544fdf0569
Merge pull request #22 from mrteye/feat-sso-launchpad-logout-2100-7262934389430052995
feat(ui): implement App Launchpad and secure logout redirect

This PR implements the requested App Launchpad feature and secures the logout process against open-redirect attacks.

Key changes:
1. **Logout Return-Path Validation**: Added `isSafeRedirectUrl` and updated the `GET /logout` handler. Unsafe redirects are logged as `open_redirect_intercepted`, while successful logouts generate `logout_success` events on the Merkle ledger. All host and parent wildcard cookies (`getCookieDomain()`) are cleared to prevent state collisions.
2. **SSO Application Launchpad**: Introduced `ui/components/AppLaunchpadPage.tsx` using pure Hono SSR JSX. Updates `GET /dashboard` to render this page as the main authenticated landing view. Query logic uses strict Zero-Knowledge filtering—regular users only see explicitly granted apps, and Global Admins see all apps tagged with an `[Admin]` badge.
3. **Hybrid Ingress Playbook**: Authored `docs/HYBRID_INGRESS_PLAYBOOK.md` detailing the architectural split between Traefik ForwardAuth and client application SSR routing.
4. **Testing & QA**: Written comprehensive hermetic unit tests in `server/main.test.ts` for the redirect interceptor, standard logout logic, and Zero-Knowledge role queries. All tests pass with full quality gate compliance (`deno fmt`, `deno task lint`, `deno task check`).
2026-08-24 14:58:52 -07:00
google-labs-jules[bot]
e52f931edb feat(ui): implement App Launchpad and secure logout redirect
- Add isSafeRedirectUrl utility to prevent open-redirect vulnerabilities.
- Update GET /logout to handle ?redirect=, clear cookies safely, and log audit events.
- Create AppLaunchpadPage.tsx using pure Hono SSR JSX for application visibility and SSO launching.
- Update GET /dashboard and AuthenticatedLayout.tsx to mount the Launchpad as the default authenticated view with Zero-Knowledge querying.
- Add HYBRID_INGRESS_PLAYBOOK.md documentation for Traefik ForwardAuth routing.
- Implement exhaustive unit tests in server/main.test.ts for redirect preservation, anomaly logging, and Zero-Knowledge role filtering.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 21:58:36 +00:00
e9b9088fec docs: add Use Case 12 for Hybrid Cloud Edge, Cloudflare Tunnel & Split-Horizon audit requirements 2026-08-24 14:46:44 -07:00
b4b05c37ff feat(sdk): add ForwardAuth header passthrough hydration in createAuthMiddleware 2026-08-24 14:17:10 -07:00
cd1d866077 docs(tasks): standardize and upgrade Task 4.1 and Task 4.2 to 100% rubric compliance 2026-08-24 14:15:38 -07:00
443df1c2ce chore(tasks): remove JULES_PROMPTS.md to eliminate agent prompt confusion 2026-08-24 14:13:35 -07:00
226d04228b
Merge pull request #21 from mrteye/feat/auth-api-traefik-ingress-control-task-6742583984777370201
feat(tasks): create Traefik Universal Edge Ingress task file
2026-08-24 14:13:08 -07:00
9ace888b4b
Merge pull request #20 from mrteye/feat/sso-launchpad-task-file-4077230937799430847
docs: draft phase 4 sso launchpad and logout spec
2026-08-24 14:12:51 -07:00
google-labs-jules[bot]
5f31989137 feat(tasks): create Traefik Universal Edge Ingress task file
Generates `tasks/new/2026-0824.01.jul.feat.auth-api.traefik-ingress-control-2105.md` outlining the architecture and implementation steps for:
- Traefik global default-deny ForwardAuth setup
- Valkey-cached dynamic database bypass matrix (`is_public`, `bypass_paths`)
- Hybrid universal path and CIDR exemptions
- Dual-response error handling (302 vs 403) for unregistered apps
- Ephemeral guest sandbox flow with passkey promotion

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 21:12:30 +00:00
google-labs-jules[bot]
b0dd2d098c docs: draft phase 4 sso launchpad and logout spec
Drafted the task markdown file for Phase 4 covering Central SSO Application Launchpad, Logout Return-Path Preservation, Hybrid Ingress Gateway Protocol, and Strict Additive Security Audit.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 21:10:17 +00:00
4fce954c86 docs(tasks): add Prompt 4.2 for Jules with SSO launchpad, logout return-path, and additive security audit 2026-08-24 13:56:12 -07:00
2e30c5ad3e docs(tasks): enrich Prompt 4.1 for Jules with comprehensive Tier 1 bypass and allowlist architecture 2026-08-24 13:39:56 -07:00
7420401147 fix(cookie): dynamically calculate parent wildcard domain (.atyg.org) to prevent host-scoping redirect loop 2026-08-24 13:11:17 -07:00
ce29459f78 fix(ui): add Cache-Control no-cache middleware and version tags to auth-client.js to prevent stale browser caching 2026-08-24 13:07:23 -07:00
b867a166e9 docs: add ForwardAuth Redirection & Deep-Link Protocol Specification (RFC-SPEC-2026-FA-01) 2026-08-24 12:53:16 -07:00
96bcf69179 feat(forwardauth): add browser 302 redirect with safe return URL and open-redirect protection 2026-08-24 12:52:23 -07:00
590a13e694 fix(infra): add ForwardAuth middleware labels to auth-api service in compose generator 2026-08-24 12:40:31 -07:00
4cf7cb2d18 docs(tasks): add Phase 4 Prompt 4.1 for Traefik Tier 1 Global Ingress Discovery 2026-08-24 12:27:46 -07:00
885d26e595 docs: add Use Case 11 (Guest Trial Sandboxes & In-Flight Upgrade) and quick links in README.md 2026-08-24 11:34:44 -07:00
8ee0f305a8 docs(tasks): mark all Phase 3 stories as COMPLETE in JULES_PROMPTS.md 2026-08-24 08:57:01 -07:00
574c4d66aa fix(phase3): restore deno.json workspace/tasks and fix recovery/audit typing 2026-08-24 08:56:47 -07:00
a0a05da03c
Merge pull request #19 from mrteye/feat-sss-recovery-matrix-4307830478024114673
feat: 2-of-3 Shamir's Secret Sharing Recovery Matrix
2026-08-24 00:50:26 -07:00
google-labs-jules[bot]
f63d0c9afe feat: implement 2-of-3 SSS recovery matrix using Wasm/Rust
- Scaffolds a new Rust crate `wasm/sss_recovery` for constant-time Shamir's Secret Sharing over GF(256) with strict Wasm `zeroize`
- Implements purely typed BIP-39 fallback mapped via Deno WebCrypto in `ui/utils/bip39.ts`
- Migrates `server/recovery.ts` logic mapping Device/Voucher + Server shares with Valkey rate-limiting
- Applies mandatory in-memory JS zeroization on all reconstructed buffers

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 07:49:34 +00:00
4ed20be4a2
Merge pull request #18 from mrteye/feat-webauthn-prf-8747559092824518798
feat: WebAuthn PRF Extension for KEK Derivation
2026-08-24 00:46:51 -07:00
google-labs-jules[bot]
e1555f14fc feat: implement WebAuthn PRF extension for client-side HKDF key derivation
* Added `prf_enabled` and `prf_salt` columns to the `passkeys` table.
* Updated registration API endpoints to request and store the PRF extension capability and generate a secure salt.
* Updated the login API endpoints to map stored PRF salts into the `evalByCredential` array for the WebAuthn challenge.
* Enhanced the client-side WebAuthn SDK (`auth-client.js`) to extract the PRF Base64URL string output, decode it into a `Uint8Array`, and securely derive a 256-bit AES-GCM Key Encryption Key (KEK) via `crypto.subtle.deriveKey` using the `auth-yes:prf:device-share:v1` info string.
* Implemented graceful fallbacks throughout the stack to ensure registration and standard logins proceed if PRF is unsupported.
* Added corresponding unit tests to verify PRF flow and rejection logic.
* Verified visual and functional changes for the optional username input on the login page via Playwright scripts.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 07:46:22 +00:00
1674c44a32
Merge pull request #17 from mrteye/jul-feat-audit-merkle-ledger-11366767708511265093
feat(server): Implement RFC 6962 Merkle Tree Audit Ledger
2026-08-23 23:25:53 -07:00
google-labs-jules[bot]
97336a95be feat(server): add RFC 6962 Merkle Tree Audit Ledger
- Expanded database schema to include `leaf_hash` in `audit_records` and added `audit_sths` table.
- Implemented `server/audit_merkle.ts` for native WebCrypto RFC 6962 tree computations and inclusion proofs.
- Created asynchronous micro-batcher in `server/audit.ts` to compute STH, sign with SPIFFE key, save to DB, and broadcast via Valkey.
- Refactored `auditLog` to compute leaf hashes synchronously before database inserts.
- Added hermetic unit tests with mock fallback patterns for SPIFFE/FFI in `server/audit_merkle.test.ts`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 06:19:23 +00:00
b34475b4fb
Merge pull request #14 from mrteye/feat-webauthn-prf-task-9777533714682100655
feat(docs): Add task for WebAuthn PRF extension
2026-08-23 22:52:43 -07:00
792ed141d2
Merge pull request #15 from mrteye/feat-recovery-sss-matrix-task-4186155517714950179
Add task file for 2-of-3 SSS Wasm recovery matrix
2026-08-23 22:52:36 -07:00
efe2523307
Merge pull request #16 from mrteye/feat-audit-merkle-ledger-task-5295491276490979898
feat: Add Merkle Tree Ledger task file
2026-08-23 22:52:29 -07:00
google-labs-jules[bot]
7ae19b1033 feat(planning): add task file for RFC 6962 Merkle Tree Ledger
Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 05:52:16 +00:00
google-labs-jules[bot]
4b6001a646 Add task file for 2-of-3 SSS Wasm recovery matrix
Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 05:52:11 +00:00
google-labs-jules[bot]
dcecbd3edd feat(docs): add task for WebAuthn PRF extension
Added a new task markdown file `2026-0824.01.jul.feat.webauthn.prf-extension-1200.md` detailing the plan for integrating the WebAuthn PRF extension. It outlines the schema updates, client and server flow implementations, and progressive fallback logic as per Kanban guidelines.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 05:52:03 +00:00
4e7d6c8add docs(tasks): mark Prompt 2.1 as complete in JULES_PROMPTS.md 2026-08-23 22:37:21 -07:00
95ef596407
Merge pull request #13 from mrteye/feat-http-sigs-7822098764133354425
feat: implement RFC 9421 HTTP message signatures
2026-08-23 22:36:13 -07:00
google-labs-jules[bot]
182c789e05 feat(auth): implement RFC 9421 HTTP Message Signatures
- Added native Deno WebCrypto Ed25519 signature verification middleware for headless edge workloads.
- Integrated dual authentication path to `/api/forward-auth` processing signatures and session cookies.
- Added dual storage Admin Management routes (`/api/admin/hwk`) securely inserting directly to PostgreSQL and pushing to $O(1)$ Valkey verification set.
- Completed all quality gates checks and hermetic mocked tests successfully.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 05:36:01 +00:00
de2dcc85f7 docs(tasks): mark Prompt 2.2 as complete in JULES_PROMPTS.md 2026-08-23 21:56:57 -07:00
0ebbcf38c7 docs: format GHOST_COCKPIT_SPEC.md 2026-08-23 21:56:46 -07:00
fdcf9ded05
Merge pull request #12 from mrteye/feat-ghost-cockpit-protocol-3135824224285676341
feat(sdk): Implement Ghost Cockpit Protocol WebSocket guard helper
2026-08-23 21:54:11 -07:00
69b5edca8c docs: author practical playbook and 10 high-ROI use cases in docs/USE_CASES_AND_EFFORT.md 2026-08-23 21:54:00 -07:00
google-labs-jules[bot]
b919c66cbc feat(sdk): Implement Ghost Cockpit Protocol WebSocket guard helper
- Formalized Ghost Cockpit Protocol in docs/GHOST_COCKPIT_SPEC.md.
- Added `GhostCockpitClient` reference implementation.
- Implemented `createWebSocketGuard` in `sdk/hono.ts` to seamlessly terminate invalidated user sessions with code 1008.
- Added robust lifecycle cleanups and error checking for WebSocket frame deliveries on socket close.
- Added comprehensive integration tests in `sdk/hono.test.ts`.
- Cleaned unused imports and fixed all linting warnings.
- Moved task definition to complete.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 04:53:51 +00:00
e15e5a8038
Merge pull request #11 from mrteye/http-sigs-rfc9421-task-8607209458702274605
feat: add RFC 9421 task file
2026-08-23 21:41:21 -07:00
66e11afdc3 docs(tasks): format JULES_PROMPTS.md markdown tables 2026-08-23 21:41:08 -07:00
google-labs-jules[bot]
a0989a3bed Add task for RFC 9421 HTTP Message Signatures verification
Adds a detailed markdown task file in `tasks/new/` following the Kanban guidelines to outline the architectural implementation plan for RFC 9421 HTTP Message Signatures verification at edge nodes using native Deno WebCrypto.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 04:41:05 +00:00
e09496cf83
Merge pull request #10 from mrteye/task-ghost-cockpit-protocol-1413997499442523563
feat: draft ghost cockpit protocol task
2026-08-23 21:40:25 -07:00