Skip to content

Commit 7b3f1dd

Browse files
authored
Merge pull request #7 from Enalmada/changeset-release/main
Version Packages
2 parents 4866e9a + e359d81 commit 7b3f1dd

3 files changed

Lines changed: 34 additions & 33 deletions

File tree

.changeset/middleware-nonce-support.md

Lines changed: 0 additions & 32 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# Changelog
22

3+
## 1.0.0
4+
5+
### Major Changes
6+
7+
- d95f3dd: Add native middleware pattern with per-request nonce generation for TanStack Start applications. This is a major update that introduces a new recommended API while maintaining backward compatibility.
8+
9+
**New Features:**
10+
11+
- `createCspMiddleware()` - Middleware factory for TanStack Start with per-request nonce generation
12+
- `createNonceGetter()` - Isomorphic nonce retrieval (works on server and client)
13+
- `generateNonce()` - Cryptographically secure random nonce generator
14+
- `buildCspHeader()` - Low-level CSP header building utility
15+
- CSP Level 3 support with automatic granular directive copying (`-elem`, `-attr`)
16+
- Strict nonce-based CSP for scripts (no `'unsafe-inline'` in production)
17+
- Integration with TanStack router's native `ssr.nonce` option
18+
19+
**Breaking Changes:**
20+
21+
- This release is a major version because it introduces a new peer dependency: `@tanstack/start-storage-context >= 1.0.0`
22+
- The recommended API has changed from handler wrapper (`createSecureHandler`) to middleware pattern (`createCspMiddleware`)
23+
- Projects should migrate to the new API for better security (per-request nonces vs static headers)
24+
25+
**Migration:**
26+
27+
The old `createSecureHandler` API is still available and fully functional, but is now deprecated. See README for migration guide from v0.1 to v0.2.
28+
29+
**Security Improvements:**
30+
31+
- Per-request nonce generation (previously static at startup)
32+
- No `'unsafe-inline'` fallback for scripts in production
33+
- Support for `'strict-dynamic'` CSP directive
34+
- Automatic nonce application to all TanStack framework scripts
35+
336
## 0.1.2
437

538
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enalmada/start-secure",
3-
"version": "0.1.2",
3+
"version": "1.0.0",
44
"scripts": {
55
"build": "bun run type-check && bun run clean && bun run build:bundle && bun run build:declaration",
66
"build:bundle": "bun build.ts",

0 commit comments

Comments
 (0)