chore/plugin-implementer-cli-usage
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a7d96f208f |
feat: Phase 2 install auth gate (ADR-003 closeout) (#192)
* fix(e2e): guard marketplace webServer and exclude per-app tests from main Playwright config Root cause: playwright.config.ts unconditionally started the marketplace dev server at ../worldwideview-marketplace. In CI only worldwideview is checked out, so spawn() received a non-existent cwd which Node.js surfaces as "spawn /bin/sh ENOENT", crashing the entire test run before any browser launched. Two targeted fixes: 1. Wrap the marketplace webServer entry in fs.existsSync(MARKETPLACE_DIR) so CI skips it gracefully. Use playwright.marketplace.config.ts to run cross-app marketplace tests locally. 2. Add testIgnore for web-auth.spec.ts and marketplace-from-instance.spec.ts — both target sibling repos (worldwideview-web / worldwideview-marketplace) and have their own dedicated configs (playwright.web.config.ts / playwright.marketplace.config.ts). The main config should only exercise the worldwideview app itself. * feat(09-02): add playwright.cross-app.config.ts and .env.test for cross-origin specs - Add playwright.cross-app.config.ts with dual webServer array (wwv.local:3001 + marketplace.wwv.local:3002) - testMatch targets both upcoming cross-app spec files; baseURL set to marketplace.wwv.local:3002 - Create worldwideview/.env.test with PLAYWRIGHT_TEST_EMAIL + PLAYWRIGHT_TEST_PASSWORD (gitignored) - Add explicit .env.test entry to .gitignore (was not covered by existing .env/.env.local patterns) - Bump version 2.20.2 -> 2.21.0 (feat: minor) * feat(09-02): add cross-app Playwright specs for redirect handshake and sign-out (REQ-16) - Add marketplace-redirect-handshake.spec.ts: 2 tests verifying next= param construction and login-then-redirect-back flow - Add marketplace-sign-out.spec.ts: 1 test verifying avatar dropdown sign-out clears session and returns to marketplace home - Update playwright.cross-app.config.ts to load .env.test credentials via fs (no dotenv package required) - All specs target https://marketplace.wwv.local:3002 (never localhost:3002) for correct .wwv.local cookie domain - 3 tests total listed by playwright --list * feat: add planning-sync hook script for .planning branch isolation * fix: guard planning-sync against missing .planning, wrong repo, and silent checkout failures - Exit early if .planning/.git doesn't exist (avoids false-success on machines without the private repo) - Exit early if CWD is not a worldwideview repo or worktree (prevents syncing from wwv-data-engine etc.) - Wrap both checkout calls in exit-code checks so failures emit WARNING messages instead of false success * feat: add post-checkout hook for .planning auto-sync * fix: add existence guard to post-checkout hook before calling planning-sync * docs: add .planning branch convention to worktree-bootstrap skill * feat(11-01): add LegalFooter component and .legal-footer CSS class - Create src/components/layout/LegalFooter.tsx as a Server Component - Export named function LegalFooter with two external anchors - Both anchors use target="_blank" rel="noopener noreferrer" (T-11-01) - Links target locked URLs: privacy-policy and cloud-terms-of-service - Append .legal-footer + a + a:hover rules to globals.css - position:fixed bottom:0 z-index:10 per UI-SPEC - Bump version 2.23.2 -> 2.23.3 * feat(11-01): remove Vercel Analytics, mount LegalFooter in root layout - Remove @vercel/analytics/next import from layout.tsx (D-02) - Remove {process.env.VERCEL && <Analytics />} JSX (D-02, T-11-02) - Add import { LegalFooter } from @/components/layout/LegalFooter - Render <LegalFooter /> as last child of <body> (D-04) - Remove @vercel/analytics from dependencies in package.json - Regenerate pnpm-lock.yaml after dependency removal - AdSense block (lines 27-37) untouched per D-03 - Bump version 2.23.3 -> 2.23.4 * fix(worktree): fix link_planning hook path conversion for Windows Worktrunk substitutes {{ worktree_path }} as a Unix-style path (/c/dev/...) which cmd.exe cannot resolve. It also strips $ sigils from variable names before executing hook commands, making inline PowerShell variables unusable. Extract junction logic to .agents/scripts/link-planning.ps1 and unlink-planning.ps1. The hooks now call powershell -File with the path as an argument, avoiding both issues entirely. * docs: add ADR-004 and phase-2 implementation plans Adds the Supabase session cookies httponly ADR alongside the six implementation plan documents produced during the auth gate phase. * feat(auth): implement Phase 2 cloud auth gate (ADR-003 closeout) - Cloud edition login page redirects to NEXT_PUBLIC_AUTH_HOST_URL; local/demo editions keep the NextAuth credentials form - Delete signup pages and Supabase PKCE callback route from worldwideview (auth host owns them per ADR-003) - Add Supabase SSR helpers (cookieOptions, server, client) with httpOnly:true cookies per ADR-004 - Dual-dispatch install-redirect and grant-token: Supabase on cloud, NextAuth on local/demo; redirect param unified to ?next= - Add streaming mode to safeFetch for MJPEG camera proxy streams - Extract LoginForm into its own component - Update Playwright config to conditionally start marketplace dev server * fix(types): cast undici ReadableStream body to BodyInit to satisfy DOM types node:stream/web ReadableStream is structurally incompatible with the DOM ReadableStream expected by the Response constructor -- the pipeThrough signature differs on the T | undefined generic bound. Cast to BodyInit (which is the correct type for the streaming pass-through) to resolve the TS2345 error in ssrf.ts line 112. * fix(e2e): exclude cross-app marketplace specs from default Playwright run marketplace-redirect-handshake.spec.ts and marketplace-sign-out.spec.ts require a running marketplace.wwv.local:3002 instance (cross-app environment). They were being picked up by playwright.config.ts in CI where that host does not exist, causing ERR_NAME_NOT_RESOLVED failures. Added both files to testIgnore alongside the existing exclusions; they should be run via playwright.cross-app.config.ts only. * fix: add pointer event support to bottom panel resize for webkit Playwright's webkit engine dispatches pointermove/pointerup reliably during synthetic drags but mousemove sometimes does not fire. Add pointermove and pointerup listeners alongside the existing mouse listeners, and add onPointerDown to the drag handle, so the resize test passes across all three browser engines. |
||
|
|
02336e6a0a |
fix(security): Phase 3 audit blockers — PKCE cookie path + WsClient subscribe race (#190)
* fix(incidents): add mapWebsocketPayload default to BaseIncidentPlugin
Default unwraps three WsClient-visible payload shapes:
- scheduler envelope { source, fetchedAt, items, totalCount } -> items
- GeoJSON FeatureCollection { features: [...] } -> normalised GeoEntity[]
- flat GeoEntity[] -> passthrough (with timestamp normalisation)
Resolves the silent-drop bug that left the earthquakes plugin showing an empty
layer when the scheduler's standard wrapping was used. Subclasses can still
override mapWebsocketPayload for domain-specific shapes (iranwarlive pattern
preserved by 2 override tests).
Test deltas:
- 2 it.fails tests flipped to passing (scheduler-wrap, GeoJSON unwrap).
- 2 'currently drops' companion tests deleted (bug is fixed, companions obsolete).
- 1 structural test updated: 'does NOT have mapWebsocketPayload' -> 'has mapWebsocketPayload defined'.
- Net: 12 tests -> 10 tests, all passing.
* test(ssrf): replace placeholder assertions with real tests for DNS pinning and size limits
The two expect(true).toBe(true) stubs in ssrf.spec.ts are replaced with
assertions that verify actual SSRF guard behavior:
- "enforces maxSize" — mocks undici.fetch to return an 11-byte body with a
10-byte limit; verifies response.text() rejects with "size exceeded"
- "does not follow redirects" — mocks dns.lookup + undici.fetch; verifies
redirect:manual is passed, fetch is called once, and the 301 is returned
without being followed; also asserts dispatcher is set (DNS pinning)
Uses vi.hoisted + vi.mock to patch dns/promises and undici at module level.
360/360 tests pass.
* fix(security): close Phase 3 audit blockers and unregistered flags
- WsClient.ts: guard subscribe() against sending frames while awaitingWelcome=true;
prevents pre-auth subscribe race when a second plugin subscribes mid-handshake
- connect/route.ts + callback/route.ts: set PKCE cookie path="/" to satisfy
RFC 6265bis __Host- prefix requirement (Chromium silently rejects __Host- + path!=/)
- pkce.spec.ts: update assertion to match corrected path="/"
- docs/plans/03-SECURITY.md: security audit report (13 closed, 1 fixed, 3 flags filed)
|