hephaestus/crates/heph-core/tests
Erich Blume 497c62a988
Some checks failed
Build / validate (pull_request) Failing after 3s
hephd: OIDC hub authentication — verification side (auth 10a)
Authenticate op exchange at the network boundary (tech-spec §13). The hub
now requires a valid OIDC bearer token on /sync/* and /rpc; local mode is
unchanged (no auth).

- heph-core: Store::authorize_owner_sub — single-tenant gate that claims the
  owner's oidc_sub on first sight, then authorizes only that sub (403 for any
  other identity). LocalStore impl over users.oidc_sub; RemoteStore stub.
- hephd auth module: TokenVerifier trait (mockable seam) + OidcVerifier
  (jsonwebtoken, rust_crypto). Strict validation: RS256 pinned, exact iss +
  aud, exp/nbf, required sub; JWKS discovered + cached, refetched on unknown
  kid (rotation). Claims/AuthError.
- Hub router takes Option<verifier>; an axum middleware on every route
  extracts the Bearer token, verifies it off the async worker, and runs the
  owner gate — 401 missing/invalid, 403 wrong identity, 503 IdP-unreachable.
  Open (no auth) when unconfigured, for local dev.
- main: --oidc-issuer/--oidc-audience enable the hub verifier (server mode).
- Security tests, all offline: stub-verifier middleware (missing/bad/valid +
  owner gate) and an adversarial battery driving OidcVerifier against an
  in-process mock IdP — rejects expired, wrong iss/aud, unknown kid, tampered
  signature, alg confusion (HS256/none), and missing sub. The RSA key + JWKS
  are generated at runtime (rsa/rand/base64 dev-deps) so no key is committed.
- tech-spec: add an end-of-v1 dependency-refresh pass to the roadmap.

108 tests green; clippy -D warnings + fmt + prek clean. Next: client-side
device-code login + keyring (10b).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 15:58:20 -07:00
..
convergence.rs hephd: OIDC hub authentication — verification side (auth 10a) 2026-06-01 15:58:20 -07:00
export.rs heph CLI + export 2026-05-31 20:33:59 -07:00
hlc_stamping.rs heph-core: real HLC + persistent device origin (sync 8a) 2026-05-31 21:13:55 -07:00
next_ranking.rs heph-core: "what is next?" ranking (tech-spec §7) 2026-05-31 19:07:16 -07:00
query_surface.rs heph-core: Organizational list, health, journal (§6, §7) 2026-05-31 20:40:33 -07:00
recurrence.rs heph-core: recurrence (roll-forward in place) + per-task logs 2026-05-31 19:14:22 -07:00
search.rs heph-core: full-text search (FTS5) 2026-05-31 20:43:05 -07:00
tasks_and_links.rs heph-core: tasks, links, canonical-context doc 2026-05-31 19:02:35 -07:00