@nestjs-kitchen/authz 1.1.2 → 2.0.0
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/dist/index.js
CHANGED
|
@@ -15,8 +15,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var index_exports = {};
|
|
19
|
+
__export(index_exports, {
|
|
20
20
|
AuthzAnonymousError: () => import_errors.AuthzAnonymousError,
|
|
21
21
|
AuthzError: () => import_errors.AuthzError,
|
|
22
22
|
AuthzProviderClass: () => import_authz.AuthzProviderClass,
|
|
@@ -26,7 +26,7 @@ __export(src_exports, {
|
|
|
26
26
|
cereateSessionAuthzModule: () => import_session.cereateSessionAuthzModule,
|
|
27
27
|
createJwtAuthzModule: () => import_jwt.createJwtAuthzModule
|
|
28
28
|
});
|
|
29
|
-
module.exports = __toCommonJS(
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
30
|
var import_authz = require("./authz.provider");
|
|
31
31
|
var import_user = require("./user.decorator");
|
|
32
32
|
var import_errors = require("./errors");
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './extract-jwt.js';
|
|
2
2
|
import * as _nestjs_core from '@nestjs/core';
|
|
3
|
-
import {
|
|
3
|
+
import { JwtOptions, JwtAuthzModuleOptions, JwtAuthzOptions } from './jwt-authz.interface.js';
|
|
4
4
|
import { AuthzProviderClass } from '../authz.provider.js';
|
|
5
|
-
import { AbstractConstructor, RoutesOptions, AuthzDecoParams, MethodParameters, ApplyDecorators, CookieOptionsWithSecret, DeepReadonly
|
|
5
|
+
import { AbstractConstructor, RoutesOptions, AuthzModuleBaseOptions, AuthzModuleRoutesOptions, AuthzDecoParams, MethodParameters, ApplyDecorators, CookieOptionsWithSecret, DeepReadonly } from '../utils/types.js';
|
|
6
6
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
7
7
|
import * as _nestjs_common from '@nestjs/common';
|
|
8
|
-
import { MiddlewareConsumer,
|
|
8
|
+
import { MiddlewareConsumer, Type, DynamicModule } from '@nestjs/common';
|
|
9
9
|
import { AuthzError } from '../errors.js';
|
|
10
10
|
import { JwtAlsType } from './jwt-authz-als.middleware.js';
|
|
11
11
|
import 'cookie';
|
|
@@ -226,7 +226,7 @@ const createJwtAuthzModule = /* @__PURE__ */ __name((authzProvider) => {
|
|
|
226
226
|
}
|
|
227
227
|
configure(consumer) {
|
|
228
228
|
consumer.apply(JwtAuthzAlsMiddleware).exclude(...this.routesOpt.excludes).forRoutes(...this.routesOpt.global ? [
|
|
229
|
-
"*"
|
|
229
|
+
"{*splat}"
|
|
230
230
|
] : this.routesOpt.routes);
|
|
231
231
|
}
|
|
232
232
|
}, __name(_a, "JwtAuthzModule"), _a);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as _nestjs_core from '@nestjs/core';
|
|
2
|
-
import { SessionAuthzOptions,
|
|
2
|
+
import { SessionAuthzOptions, SessionOptions, SessionAuthzModuleOptions } from './session-authz.interface.js';
|
|
3
3
|
import { AuthzProviderClass } from '../authz.provider.js';
|
|
4
|
-
import { AbstractConstructor, RoutesOptions, AuthzDecoParams, MethodParameters, ApplyDecorators, CookieOptionsWithSecret, DeepReadonly
|
|
4
|
+
import { AbstractConstructor, RoutesOptions, AuthzModuleBaseOptions, AuthzModuleRoutesOptions, AuthzDecoParams, MethodParameters, ApplyDecorators, CookieOptionsWithSecret, DeepReadonly } from '../utils/types.js';
|
|
5
5
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
6
6
|
import * as _nestjs_common from '@nestjs/common';
|
|
7
|
-
import { MiddlewareConsumer,
|
|
7
|
+
import { MiddlewareConsumer, Type, DynamicModule } from '@nestjs/common';
|
|
8
8
|
import { AuthzError } from '../errors.js';
|
|
9
9
|
import { SessionAlsType } from './session-authz-als.middleware.js';
|
|
10
10
|
import 'express-session';
|
|
@@ -223,7 +223,7 @@ const cereateSessionAuthzModule = /* @__PURE__ */ __name((authzProvider) => {
|
|
|
223
223
|
}
|
|
224
224
|
configure(consumer) {
|
|
225
225
|
consumer.apply((0, import_express_session.default)(this.sessionAuthzOptions.session), SessionAuthzAlsMiddleware).exclude(...this.routesOpt.excludes).forRoutes(...this.routesOpt.global ? [
|
|
226
|
-
"*"
|
|
226
|
+
"{*splat}"
|
|
227
227
|
] : this.routesOpt.routes);
|
|
228
228
|
}
|
|
229
229
|
}, __name(_a, "SessionAuthzModule"), _a);
|
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": "
|
|
5
|
+
"version": "2.0.0",
|
|
6
6
|
"homepage": "https://github.com/yikenman/nestjs-kitchen",
|
|
7
7
|
"repository": "https://github.com/yikenman/nestjs-kitchen",
|
|
8
8
|
"author": "yikenman",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
"uid": "^2.0.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@nestjs/testing": "^
|
|
30
|
+
"@nestjs/testing": "^11.0.10",
|
|
31
31
|
"@types/cookie-parser": "^1.4.8",
|
|
32
32
|
"@types/express": "^4.17.21",
|
|
33
33
|
"@types/express-session": "^1.18.1",
|
|
34
34
|
"@types/jest": "^29.5.14",
|
|
35
|
-
"@types/jsonwebtoken": "^9.0.
|
|
36
|
-
"@types/node": "^22.
|
|
35
|
+
"@types/jsonwebtoken": "^9.0.9",
|
|
36
|
+
"@types/node": "^22.13.5",
|
|
37
37
|
"@types/passport": "^1.0.17",
|
|
38
38
|
"@types/supertest": "^6.0.2",
|
|
39
39
|
"jest": "^29.7.0",
|
|
40
40
|
"supertest": "^7.0.0",
|
|
41
|
-
"ts-jest": "^29.
|
|
41
|
+
"ts-jest": "^29.2.6",
|
|
42
42
|
"ts-node": "^10.9.2",
|
|
43
43
|
"tsconfig-paths": "^4.2.0",
|
|
44
|
-
"tsup": "^8.
|
|
45
|
-
"typescript": "^5.7.
|
|
44
|
+
"tsup": "^8.4.0",
|
|
45
|
+
"typescript": "^5.7.3"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=20.13.0"
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"Session"
|
|
59
59
|
],
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@nestjs/common": "^
|
|
62
|
-
"@nestjs/core": "^
|
|
63
|
-
"@nestjs/passport": "^
|
|
64
|
-
"@nestjs/platform-express": "^
|
|
61
|
+
"@nestjs/common": "^11.0.10",
|
|
62
|
+
"@nestjs/core": "^11.0.10",
|
|
63
|
+
"@nestjs/passport": "^11.0.5",
|
|
64
|
+
"@nestjs/platform-express": "^11.0.10",
|
|
65
65
|
"passport": "^0.7.0",
|
|
66
|
-
"reflect-metadata": "^0.2.
|
|
67
|
-
"rxjs": "^7.8.
|
|
66
|
+
"reflect-metadata": "^0.2.2",
|
|
67
|
+
"rxjs": "^7.8.2"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"build": "tsup",
|