Commit Graph
5 Commits
Author SHA1 Message Date
weishu 59a486ba88 feat: passkey sign-in for the iOS and Android apps
Native apps cannot follow a self-hosted hub's domain (entitlements and
asset links are fixed at build time), so they use one shared RP ID,
hapi.run, and every hub accepts it only from exact app origins.

- hub: `{"client":"native"}` on the passkey option routes selects the
  native RP; origins are https://hapi.run (iOS/macOS) and the official
  android:apk-key-hash values, extendable via HAPI_PASSKEY_NATIVE_ORIGINS
  (HAPI_PASSKEY_NATIVE_RP_ID for forks). Native login options restrict
  allowCredentials to this hub's passkeys. Accept a null
  authenticatorAttachment.
- website: publish apple-app-site-association (webcredentials for
  XJB862F92W.run.hapi.app) and assetlinks.json (get_login_creds for
  run.hapi.companion; signing fingerprint still a TODO placeholder).
- iOS: webcredentials:hapi.run, AuthenticationServices ceremonies,
  passkey-only sign-in on the pairing screen, Settings → Passkeys, and a
  passkey-session credential kind used by silent re-auth.
- Android: Credential Manager 1.6.0, the same flows and credential kind,
  and README notes on computing the apk-key-hash origin.
- docs: native passkey contract and user guide.
2026-11-16 17:24:04 +08:00
weishu 809967b7c6 feat: sign in to the web app with passkeys
Add WebAuthn passkeys as another way to obtain a web JWT, so the browser
no longer has to keep CLI_API_TOKEN after the first sign-in.

- hub: passkey_credentials table (schema v36), register/list/delete
  routes behind the JWT, unauthenticated login routes with one-time
  challenges, and a 30-day passkey session exchanged via POST /api/auth.
  Passkeys are bound to the registering namespace, the browser origin
  (same host or an explicit CORS origin; HTTPS or localhost), and an
  HMAC fingerprint of CLI_API_TOKEN, so rotating the token revokes them.
- web: "Sign in with a passkey" on the login screen, Settings → Passkeys,
  passkey auth source with silent JWT refresh, en/zh-CN/ru strings.
- docs: client contract, hub README, PWA guide.
2026-11-16 16:48:05 +08:00
weishu 051dbbd7da docs: refresh native app guides and contracts 2026-09-13 10:43:59 +08:00
weishu 1de9613df6 docs: align documentation with current implementation 2026-09-12 22:19:32 +08:00
weishu 16ebba12e8 docs(api): add native client contract (auth, rest, errors) 2026-08-17 11:15:00 +08:00