@tidecloak/nextjs 0.13.30 → 0.13.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,9 +46,12 @@ npm install @tidecloak/nextjs
46
46
  - `useTideCloak()` - Hook for auth state and actions
47
47
  - `<Authenticated>` / `<Unauthenticated>` - UI guards
48
48
  - `createTideCloakMiddleware()` - Edge middleware for route protection
49
+ - `createTideCloakProxy()` - Node.js proxy for route protection (recommended on Next.js 16+)
49
50
  - `verifyTideCloakToken()` - Server-side JWT verification
50
51
  - `doEncrypt()` / `doDecrypt()` - Tag-based encryption
51
52
 
53
+ > **DPoP is enabled and enforced by default** (sender-constrained tokens). Pass `useDPoP: false` or `useDPoP: { mode: "auto" }` in your provider config to relax it — see the [`@tidecloak/js` DPoP docs](../tidecloak-js/docs/FRONT_CHANNEL.md#dpop-on-by-default).
54
+
52
55
  ---
53
56
 
54
57
  ## Mode-Specific Guides
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -13,10 +13,20 @@ function normalizePattern(pattern) {
13
13
  if (pattern === 'OPTIONS')
14
14
  return (_path, req) => req.method === 'OPTIONS';
15
15
  if (typeof pattern === 'string' && pattern.includes('*')) {
16
- // Escape regex chars, then replace '*' with '.*'
17
- const escaped = pattern
18
- .replace(/[-/\\^$+?.()|[\]{}]/g, '\\$&')
19
- .replace(/\\\*/g, '.*');
16
+ // Build the regex by escaping every literal segment between '*' wildcards and
17
+ // joining them with '.*'. (Escaping the whole string first does NOT work,
18
+ // because '*' is not a character we escape, so a later "\\*"->".*" pass would
19
+ // never match and the wildcard would be left as a literal regex quantifier.)
20
+ let escaped = pattern
21
+ .split('*')
22
+ .map((seg) => seg.replace(/[-/\\^$+?.()|[\]{}]/g, '\\$&'))
23
+ .join('.*');
24
+ // A trailing "/*" wildcard should also match the bare base path, so that
25
+ // e.g. "/admin/*" protects "/admin" as well as "/admin/anything". Without
26
+ // this the base path itself bypasses the role check.
27
+ if (pattern.endsWith('/*')) {
28
+ escaped = escaped.replace(/\\\/\.\*$/, '(?:\\/.*)?');
29
+ }
20
30
  const regex = new RegExp(`^${escaped}$`);
21
31
  return (path) => regex.test(path);
22
32
  }
@@ -6,8 +6,7 @@ const verify_1 = require("@tidecloak/verify");
6
6
  const routerMatcher_1 = require("./routerMatcher");
7
7
  const DEFAULTS = {
8
8
  protectedRoutes: {},
9
- onRequest: undefined,
10
- onSuccess: undefined,
9
+ cookieName: 'kcToken',
11
10
  };
12
11
  /**
13
12
  * Returns a Next.js Edge Middleware function enforcing TideCloak auth.
@@ -16,9 +15,9 @@ const DEFAULTS = {
16
15
  *
17
16
  * ```ts
18
17
  * import tidecloakConfig from './tidecloakAdapter.json'
19
- * import { createTideMiddleware } from 'tidecloak-nextjs/server/tidecloakMiddleware'
18
+ * import { createTideCloakMiddleware } from '@tidecloak/nextjs/server'
20
19
  *
21
- * export default createTideMiddleware({
20
+ * export default createTideCloakMiddleware({
22
21
  * config: tidecloakConfig,
23
22
  * protectedRoutes: {
24
23
  * '/admin/*': ['admin'],
@@ -44,7 +43,7 @@ function createTideCloakMiddleware(opts) {
44
43
  const path = req.nextUrl.pathname;
45
44
  try {
46
45
  // Extract the raw JWT from the specified cookie
47
- const token = ((_a = req.cookies.get("kcToken")) === null || _a === void 0 ? void 0 : _a.value) || null;
46
+ const token = ((_a = req.cookies.get(settings.cookieName)) === null || _a === void 0 ? void 0 : _a.value) || null;
48
47
  // Allow custom logic before auth checks
49
48
  if (settings.onRequest) {
50
49
  const result = settings.onRequest({ token }, req);
@@ -57,10 +56,14 @@ function createTideCloakMiddleware(opts) {
57
56
  // Verify signature, issuer, and presence of at least one allowed role
58
57
  const payload = await (0, verify_1.verifyTideCloakToken)(settings.config, token, roles);
59
58
  if (!payload) {
60
- // Custom onFailure hook or default redirect
61
- const result = settings.onFailure({ token }, req);
62
- if (result)
63
- return result;
59
+ // Custom onFailure hook if provided; otherwise fall through to the
60
+ // default 403. (onFailure is optional, so it must be guarded — calling
61
+ // it unconditionally would throw on the common no-hook configuration.)
62
+ if (settings.onFailure) {
63
+ const result = settings.onFailure({ token }, req);
64
+ if (result)
65
+ return result;
66
+ }
64
67
  return server_1.NextResponse.json({ error: '[TideCloak Middleware] Access forbidden: invalid token' }, { status: 403 });
65
68
  }
66
69
  // Custom onSuccess hook if provided
@@ -6,8 +6,7 @@ const verify_1 = require("@tidecloak/verify");
6
6
  const routerMatcher_1 = require("./routerMatcher");
7
7
  const DEFAULTS = {
8
8
  protectedRoutes: {},
9
- onRequest: undefined,
10
- onSuccess: undefined,
9
+ cookieName: 'kcToken',
11
10
  };
12
11
  /**
13
12
  * Returns a Next.js 16+ Proxy function enforcing TideCloak auth.
@@ -44,7 +43,7 @@ function createTideCloakProxy(opts) {
44
43
  const path = req.nextUrl.pathname;
45
44
  try {
46
45
  // Extract the raw JWT from the specified cookie
47
- const token = ((_a = req.cookies.get("kcToken")) === null || _a === void 0 ? void 0 : _a.value) || null;
46
+ const token = ((_a = req.cookies.get(settings.cookieName)) === null || _a === void 0 ? void 0 : _a.value) || null;
48
47
  // Allow custom logic before auth checks
49
48
  if (settings.onRequest) {
50
49
  const result = settings.onRequest({ token }, req);
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -9,10 +9,20 @@ export function normalizePattern(pattern) {
9
9
  if (pattern === 'OPTIONS')
10
10
  return (_path, req) => req.method === 'OPTIONS';
11
11
  if (typeof pattern === 'string' && pattern.includes('*')) {
12
- // Escape regex chars, then replace '*' with '.*'
13
- const escaped = pattern
14
- .replace(/[-/\\^$+?.()|[\]{}]/g, '\\$&')
15
- .replace(/\\\*/g, '.*');
12
+ // Build the regex by escaping every literal segment between '*' wildcards and
13
+ // joining them with '.*'. (Escaping the whole string first does NOT work,
14
+ // because '*' is not a character we escape, so a later "\\*"->".*" pass would
15
+ // never match and the wildcard would be left as a literal regex quantifier.)
16
+ let escaped = pattern
17
+ .split('*')
18
+ .map((seg) => seg.replace(/[-/\\^$+?.()|[\]{}]/g, '\\$&'))
19
+ .join('.*');
20
+ // A trailing "/*" wildcard should also match the bare base path, so that
21
+ // e.g. "/admin/*" protects "/admin" as well as "/admin/anything". Without
22
+ // this the base path itself bypasses the role check.
23
+ if (pattern.endsWith('/*')) {
24
+ escaped = escaped.replace(/\\\/\.\*$/, '(?:\\/.*)?');
25
+ }
16
26
  const regex = new RegExp(`^${escaped}$`);
17
27
  return (path) => regex.test(path);
18
28
  }
@@ -3,8 +3,7 @@ import { verifyTideCloakToken } from '@tidecloak/verify';
3
3
  import { normalizeProtectedRoutes } from './routerMatcher';
4
4
  const DEFAULTS = {
5
5
  protectedRoutes: {},
6
- onRequest: undefined,
7
- onSuccess: undefined,
6
+ cookieName: 'kcToken',
8
7
  };
9
8
  /**
10
9
  * Returns a Next.js Edge Middleware function enforcing TideCloak auth.
@@ -13,9 +12,9 @@ const DEFAULTS = {
13
12
  *
14
13
  * ```ts
15
14
  * import tidecloakConfig from './tidecloakAdapter.json'
16
- * import { createTideMiddleware } from 'tidecloak-nextjs/server/tidecloakMiddleware'
15
+ * import { createTideCloakMiddleware } from '@tidecloak/nextjs/server'
17
16
  *
18
- * export default createTideMiddleware({
17
+ * export default createTideCloakMiddleware({
19
18
  * config: tidecloakConfig,
20
19
  * protectedRoutes: {
21
20
  * '/admin/*': ['admin'],
@@ -41,7 +40,7 @@ export function createTideCloakMiddleware(opts) {
41
40
  const path = req.nextUrl.pathname;
42
41
  try {
43
42
  // Extract the raw JWT from the specified cookie
44
- const token = ((_a = req.cookies.get("kcToken")) === null || _a === void 0 ? void 0 : _a.value) || null;
43
+ const token = ((_a = req.cookies.get(settings.cookieName)) === null || _a === void 0 ? void 0 : _a.value) || null;
45
44
  // Allow custom logic before auth checks
46
45
  if (settings.onRequest) {
47
46
  const result = settings.onRequest({ token }, req);
@@ -54,10 +53,14 @@ export function createTideCloakMiddleware(opts) {
54
53
  // Verify signature, issuer, and presence of at least one allowed role
55
54
  const payload = await verifyTideCloakToken(settings.config, token, roles);
56
55
  if (!payload) {
57
- // Custom onFailure hook or default redirect
58
- const result = settings.onFailure({ token }, req);
59
- if (result)
60
- return result;
56
+ // Custom onFailure hook if provided; otherwise fall through to the
57
+ // default 403. (onFailure is optional, so it must be guarded — calling
58
+ // it unconditionally would throw on the common no-hook configuration.)
59
+ if (settings.onFailure) {
60
+ const result = settings.onFailure({ token }, req);
61
+ if (result)
62
+ return result;
63
+ }
61
64
  return NextResponse.json({ error: '[TideCloak Middleware] Access forbidden: invalid token' }, { status: 403 });
62
65
  }
63
66
  // Custom onSuccess hook if provided
@@ -3,8 +3,7 @@ import { verifyTideCloakToken } from '@tidecloak/verify';
3
3
  import { normalizeProtectedRoutes } from './routerMatcher';
4
4
  const DEFAULTS = {
5
5
  protectedRoutes: {},
6
- onRequest: undefined,
7
- onSuccess: undefined,
6
+ cookieName: 'kcToken',
8
7
  };
9
8
  /**
10
9
  * Returns a Next.js 16+ Proxy function enforcing TideCloak auth.
@@ -41,7 +40,7 @@ export function createTideCloakProxy(opts) {
41
40
  const path = req.nextUrl.pathname;
42
41
  try {
43
42
  // Extract the raw JWT from the specified cookie
44
- const token = ((_a = req.cookies.get("kcToken")) === null || _a === void 0 ? void 0 : _a.value) || null;
43
+ const token = ((_a = req.cookies.get(settings.cookieName)) === null || _a === void 0 ? void 0 : _a.value) || null;
45
44
  // Allow custom logic before auth checks
46
45
  if (settings.onRequest) {
47
46
  const result = settings.onRequest({ token }, req);
@@ -1 +1 @@
1
- {"version":3,"file":"routerMatcher.d.ts","sourceRoot":"","sources":["../../../src/server/routerMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAEzD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,GACpB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAcjD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,kBAAuB,GAC3B,KAAK,CAAC;IACP,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC;IACtD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC,CAKD"}
1
+ {"version":3,"file":"routerMatcher.d.ts","sourceRoot":"","sources":["../../../src/server/routerMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;AAEzD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,YAAY,GACpB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAwBjD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,kBAAuB,GAC3B,KAAK,CAAC;IACP,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC;IACtD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC,CAKD"}
@@ -3,10 +3,14 @@ import { ProtectedRoutesMap } from './routerMatcher';
3
3
  interface JWK {
4
4
  kid: string;
5
5
  kty: string;
6
- alg: string;
7
- use: string;
8
- crv: string;
9
- x: string;
6
+ alg?: string;
7
+ use?: string;
8
+ crv?: string;
9
+ x?: string;
10
+ y?: string;
11
+ n?: string;
12
+ e?: string;
13
+ [key: string]: unknown;
10
14
  }
11
15
  export interface TidecloakConfig {
12
16
  realm: string;
@@ -32,6 +36,8 @@ export interface TideMiddlewareOptions {
32
36
  config: TidecloakConfig;
33
37
  /** Routes requiring a verified token and specific roles */
34
38
  protectedRoutes?: ProtectedRoutesMap;
39
+ /** Name of the cookie that holds the access token (defaults to `"kcToken"`) */
40
+ cookieName?: string;
35
41
  /** Called before any auth logic; return a Response to short‑circuit */
36
42
  onRequest?: (ctx: {
37
43
  token: string | null;
@@ -54,9 +60,9 @@ export interface TideMiddlewareOptions {
54
60
  *
55
61
  * ```ts
56
62
  * import tidecloakConfig from './tidecloakAdapter.json'
57
- * import { createTideMiddleware } from 'tidecloak-nextjs/server/tidecloakMiddleware'
63
+ * import { createTideCloakMiddleware } from '@tidecloak/nextjs/server'
58
64
  *
59
- * export default createTideMiddleware({
65
+ * export default createTideCloakMiddleware({
60
66
  * config: tidecloakConfig,
61
67
  * protectedRoutes: {
62
68
  * '/admin/*': ['admin'],
@@ -1 +1 @@
1
- {"version":3,"file":"tidecloakMiddleware.d.ts","sourceRoot":"","sources":["../../../src/server/tidecloakMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAEL,kBAAkB,EACnB,MAAM,iBAAiB,CAAA;AAExB,UAAU,GAAG;IACT,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAA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MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;KAAE,EAAE,GAAG,EAAE,WAAW,KAAK,YAAY,GAAG,IAAI,CAAA;IAC5F,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,GAAG,EAAE,WAAW,KAAK,YAAY,GAAG,IAAI,CAAA;IACpF,wDAAwD;IACxD,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,WAAW,KAAK,YAAY,CAAA;CACvD;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,qBAAqB,IAMlC,KAAK,WAAW,oCAwDlD"}
@@ -1 +1 @@
1
- {"version":3,"file":"tidecloakProxy.d.ts","sourceRoot":"","sources":["../../../src/server/tidecloakProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAMvD,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAGnF,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAA;AAQpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,IAM7B,KAAK,WAAW,oCAqD7C"}
1
+ {"version":3,"file":"tidecloakProxy.d.ts","sourceRoot":"","sources":["../../../src/server/tidecloakProxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAMvD,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAGnF,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,CAAA;AAEtD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAA;AAOpD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,IAM7B,KAAK,WAAW,oCAqD7C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tidecloak/nextjs",
3
- "version": "0.13.30",
3
+ "version": "0.13.32",
4
4
  "description": "TideCloak nextjs SDK",
5
5
  "exports": {
6
6
  ".": {
@@ -41,18 +41,19 @@
41
41
  "nextjs"
42
42
  ],
43
43
  "peerDependencies": {
44
- "next": "^16.0.1",
45
- "react": "^19.2.0"
44
+ "next": ">=13.5.0",
45
+ "react": ">=18.0.0"
46
46
  },
47
47
  "scripts": {
48
48
  "build:cjs": "tsc -p tsconfig.cjs.json",
49
49
  "build:esm": "tsc -p tsconfig.esm.json",
50
- "build": "npm run build:cjs && npm run build:esm",
50
+ "build": "npm run build:cjs && npm run build:esm && node scripts/postbuild.cjs",
51
+ "test": "npm run build && node --test test/*.test.mjs",
51
52
  "prepare": "npm run build"
52
53
  },
53
54
  "dependencies": {
54
- "@tidecloak/react": "^0.13.30",
55
- "@tidecloak/verify": "^0.13.30"
55
+ "@tidecloak/react": "^0.13.32",
56
+ "@tidecloak/verify": "^0.13.32"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/node": "^22.0.0",