@nestjs-kitchen/authz 4.0.0 → 4.0.1
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
|
@@ -31,22 +31,37 @@ Simplest authentication & authorization module in NextJS.
|
|
|
31
31
|
Once completed NestJS project setup, install this package and its dependencies:
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
|
-
$ npm install
|
|
34
|
+
$ npm install @nestjs-kitchen/authz -D @types/jsonwebtoken
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
## Platform support
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
This package supports multiple platforms (adapters).
|
|
40
|
+
You only need to install the adapter(s) you plan to use.
|
|
40
41
|
|
|
41
|
-
-
|
|
42
|
+
- `@nestjs/platform-express`:
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
Requires [`express-session`](https://www.npmjs.com/package/express-session):
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
```bash
|
|
47
|
+
$ npm install express-session -D @types/express-session
|
|
48
|
+
```
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
- `@nestjs/platform-fastify`:
|
|
48
51
|
|
|
49
|
-
|
|
52
|
+
Requires either:
|
|
53
|
+
|
|
54
|
+
1. [`@fastify/cookie`](https://www.npmjs.com/package/@fastify/cookie) with [`@fastify/session`](https://www.npmjs.com/package/@fastify/session):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
$ npm install @fastify/cookie @fastify/session
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Or [`@fastify/secure-session`](https://www.npmjs.com/package/@fastify/secure-session) instead:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
$ npm install @fastify/secure-session
|
|
64
|
+
```
|
|
50
65
|
|
|
51
66
|
## Beark change
|
|
52
67
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { AuthzModuleBaseOptions } from '../utils';
|
|
2
|
-
export type
|
|
2
|
+
export type ExtraSessionOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Option to keep session information after regenerating.
|
|
5
|
+
*/
|
|
3
6
|
session?: {
|
|
4
7
|
/**
|
|
5
|
-
* Option to keep session information after regenerating.
|
|
6
|
-
*
|
|
7
8
|
* Same as `passportjs` [keepSessionInfo](https://github.com/jaredhanson/passport/blob/217018dbc46dcd4118dd6f2c60c8d97010c587f8/CHANGELOG.md#L18).
|
|
8
9
|
*/
|
|
9
10
|
keepSessionInfo?: boolean;
|
|
10
11
|
};
|
|
11
12
|
};
|
|
13
|
+
export type SessionAuthzModuleOptions = Partial<AuthzModuleBaseOptions> & ExtraSessionOptions;
|
|
12
14
|
export declare const normalizedSessionAuthzModuleOptions: (options?: Partial<SessionAuthzModuleOptions>) => {
|
|
13
15
|
defaultOverride: boolean;
|
|
14
16
|
passportProperty: string;
|
|
@@ -8,11 +8,7 @@ import { type SessionAuthzModuleOptions, type SessionAuthzOptions } from './sess
|
|
|
8
8
|
import { type SessionAlsType } from './session-authz-als.middleware';
|
|
9
9
|
declare const ASYNC_OPTIONS_TYPE: ConfigurableModuleAsyncOptions<SessionAuthzModuleOptions, "createSessionAuthzModuleOptions"> & Partial<{
|
|
10
10
|
authzProvider?: Type<AuthzProviderClass<unknown, unknown>>;
|
|
11
|
-
} & AuthzModuleRoutesOptions>, OPTIONS_TYPE: Partial<AuthzModuleBaseOptions> & {
|
|
12
|
-
session?: {
|
|
13
|
-
keepSessionInfo?: boolean;
|
|
14
|
-
};
|
|
15
|
-
} & Partial<{
|
|
11
|
+
} & AuthzModuleRoutesOptions>, OPTIONS_TYPE: Partial<AuthzModuleBaseOptions> & import("./session-authz.interface").ExtraSessionOptions & Partial<{
|
|
16
12
|
authzProvider?: Type<AuthzProviderClass<unknown, unknown>>;
|
|
17
13
|
} & AuthzModuleRoutesOptions>;
|
|
18
14
|
/**
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@nestjs-kitchen/authz",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "Simplest authentication & authorization module in NextJS",
|
|
5
|
-
"version": "4.0.
|
|
5
|
+
"version": "4.0.1",
|
|
6
6
|
"homepage": "https://github.com/yikenman/nestjs-kitchen",
|
|
7
7
|
"repository": "https://github.com/yikenman/nestjs-kitchen",
|
|
8
8
|
"author": "yikenman",
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
"@types/express": "^5.0.1",
|
|
36
36
|
"@types/express-session": "^1.18.2",
|
|
37
37
|
"@types/jest": "^30.0.0",
|
|
38
|
-
"@types/jsonwebtoken": "^9.0.9",
|
|
39
38
|
"@types/node": "^22.13.9",
|
|
40
39
|
"@types/supertest": "^6.0.2",
|
|
41
40
|
"express-session": "^1.18.2",
|
|
@@ -65,21 +64,18 @@
|
|
|
65
64
|
"NodeJS",
|
|
66
65
|
"Session"
|
|
67
66
|
],
|
|
68
|
-
"optionalDependencies": {
|
|
69
|
-
"@fastify/cookie": "^11.0.2",
|
|
70
|
-
"@fastify/secure-session": "^8.2.0",
|
|
71
|
-
"@fastify/session": "^11.1.0",
|
|
72
|
-
"@nestjs/platform-express": "^11.0.0",
|
|
73
|
-
"@nestjs/platform-fastify": "^11.0.0",
|
|
74
|
-
"@types/express-session": "^1.18.2",
|
|
75
|
-
"express-session": "^1.18.2"
|
|
76
|
-
},
|
|
77
67
|
"peerDependencies": {
|
|
78
68
|
"@nestjs/common": "^11.0.0",
|
|
79
69
|
"@nestjs/core": "^11.0.0",
|
|
70
|
+
"@types/jsonwebtoken": "^9.0.9",
|
|
80
71
|
"reflect-metadata": "^0.2.2",
|
|
81
72
|
"rxjs": "^7.8.2"
|
|
82
73
|
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"@types/jsonwebtoken": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
83
79
|
"scripts": {
|
|
84
80
|
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
85
81
|
"dev": "rimraf dist && tsc -p tsconfig.build.json --watch",
|