improvement(desktop): sign-in prompts for the agent browser — site passwords, passkey accounts, client certificates, and app links

Merged
WA
7d ago
+2422-33

Summary

  • Site passwords (HTTP basic/digest + proxy): there was no login handler, so these silently cancelled and sites showed a bare 401. Agent tabs now get a Chrome-style prompt — only for the tab's own top-level navigation (or a proxy), origin shown, no server-chosen realm text, "not private" warning on http, re-prompt on a wrong password, capped per tab+origin across reloads. Credentials are never logged or persisted; the agent can't answer it and is told to wait
  • Passkey account picker: registers select-webauthn-account; without it Electron cancelled every usernameless (discoverable) security-key sign-in even with one account
  • Client certificates: Electron silently sent the first certificate to any agent-browser site that asked. Now nothing is sent unless the user picks one (subject, issuer, expiry); choices are remembered per session+host until restart. The main app window is unchanged
  • App links (Zoom, Teams, Slack, Okta Verify, mailto…): were silently cancelled. Now: a user click shows "Open ?" naming the origin (Open armed after 500 ms); a page that launches on load gets a passive notice; agent input never launches; iframe-initiated launches are refused; hard denylist (file, smb, ms-msdt, search-ms, ms-officecmd, jnlp, …), registered handler required, rebuilt URL only, rate-limited; all launches go through openExternalSafe
  • Keyjacking-safe: picker prompts have no preselection, Enter dismisses, Continue is armed after a delay, and they never steal focus
  • Sign-out clears the HTTP auth cache and remembered certificate/always-allow decisions
  • Removes the unused Bluetooth entitlement and usage string (Electron never starts the WebAuthn phone flow)
  • Version skew: the renderer opts in via enable-page-dialogs { pagePrompts: true }; an older renderer gets today's behaviour (everything refused), an older shell ignores the flag

Type of Change

  • Improvement

Testing

  • New apps/desktop/e2e/browser-sign-in-prompts.spec.ts (10 checks, JSON report): older renderer still refuses; basic auth prompt/retry/sign-in; cross-origin subresource never prompts; agent navigation waits for the user; agent clicks never launch; user click prompts and opens only on Open; on-load launch gets the passive notice; rate limit; denied schemes never open; passkey picker via CDP virtual authenticator (stray Enter refuses)
  • page-prompts.test.ts: URL validation/denylist, auth decision, certificate flow, frame attribution, reset on sign-out, single-launch-per-prompt
  • Red→green for every guard by reverting it
  • session/ipc/driver/security-guards/navigation/context-menu suites, browser-tools popup tests, browser-page-parity; desktop tsc, targeted apps/sim type-check, biome; full gate in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)