54 Commits

Author SHA1 Message Date
8062283955 chore(plan): move hypermedia plan to in-progress for phase 2 2026-08-27 18:21:55 -07:00
google-labs-jules[bot]
a613ed2b68 feat: execute Phase 1 architectural hypermedia framework
- Bootstraps `src/core/` foundation (`db.ts`, `valkey.ts`, `spire_ffi.ts`, `main.ts`).
- Adds `auth_guards.ts` for payload capping, CSRF check, and rate limiting.
- Adds `content_negotiation.ts` and `sse_adapter.ts` for Datastar transport helpers.
- Adds `error_fragments.tsx` for standardized Datastar error morphs.
- Introduces `scripts/lint_arch.ts` to block imperative DOM usage.
- Updates `deno.json` with src workspace configs and lint commands.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-28 01:20:01 +00:00
f6b5dd3992 fix(sessions): resolve attendees drawer TypeError and PostgreSQL interval syntax error 2026-08-27 13:30:03 -07:00
0a3c147880 fix(events): patch db backfill for legacy users and sync frontend domain drift on rotation 2026-08-27 00:21:34 -07:00
google-labs-jules[bot]
d86642ce31 feat: Sessions UI overhaul and backend revocation fix
- Update `DELETE /api/sessions/:id` in `server/routes/sessions.ts` to allow event creators to delete guests' sessions.
- Update page hierarchy and top headings in `ui/components/SessionsPage.tsx`.
- Refactor `EventAttendeesDrawer.tsx` to `EventGuestsDrawer.tsx` as a fixed slide-over overlay.
- Add multi-event compact view toggle with `localStorage` persistence in `EventCockpitDeck.tsx`.
- Standardize dynamic countdown pills across `EventCockpitDeck.tsx`, `EventGuestsDrawer.tsx`, `SessionDeck.tsx`, and `SessionTable.tsx`.
- Optimize mobile session deck in `SessionDeck.tsx`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-27 04:06:19 +00:00
google-labs-jules[bot]
0a4f6a8344 feat(event-controls): implement live attendee management drawer and session pause
This commit finalizes Phase 4 of the Event & Session Overhaul:
1. Implements session pause logic across PostgreSQL schema, Valkey cache, and `auth_forward.ts` edge check (`is_paused`).
2. Implements non-destructive operational endpoints (`/api/events/:id/rotate-pin`, `/api/events/:id/expand`, `/api/events/:id/attendees`) with Zero-Trust Ownership verification.
3. Upgrades existing `end` and `extend` endpoints in `events.ts` to utilize robust Zero-Trust Ownership queries (created_by OR isGlobalAdmin).
4. Creates `EventAttendeesDrawer.tsx` to handle live participant inspection and individual session controls (Pause, Revoke).
5. Updates `EventCockpitDeck.tsx` and `SessionsScript.tsx` to mount and drive the new controls via vanilla JavaScript, respecting zero-framework guidelines.
6. Ensures `deno fmt`, `deno task lint`, `deno task check` and `deno test` execute successfully against the new schema and API guards.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-27 01:53:52 +00:00
google-labs-jules[bot]
d057e080d3 feat(ui): implement 2-state workshop drawer machine and refine session page hierarchy
- Moved `EventCockpitDeck` below main header in `SessionsPage.tsx`
- Refactored `WorkshopDrawer.tsx` to strictly use a 2-state display toggle (`#eventCreateState` and `#eventHandoffState`)
- Added `aria-label`s to copy buttons for accessibility
- Configured `#status-banner` with `role="status"` and `aria-live="polite"`
- Fixed mobile title text wrapping on `#createdEventTitle`
- Fixed script emoji injection logic to prevent double emojis
- Added JS reset logic in `closeDelegateDrawer` to restore drawer states and clear form data

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-27 00:12:50 +00:00
google-labs-jules[bot]
edbceae0fb feat(events): implement bifurcated join inputs and NAT-safe idempotency
- Adds UI links for joining with PIN in Login and Register pages.
- Normalizes event slugs to lowercase (preserving hyphens) and event PINs to strip all hyphens/spaces to handle raw inputs.
- Implements a pre-check rate limit pattern (`isRateLimited`) to safely enforce a max of 5 failed attempts per IP window (60s) without rate-limiting successful authentications.
- Achieves NAT-safe idempotency in `POST /api/join` by extracting and reusing active event guest sessions instead of blindly incrementing claimed seats on every request.
- Integrates complete test suite coverage for these new constraints.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 23:57:13 +00:00
google-labs-jules[bot]
eed5c8a0fd feat: Implement Phase 1 Event & Session Overhaul (Guest Ingress & Audits)
- Allowed guest accounts to be evaluated in `forward-auth`
- Validated `guest` account's `customScopes` and rejected ungranted access
- Added Array parameterization and `UNION` query in `getDashboardApps`
- Mapped `customScopes` to `getDashboardApps` in the UI route `/dashboard`
- Wired web and CLI joins in `events.ts` to `auditWrapper.auditLog` using correct schema (`event.id`, `{slug, method}`)
- Added `auditWrapper.auditLog` unit test validations in `events.test.ts`
- Added guest session scope unit tests in `forward_auth.test.ts`
- Moved Markdown tasks logic from `tasks/new/` to `tasks/complete/`

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 23:34:00 +00:00
695d44e16e chore(tasks): close out ui decomposition roadmap
- All three phases (Layout, Admin Drawers, WebAuthn deduplication) are now completed
2026-08-26 12:07:15 -07:00
google-labs-jules[bot]
65f59521c0 feat(ui): decompose Admin UI with separate Drawers and Scripts
Phase 2 Admin Drawers & Scripts execution:
- Extract `AppDrawer`, `InviteDrawer`, `RoleEditorDrawer`, and `GrantDrawer`.
- Extract `AdminAppsScript`, `AdminInvitesScript`, `AdminRolesScript`, and `AdminUserDetailsScript`.
- Hook extracted components into their respective pages.
- Format `AdminRolesPage.tsx` and all modified files using `deno fmt`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 18:37:15 +00:00
google-labs-jules[bot]
afaecdaa26 Extract WebAuthn Components & Deduplicate Assets
- Extracted `PasskeyTable` and `WebAuthnScript` into `ui/components/auth/`.
- Refactored `PasskeysPage.tsx` and `RegisterPage.tsx` to use the new components instead of inline scripts and HTML.
- Deleted the duplicate `ui/public/ui/utils/bip39_wordlist.ts` and `ui/public/ui/utils/bip39.ts`.
- Updated all import references to use `ui/utils/bip39_wordlist.ts` and `/public/utils/bip39.ts`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 06:54:29 +00:00
f5935a49a7 docs(tasks): move ui decomposition ph1 to complete and format subcomponents 2026-08-25 23:39:39 -07:00
97edc7b89b docs(tasks): mark entire monolith decomposition roadmap epic complete 2026-08-25 22:33:00 -07:00
google-labs-jules[bot]
0d59c2ac75 refactor(test): decompose main.test.ts into domain specific test files
Extracted the 1,577-line monolithic `server/main.test.ts` into five isolated, domain-specific files under `server/tests/`:
- `forward_auth.test.ts`: ForwardAuth bypass, cookie scoping, and sandbox.
- `rpc.test.ts`: ConnectRPC SPIFFE and RBAC tests.
- `auth.test.ts`: Audit ledger, WebAuthn PRF, passkey magic links.
- `events.test.ts`: Multi-claim join endpoints and killswitch.
- `scopes.test.ts`: Zero-trust guards and self-revocations.

Successfully maintained all tests cleanly isolated via standard mocking and deleted `main.test.ts` after migrating and executing `deno test --allow-all` with zero failures.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 05:12:08 +00:00
e0c12bdef6 docs(tasks): move ph3.1 task spec to complete 2026-08-25 21:39:32 -07:00
google-labs-jules[bot]
752bfcf03e Refactor infra/setup/cli.ts into smaller command and prompt modules
Decomposes the monolith `infra/setup/cli.ts` into clean `infra/setup/prompts/` and `infra/setup/commands/` directories while adhering to Cliffy idiomatic modularity. Validated via `deno check`, tests, and format.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 04:37:41 +00:00
google-labs-jules[bot]
88821b80af feat: Phase 3 Monolith decomposition of server/main.ts
- Extracts Auth, Registration, and Passkey routes into `server/routes/auth.ts`.
- Extracts all Admin API endpoints into `server/routes/admin.ts`.
- Extracts RPC Connect setup and mTLS listener into `server/rpc.ts`.
- Extracts global rate limiters and IP helpers into `server/middleware.ts`.
- Reduces `server/main.ts` purely to an entrypoint mounting orchestrator.
- Ensures all existing tests and quality gates pass with zero regressions.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 03:23:20 +00:00
67bbe0d1e9
Merge pull request #34 from mrteye/refactor-infra-setup-modules-16584207009061218557
Refactor: Decompose infra/setup.ts into modular sub-modules
2026-08-25 17:37:44 -07:00
google-labs-jules[bot]
4c7d8d4af7 feat(ui): decompose admin pages into reusable AdminTable and AdminModal components
Refactored AdminInvitesPage, AdminUserDetailsPage, AdminRolesPage, and AdminAppsPage to use the new pure Hono SSR JSX stateless components.
Fixed missing import definitions in AdminRolesPage.
Moved task file to complete state.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 00:34:29 +00:00
google-labs-jules[bot]
779f890b2f Refactored the 1,000+ line setup.ts into sub-modules
- Extracted CLI commands into infra/setup/cli.ts
- Extracted docker compose configuration to infra/setup/compose.ts
- Extracted env variable generation to infra/setup/env.ts
- Extracted build commands to infra/setup/build.ts
- Retained infra/setup.ts as a simple entrypoint orchestrator

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 00:34:24 +00:00
7df39bd27a docs(tasks): complete phase 1 ui sessions decomposition and format subcomponents 2026-08-25 16:22:32 -07:00
5de9bdf18c
Merge pull request #32 from mrteye/ui-redesign-sessions-drawer-17867567827419767189
Redesign the Sessions management page header and drawer
2026-08-25 15:53:32 -07:00
google-labs-jules[bot]
64a9b2cd1d refactor(ui): Redesign and consolidate sessions and passes drawer
- Removed the dual top buttons from SessionsPage.tsx.
- Removed the `#eventDrawer` and wrapped its fields, buttons, and modal under `<form id="eventForm">` inside `#tabWorkshopPass` of `#delegateDrawer`.
- Wrapped the 1:1 Direct pass form fields, buttons, and modal under `<form id="delegateForm">` inside `#tabDirectPass` of `#delegateDrawer`.
- Added a vanilla Javascript tab switching logic for UI interaction without client-side frameworks.
- Removed deprecated `openEventDrawer` and `closeEventDrawer`.
- Replaced the single main button to trigger `openDelegateDrawer`.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-25 22:53:20 +00:00
6a5a769203 sec(auth-api): implement zero-trust scope guards and permission middleware 2026-08-25 15:39:54 -07:00
a82136fc95 feat(cockpit): add live event metrics, seat roster, and master kill-switch 2026-08-25 09:33:44 -07:00
40804fd813 feat(passes): implement ephemeral 1-click magic links, event passes, PIN join portal, and CLI 1-liner 2026-08-25 08:14:16 -07:00
google-labs-jules[bot]
2d34aa15a7 feat: implement ephemeral 1-click magic link redemption (/pass)
Implements the GET /pass?token=... endpoint for validating session tokens, resolving the correct target application domain dynamically, and routing users seamlessly using ephemeral 1-click magic links.
Also updates the Sessions Hub UI hand-off modal to display the 1-Click Magic Link and adds full test coverage.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-25 08:25:31 +00:00
5f88733fc6 feat(sessions): implement agent session delegation with scoped permissions and instant handoff 2026-08-24 23:46:44 -07:00
509e6019b0 feat(ui): adapt admin management screens into responsive mobile cards and timeline feed 2026-08-24 22:20:47 -07:00
7ab1405459 feat(ui): implement adaptive card decks for launchpad, sessions, and passkeys with emergency recovery backup 2026-08-24 22:20:10 -07:00
a3f5c5c286 feat(ui): implement hero passkey authentication, conditional UI autofill, and 12-word recovery setup 2026-08-24 22:19:20 -07:00
029c32e022 feat(ui): implement design tokens and mobile-first adaptive navigation shell 2026-08-24 22:18:34 -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
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
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
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
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
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
8390dcac3d
Merge pull request #9 from mrteye/feat-ingress-grant-vector-injection-17171143789522307350
feat: Ingress Grant Vector Injection (/api/forward-auth)
2026-08-23 21:23:16 -07:00
google-labs-jules[bot]
8ff5090ffa feat: Implement Ingress Grant Vector Injection for ForwardAuth
- Add `domain` column to `apps` table.
- Create Valkey caching layers for app resolution by host (`auth:app_by_host:<host>`) and user grants (`auth:grants:<userId>:<appId>`) with PostgreSQL fallback in `server/auth-session.ts`.
- Update `/api/forward-auth` endpoint to resolve `X-Forwarded-Host`, enforce Default-Deny, check RBAC grants, and inject `X-Forwarded-*` scopes.
- Update relevant unit tests to cover missing and invalid scenarios with correct Mock stubs.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 04:23:04 +00:00
57570a0976
Merge pull request #8 from mrteye/feat-spire-ffi-argon2id-7776325516155569495
feat: Native Argon2id in spire_ffi
2026-08-23 21:20:43 -07:00
google-labs-jules[bot]
9da28a6416 feat(spire-ffi): implement native Argon2id derivation
- Added `argon2` v0.5 dependency to `spire_ffi/Cargo.toml`
- Implemented `argon2id_derive` FFI function in `spire_ffi/src/lib.rs` with C-ABI.
- Added Deno FFI binding `deriveArgon2idKey` in `server/spire_ffi.ts` with `nonblocking: true` to prevent stalling the event loop.
- Pre-allocates output buffer on the Deno side as the standard FFI pattern.
- Included fallback mock behavior when `libspire_ffi.so` is not loaded, returning a 32-byte 0xaa filled array.
- Updated unit tests in `server/spire_ffi.test.ts` to test mock usage and successful generation.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 04:19:48 +00:00
google-labs-jules[bot]
3d66535889 feat: implement zero-dependency real-time event bus in AuthSdk
Added a lightweight, zero-dependency event bus to the `AuthSdk` to listen for Valkey RESP3 push invalidation events and emit them to registered listeners.
The implementation properly captures errors from synchronous and asynchronous listeners, ensuring they do not crash the primary SDK listener loop. Extracted the Valkey event processor to improve hermetic testability.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-24 04:19:40 +00:00