46 Commits

Author SHA1 Message Date
e9060eee5a fix(test): mock auditWrapper across tests and add assertions for session events 2026-08-26 12:31:38 -07:00
google-labs-jules[bot]
99bb8d794f Refactor server/auth-session.ts and ui/mod.ts to decouple domain utilities, database queries, and admin authorization checks into separate files (server/forward_auth.ts, server/session_resolver.ts, ui/db_queries.ts, ui/auth_checks.ts).
Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 05:31:25 +00: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
google-labs-jules[bot]
589e146ecc feat(routes): decompose admin and auth monolith routes
Extracted domain-specific sub-routers from monolithic `server/routes/admin.ts` and `server/routes/auth.ts` into isolated modules within `server/routes/admin/` and `server/routes/auth/` respectively. The original entry routers were updated to import and assemble these sub-routers without breaking their current HTTP interface or rate limiting/authorization middleware. Testing and linting were run ensuring perfect functionality and 100% test passing score.

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-26 04:37:26 +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
6a5a769203 sec(auth-api): implement zero-trust scope guards and permission middleware 2026-08-25 15:39:54 -07:00
22bcd889c3 ui(sessions): simplify delegation copy and labels across sessions page and routes 2026-08-25 09:59:27 -07:00
f5bafbca78 fix(valkey,tasks): prevent unhandled connection hangs in sandbox and constrain test directives 2026-08-25 09:38:27 -07:00
a82136fc95 feat(cockpit): add live event metrics, seat roster, and master kill-switch 2026-08-25 09:33:44 -07:00
39f3b2e3fa refactor(server): modularize main.ts into dedicated sub-routers (passes, events, sessions, forward-auth) 2026-08-25 08:17:06 -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
80cab8454e feat(api): support Authorization: Bearer <session_id> in addition to Cookie headers for agent queries 2026-08-24 23:29:39 -07:00
85772659b7 feat(ui,api): polish a11y, mobile decks, app/role edit drawers, display name management, and instant search 2026-08-24 23:21:35 -07:00
b9f4ccd71d feat(auth): resolve mobile cookie shadowing and synchronize tasks/path.md
- Implement iterative session cookie candidate resolution in getAuthenticatedUser
- Eliminate Hono first-match limitation causing mobile login redirect loops
- Use absolute UTC ISO strings for PostgreSQL session expiry queries
- Opportunistically clear host-level cookies upon shadow detection
- Ensure exhaustive server-side session revocation across all cookie candidates on logout
- Add automated regression test for cookie shadowing in server/main.test.ts
- Rename and standardize tasks/path.md with 5-template orchestrator standard
2026-08-24 21:48:33 -07:00
4b78f70efd fix(auth): eliminate conflicting deleteCookie and add created_at to users table 2026-08-24 17:14:07 -07:00
250e9c625b test: update logout redirect assertion 2026-08-24 16:23:12 -07:00
561588624a feat(ui): allow direct logout redirects to safe return urls instead of forcing login page 2026-08-24 16:22:15 -07:00
8babb8a46e fix(session): clear invalid cookies on redirect and add cache-control headers to prevent 302 caching loops 2026-08-24 15:57:02 -07:00
54cdf0c442 fix(auth): remove invalid transports column reference in passkeys query 2026-08-24 15:41:49 -07:00
324ad24d05 fix(auth): add allowCredentials to login challenge options when username provided 2026-08-24 15:36:54 -07:00
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
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
7420401147 fix(cookie): dynamically calculate parent wildcard domain (.atyg.org) to prevent host-scoping redirect loop 2026-08-24 13:11:17 -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
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
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
5db9108ecd test(server): clean up valkey stubbing in server/main.test.ts 2026-08-23 21:24:21 -07: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
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
e7f01940b3 fix(spire_ffi): silence noisy cert parse error on invalid certs and add SPIFFE cert unit test 2026-08-23 10:58:40 -07:00
40da6ecbe0 fix(infra): update Dockerfile, setup.ts, and bootstrap admin invite for standalone repo 2026-08-22 10:18:47 -07:00
623e78a7b1 fix(tests): guard valkey.disconnect and format files 2026-08-21 17:31:36 -07:00
google-labs-jules[bot]
9988df3218 audit: verify 3-tier auth, rbac, and decouple server side effects
- Add `app` export and wrap startup logic behind `if (import.meta.main)`
- Extract `hono` middleware into `sdk/hono.ts` for clean separation
- Refactor module imports slightly to support in-memory native mocking (`db`, `valkey`, `spire_ffi`, `ratelimit`, `audit`)
- Implement comprehensive native Deno mock tests in `server/main.test.ts`
- Fix type checking across project files

Co-authored-by: mrteye <1945243+mrteye@users.noreply.github.com>
2026-08-22 00:29:19 +00:00
474cc177ce chore: adopt dual licensing and import task history & scaffolding
- Add LICENSE-MIT and LICENSE-APACHE for dual MIT / Apache-2.0 distribution
- Update root LICENSE pointer, README.md, Deno workspace manifests, and Cargo.toml
- Add deno.lock dependency lockfile
- Format AGENTS.md system guidelines
- Import task lifecycle scaffolding and historical story specifications (extract-auth-yes, setup-ts architecture, modular workspace)
2026-08-21 15:20:36 -07:00
ac89e4c8d0 feat: initial commit for auth-yes identity hub 2026-08-21 14:27:36 -07:00