Skip to content

Commit 5671eec

Browse files
auge2uclaude
andcommitted
chore: bump marketplace to v0.5.0 — security hardening + schema split
Covers all P0–P3 findings from comprehensive security review: RLS fix, auth graduation fix, CORS/CSP/rate-limiting, schema split, named constants, PostHog SSR guard, dark mode alignment, doc fixes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2253b48 commit 5671eec

3 files changed

Lines changed: 39 additions & 3 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
},
77
"metadata": {
88
"description": "Guided workflow for deploying multi-tenant SaaS on the Platform4Sync standard stack",
9-
"version": "0.4.2"
9+
"version": "0.5.0"
1010
},
1111
"plugins": [
1212
{
1313
"name": "webplatform4sync",
1414
"source": "./",
1515
"description": "Platform4Sync skill surface for multi-tenant SaaS on Cloudflare + Neon. Choose your frame: Construction (site → pour → frame → wire → finish) or Shu-Ha-Ri (shu → ha → ri). Same tools, different approaches. Includes diagnose-tokens diagnostic for silent failure detection.",
16-
"version": "0.4.2",
16+
"version": "0.5.0",
1717
"keywords": ["multi-tenant", "saas", "cloudflare-workers", "neon-postgres", "firebase", "design-tokens", "themes", "cultural-design", "construction-frame", "shu-ha-ri", "command-frames"]
1818
},
1919
{

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webplatform4sync",
3-
"version": "0.4.2",
3+
"version": "0.5.0",
44
"description": "Platform4Sync skill surface with command frames — same tools, different approaches",
55
"frames": {
66
"construction": {

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,42 @@ All notable changes to Platform4Sync will be documented in this file.
44

55
This project adheres to [Semantic Versioning](https://semver.org/).
66

7+
## [0.5.0] - 2026-02-22
8+
9+
### Security Hardening
10+
11+
- **RLS tenant isolation fix** — replaced broken `setTenantContext()` with transactional `tenantQuery()` wrapper. Neon HTTP driver executes each query as a separate HTTP request, so `set_config()` must be in the same Drizzle transaction as the data queries.
12+
- **Auth graduation account takeover fix**`graduateFromOAuth` now checks provider linkage before merging accounts, preventing email-based account takeover.
13+
- **`verifyBetterAuthSession` implementation** — replaced stub with working session verification.
14+
- **CORS hardening** — omit CORS headers entirely for disallowed origins; localhost only allowed when `ENVIRONMENT === "development"`.
15+
- **Security headers** — added `Strict-Transport-Security`, `X-Content-Type-Options`, `X-Frame-Options`, `Referrer-Policy`, `Permissions-Policy`, and `Content-Security-Policy` to all responses.
16+
- **Rate limiting** — KV-based rate limiting on `/api/auth/` endpoints (20 req/min per IP).
17+
- **CSRF protection** — Origin-check middleware for custom API routes.
18+
- **Session fixation prevention**`onSessionCreated` callback in graduation bridge for post-creation session regeneration.
19+
20+
### Schema & Data Model
21+
22+
- **Schema split** — separated `platformSchema` (tenant infrastructure: tenants, domain_mappings, tenant_relationships) from `appSchema` (application tables). Platform tables live in the `platform` schema, app tables in `{{SCHEMA_NAME}}`.
23+
- **Domain verification** — changed `verified: boolean` to `verifiedAt: timestamp` on `domain_mappings` for audit trail.
24+
- **Runtime validation**`rowToTenantContext` now validates tier, status, and isolation_mode values at runtime with descriptive errors.
25+
- **Slug format validation** — DNS-safe slug regex check before database lookup.
26+
27+
### Quality Improvements
28+
29+
- **Named constants** — session durations extracted to `shared/contracts/constants.ts` (SESSION_TTL_SECONDS, SESSION_REFRESH_SECONDS, PREVIEW_SESSION_TTL_SECONDS), replacing inline magic numbers across auth, graduation, and middleware files.
30+
- **PostHog SSR guard**`posthog.ts` now returns early when `typeof window === "undefined"`, preventing server-side crashes.
31+
- **Dark mode alignment** — scaffold CSS uses `[data-theme="dark"]` selector matching the contracts' default `'class'` strategy.
32+
- **Request ID**`X-Request-ID` header on every response via `crypto.randomUUID()` for log correlation.
33+
- **`--token-` prefix removed** — eliminated phantom two-layer CSS variable convention from 4 docs. Scaffold correctly uses single-layer `--color-*` vars with Tailwind v4.
34+
- **Drizzle config** — added `"platform"` to `schemaFilter` array.
35+
- **tsconfig cleanup** — removed dead `declaration` and `declarationMap` options (no-ops under `noEmit`).
36+
- **Documentation fixes** — corrected stale TypeScript/Tailwind versions in architecture docs, fixed `isolation-modes.md` argument count, added missing scaffold placeholder docs, added `shared/contracts/` to CLAUDE.md repo structure.
37+
38+
### Changed
39+
40+
- **Plugin metadata** bumped to v0.5.0 in `plugin.json` and `marketplace.json`.
41+
- **Scrubbed sync** from `hn-platform4sync` — all scaffold, skill, shared, and doc changes propagated to public marketplace.
42+
743
## [0.4.2] - 2026-02-21
844

945
### Added

0 commit comments

Comments
 (0)