You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(ext): send coarse-gate bearer header from backend calls (F: endpoint-auth-01 P2)
Phase 2 of the endpoint bearer-auth rollout: teach the Chrome extension to
SEND `Authorization: Bearer <FINGPT_API_KEY>` on every backend call while its
routes are still open — harmless now, required before Phase 3 flips the 14
extension views to enforced (a public extension can't be updated atomically,
so the header must propagate to installs first).
- webpack: add DefinePlugin baking process.env.FINGPT_API_KEY into the bundle
(empty in local/dev builds; there was no build-injection machinery to reuse).
- backendConfig.js: add getAuthHeaders() + build-time COARSE_GATE_KEY constant.
A public bundle is extractable -> this is a coarse drive-by-abuse gate, NOT
per-user auth (that is deferred to the api/identity.py login system).
- Spread ...getAuthHeaders() into all 13 backend fetch header objects across
api.js (10), config.js (1), components/link_manager.js (2). The xbrl
<a download> is left untouched (exempt route, cannot carry a header).
Verified: `FINGPT_API_KEY=devkey bun run build:full` bakes the literal once; a
keyless build omits it (dev sends no header). Live DevTools on-the-wire check
is the manual E2E handoff.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpjVcdhE4vq5CSEY7xmnpf
* refactor(ext): route the 13 backend calls through a single authFetch() (simplify P2)
/simplify pass on #355: the coarse-gate bearer header + credentials:'include'
were hand-spliced into all 13 backend fetch sites in three stylistic variants.
Centralize both into one authFetch(url, options) wrapper in backendConfig.js so
the credentialed-session + Authorization pairing lives on one enforced path — a
future 14th call site (or an edit to one of the 13) can no longer silently drop
either. Behavior-preserving: every method/body/signal/Content-Type/Accept passes
through untouched; getAuthHeaders() and the DefinePlugin key-bake are unchanged.
Verified: keyless build bakes 0 keys, FINGPT_API_KEY=devkey build bakes exactly 1;
backendConfig/sse tests 17/0; the 2 XSS/DOMPurify suite failures pre-exist (env).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpjVcdhE4vq5CSEY7xmnpf
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments