@nestjs-kitchen/authz 2.0.3 → 2.0.4
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/authz.provider.d.ts +1 -3
- package/dist/authz.provider.js +27 -43
- package/dist/constants.d.ts +6 -8
- package/dist/constants.js +13 -46
- package/dist/errors.d.ts +3 -5
- package/dist/errors.js +29 -44
- package/dist/index.d.ts +5 -21
- package/dist/index.js +16 -45
- package/dist/jwt/extract-jwt.d.ts +4 -7
- package/dist/jwt/extract-jwt.js +136 -152
- package/dist/jwt/index.d.ts +2 -16
- package/dist/jwt/index.js +7 -30
- package/dist/jwt/jwt-authz-als.middleware.d.ts +6 -16
- package/dist/jwt/jwt-authz-als.middleware.js +40 -60
- package/dist/jwt/jwt-authz.guard.d.ts +8 -21
- package/dist/jwt/jwt-authz.guard.js +126 -148
- package/dist/jwt/jwt-authz.interface.d.ts +16 -25
- package/dist/jwt/jwt-authz.interface.js +66 -114
- package/dist/jwt/jwt-authz.module.d.ts +19 -31
- package/dist/jwt/jwt-authz.module.js +240 -242
- package/dist/jwt/jwt-authz.service.d.ts +6 -17
- package/dist/jwt/jwt-authz.service.js +113 -144
- package/dist/jwt/jwt-authz.strategy.d.ts +5 -17
- package/dist/jwt/jwt-authz.strategy.js +127 -150
- package/dist/session/index.d.ts +1 -12
- package/dist/session/index.js +5 -27
- package/dist/session/session-authz-als.middleware.d.ts +5 -12
- package/dist/session/session-authz-als.middleware.js +95 -109
- package/dist/session/session-authz.guard.d.ts +6 -15
- package/dist/session/session-authz.guard.js +96 -116
- package/dist/session/session-authz.interface.d.ts +5 -12
- package/dist/session/session-authz.interface.js +18 -40
- package/dist/session/session-authz.module.d.ts +18 -26
- package/dist/session/session-authz.module.js +231 -237
- package/dist/session/session-authz.service.d.ts +5 -13
- package/dist/session/session-authz.service.js +66 -83
- package/dist/session/session-authz.strategy.d.ts +4 -12
- package/dist/session/session-authz.strategy.js +65 -78
- package/dist/user.decorator.d.ts +3 -6
- package/dist/user.decorator.js +25 -33
- package/dist/utils/cookie-parsers.d.ts +3 -6
- package/dist/utils/cookie-parsers.js +62 -63
- package/dist/utils/create-authz-decorator-factory.d.ts +3 -9
- package/dist/utils/create-authz-decorator-factory.js +29 -50
- package/dist/utils/create-set-cookie-fn.d.ts +3 -9
- package/dist/utils/create-set-cookie-fn.js +21 -42
- package/dist/utils/generics.d.ts +4 -6
- package/dist/utils/generics.js +31 -54
- package/dist/utils/get-allow-anonymous.d.ts +2 -9
- package/dist/utils/get-allow-anonymous.js +6 -27
- package/dist/utils/get-als-store.d.ts +2 -5
- package/dist/utils/get-als-store.js +10 -32
- package/dist/utils/get-context-authz-meta-params-list.d.ts +2 -9
- package/dist/utils/get-context-authz-meta-params-list.js +15 -33
- package/dist/utils/get-passport-property.d.ts +1 -3
- package/dist/utils/get-passport-property.js +7 -28
- package/dist/utils/index.d.ts +11 -16
- package/dist/utils/index.js +26 -40
- package/dist/utils/merge-dynamic-module-configs.d.ts +2 -5
- package/dist/utils/merge-dynamic-module-configs.js +13 -38
- package/dist/utils/msgpackrs.d.ts +2 -4
- package/dist/utils/msgpackrs.js +9 -32
- package/dist/utils/types.d.ts +23 -26
- package/dist/utils/types.js +2 -15
- package/package.json +4 -4
package/dist/authz.provider.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @template Payload - The type representing the payload used for authentication.
|
|
5
5
|
* @template User - The type representing the user entity involved in authentication and authorization.
|
|
6
6
|
*/
|
|
7
|
-
declare abstract class AuthzProviderClass<Payload, User> {
|
|
7
|
+
export declare abstract class AuthzProviderClass<Payload, User> {
|
|
8
8
|
/**
|
|
9
9
|
* Creates a payload from the given user.
|
|
10
10
|
*
|
|
@@ -42,5 +42,3 @@ declare abstract class AuthzProviderClass<Payload, User> {
|
|
|
42
42
|
*/
|
|
43
43
|
authorize(_user: User, _metaData?: unknown): boolean | Promise<boolean>;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
export { AuthzProviderClass };
|
package/dist/authz.provider.js
CHANGED
|
@@ -1,45 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var authz_provider_exports = {};
|
|
19
|
-
__export(authz_provider_exports, {
|
|
20
|
-
AuthzProviderClass: () => AuthzProviderClass
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(authz_provider_exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzProviderClass = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Abstract base class for implementing custom authorization logic.
|
|
6
|
+
*
|
|
7
|
+
* @template Payload - The type representing the payload used for authentication.
|
|
8
|
+
* @template User - The type representing the user entity involved in authentication and authorization.
|
|
9
|
+
*/
|
|
23
10
|
class AuthzProviderClass {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
11
|
+
/**
|
|
12
|
+
* (**Optional**: Implement this method only if authorization is required.)
|
|
13
|
+
*
|
|
14
|
+
* Authorizes a user based on the provided metadata.
|
|
15
|
+
*
|
|
16
|
+
* This method checks if the given user is authorized to perform a specific action based on
|
|
17
|
+
* the provided metadata. If implemented, this method enables the authorization check; otherwise,
|
|
18
|
+
* only authentication will be performed.
|
|
19
|
+
*
|
|
20
|
+
* @param {User} _user - The user entity that needs to be authorized.
|
|
21
|
+
* @param {unknown} [_metaData] - Optional metadata that can influence the authorization decision.
|
|
22
|
+
* @returns {boolean | Promise<boolean>} `true` if the user is authorized, `false` otherwise,
|
|
23
|
+
* or a promise that resolves to the authorization result.
|
|
24
|
+
*/
|
|
25
|
+
authorize(_user, _metaData) {
|
|
26
|
+
return true; // Default implementation always returns true.
|
|
27
|
+
}
|
|
41
28
|
}
|
|
42
|
-
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
AuthzProviderClass
|
|
45
|
-
});
|
|
29
|
+
exports.AuthzProviderClass = AuthzProviderClass;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
declare const DEFAULT_PASSPORT_PROPERTY_VALUE = "user";
|
|
2
|
-
declare const PASSPORT_PROPERTY: unique symbol;
|
|
3
|
-
declare const PREFIX = "`<`:";
|
|
4
|
-
declare const ROUTES_OPTIONS: unique symbol;
|
|
5
|
-
declare enum JwtValidationType {
|
|
1
|
+
export declare const DEFAULT_PASSPORT_PROPERTY_VALUE = "user";
|
|
2
|
+
export declare const PASSPORT_PROPERTY: unique symbol;
|
|
3
|
+
export declare const PREFIX = "`<`:";
|
|
4
|
+
export declare const ROUTES_OPTIONS: unique symbol;
|
|
5
|
+
export declare enum JwtValidationType {
|
|
6
6
|
JWT = 0,
|
|
7
7
|
REFRESH = 1
|
|
8
8
|
}
|
|
9
|
-
declare const SESSION_PASSPORT_KEY = "passport";
|
|
10
|
-
|
|
11
|
-
export { DEFAULT_PASSPORT_PROPERTY_VALUE, JwtValidationType, PASSPORT_PROPERTY, PREFIX, ROUTES_OPTIONS, SESSION_PASSPORT_KEY };
|
|
9
|
+
export declare const SESSION_PASSPORT_KEY = "passport";
|
package/dist/constants.js
CHANGED
|
@@ -1,46 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var constants_exports = {};
|
|
19
|
-
__export(constants_exports, {
|
|
20
|
-
DEFAULT_PASSPORT_PROPERTY_VALUE: () => DEFAULT_PASSPORT_PROPERTY_VALUE,
|
|
21
|
-
JwtValidationType: () => JwtValidationType,
|
|
22
|
-
PASSPORT_PROPERTY: () => PASSPORT_PROPERTY,
|
|
23
|
-
PREFIX: () => PREFIX,
|
|
24
|
-
ROUTES_OPTIONS: () => ROUTES_OPTIONS,
|
|
25
|
-
SESSION_PASSPORT_KEY: () => SESSION_PASSPORT_KEY
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(constants_exports);
|
|
28
|
-
const DEFAULT_PASSPORT_PROPERTY_VALUE = "user";
|
|
29
|
-
const PASSPORT_PROPERTY = Symbol("PASSPORT_PROPERTY");
|
|
30
|
-
const PREFIX = "`<`:";
|
|
31
|
-
const ROUTES_OPTIONS = Symbol("ROUTES_OPTIONS");
|
|
32
|
-
var JwtValidationType = /* @__PURE__ */ ((JwtValidationType2) => {
|
|
33
|
-
JwtValidationType2[JwtValidationType2["JWT"] = 0] = "JWT";
|
|
34
|
-
JwtValidationType2[JwtValidationType2["REFRESH"] = 1] = "REFRESH";
|
|
35
|
-
return JwtValidationType2;
|
|
36
|
-
})(JwtValidationType || {});
|
|
37
|
-
const SESSION_PASSPORT_KEY = "passport";
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
DEFAULT_PASSPORT_PROPERTY_VALUE,
|
|
41
|
-
JwtValidationType,
|
|
42
|
-
PASSPORT_PROPERTY,
|
|
43
|
-
PREFIX,
|
|
44
|
-
ROUTES_OPTIONS,
|
|
45
|
-
SESSION_PASSPORT_KEY
|
|
46
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SESSION_PASSPORT_KEY = exports.JwtValidationType = exports.ROUTES_OPTIONS = exports.PREFIX = exports.PASSPORT_PROPERTY = exports.DEFAULT_PASSPORT_PROPERTY_VALUE = void 0;
|
|
4
|
+
exports.DEFAULT_PASSPORT_PROPERTY_VALUE = 'user';
|
|
5
|
+
exports.PASSPORT_PROPERTY = Symbol('PASSPORT_PROPERTY');
|
|
6
|
+
exports.PREFIX = '`<`:';
|
|
7
|
+
exports.ROUTES_OPTIONS = Symbol('ROUTES_OPTIONS');
|
|
8
|
+
var JwtValidationType;
|
|
9
|
+
(function (JwtValidationType) {
|
|
10
|
+
JwtValidationType[JwtValidationType["JWT"] = 0] = "JWT";
|
|
11
|
+
JwtValidationType[JwtValidationType["REFRESH"] = 1] = "REFRESH";
|
|
12
|
+
})(JwtValidationType || (exports.JwtValidationType = JwtValidationType = {}));
|
|
13
|
+
exports.SESSION_PASSPORT_KEY = 'passport';
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal error type.
|
|
3
3
|
*/
|
|
4
|
-
declare class AuthzError extends Error {
|
|
4
|
+
export declare class AuthzError extends Error {
|
|
5
5
|
cause?: unknown;
|
|
6
6
|
constructor(message?: string, cause?: unknown);
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Internal error type for verification error.
|
|
10
10
|
*/
|
|
11
|
-
declare class AuthzVerificationError extends AuthzError {
|
|
11
|
+
export declare class AuthzVerificationError extends AuthzError {
|
|
12
12
|
constructor(message?: string, cause?: unknown);
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Internal error type for anonymous error.
|
|
16
16
|
*/
|
|
17
|
-
declare class AuthzAnonymousError extends AuthzError {
|
|
17
|
+
export declare class AuthzAnonymousError extends AuthzError {
|
|
18
18
|
constructor(message?: string, cause?: unknown);
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
export { AuthzAnonymousError, AuthzError, AuthzVerificationError };
|
package/dist/errors.js
CHANGED
|
@@ -1,50 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var errors_exports = {};
|
|
19
|
-
__export(errors_exports, {
|
|
20
|
-
AuthzAnonymousError: () => AuthzAnonymousError,
|
|
21
|
-
AuthzError: () => AuthzError,
|
|
22
|
-
AuthzVerificationError: () => AuthzVerificationError
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(errors_exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthzAnonymousError = exports.AuthzVerificationError = exports.AuthzError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Internal error type.
|
|
6
|
+
*/
|
|
25
7
|
class AuthzError extends Error {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
8
|
+
constructor(message, cause) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = 'AuthzError';
|
|
11
|
+
this.cause = cause;
|
|
12
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
13
|
+
}
|
|
32
14
|
}
|
|
15
|
+
exports.AuthzError = AuthzError;
|
|
16
|
+
/**
|
|
17
|
+
* Internal error type for verification error.
|
|
18
|
+
*/
|
|
33
19
|
class AuthzVerificationError extends AuthzError {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
20
|
+
constructor(message, cause) {
|
|
21
|
+
super(message, cause);
|
|
22
|
+
this.name = 'AuthzVerificationError';
|
|
23
|
+
}
|
|
38
24
|
}
|
|
25
|
+
exports.AuthzVerificationError = AuthzVerificationError;
|
|
26
|
+
/**
|
|
27
|
+
* Internal error type for anonymous error.
|
|
28
|
+
*/
|
|
39
29
|
class AuthzAnonymousError extends AuthzError {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
constructor(message, cause) {
|
|
31
|
+
super(message, cause);
|
|
32
|
+
this.name = 'AuthzAnonymousError';
|
|
33
|
+
}
|
|
44
34
|
}
|
|
45
|
-
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
AuthzAnonymousError,
|
|
48
|
-
AuthzError,
|
|
49
|
-
AuthzVerificationError
|
|
50
|
-
});
|
|
35
|
+
exports.AuthzAnonymousError = AuthzAnonymousError;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
export { AuthzProviderClass } from './authz.provider
|
|
2
|
-
export { User } from './user.decorator
|
|
3
|
-
export {
|
|
4
|
-
export { ExtractJwt, JwtFromRequestFunction } from './jwt
|
|
5
|
-
export {
|
|
6
|
-
export { cereateSessionAuthzModule } from './session/session-authz.module.js';
|
|
7
|
-
import '@nestjs/common';
|
|
8
|
-
import 'cookie';
|
|
9
|
-
import '@nestjs/core';
|
|
10
|
-
import './jwt/jwt-authz.interface.js';
|
|
11
|
-
import 'crypto';
|
|
12
|
-
import 'jsonwebtoken';
|
|
13
|
-
import './utils/types.js';
|
|
14
|
-
import '@nestjs/common/interfaces';
|
|
15
|
-
import 'express';
|
|
16
|
-
import 'node:async_hooks';
|
|
17
|
-
import './jwt/jwt-authz-als.middleware.js';
|
|
18
|
-
import './constants.js';
|
|
19
|
-
import './session/session-authz.interface.js';
|
|
20
|
-
import 'express-session';
|
|
21
|
-
import './session/session-authz-als.middleware.js';
|
|
1
|
+
export { AuthzProviderClass } from './authz.provider';
|
|
2
|
+
export { User } from './user.decorator';
|
|
3
|
+
export { AuthzError, AuthzVerificationError, AuthzAnonymousError } from './errors';
|
|
4
|
+
export { ExtractJwt, type JwtFromRequestFunction, createJwtAuthzModule } from './jwt';
|
|
5
|
+
export { cereateSessionAuthzModule } from './session';
|
package/dist/index.js
CHANGED
|
@@ -1,45 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var index_exports = {};
|
|
19
|
-
__export(index_exports, {
|
|
20
|
-
AuthzAnonymousError: () => import_errors.AuthzAnonymousError,
|
|
21
|
-
AuthzError: () => import_errors.AuthzError,
|
|
22
|
-
AuthzProviderClass: () => import_authz.AuthzProviderClass,
|
|
23
|
-
AuthzVerificationError: () => import_errors.AuthzVerificationError,
|
|
24
|
-
ExtractJwt: () => import_jwt.ExtractJwt,
|
|
25
|
-
User: () => import_user.User,
|
|
26
|
-
cereateSessionAuthzModule: () => import_session.cereateSessionAuthzModule,
|
|
27
|
-
createJwtAuthzModule: () => import_jwt.createJwtAuthzModule
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(index_exports);
|
|
30
|
-
var import_authz = require("./authz.provider");
|
|
31
|
-
var import_user = require("./user.decorator");
|
|
32
|
-
var import_errors = require("./errors");
|
|
33
|
-
var import_jwt = require("./jwt");
|
|
34
|
-
var import_session = require("./session");
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
AuthzAnonymousError,
|
|
38
|
-
AuthzError,
|
|
39
|
-
AuthzProviderClass,
|
|
40
|
-
AuthzVerificationError,
|
|
41
|
-
ExtractJwt,
|
|
42
|
-
User,
|
|
43
|
-
cereateSessionAuthzModule,
|
|
44
|
-
createJwtAuthzModule
|
|
45
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cereateSessionAuthzModule = exports.createJwtAuthzModule = exports.ExtractJwt = exports.AuthzAnonymousError = exports.AuthzVerificationError = exports.AuthzError = exports.User = exports.AuthzProviderClass = void 0;
|
|
4
|
+
var authz_provider_1 = require("./authz.provider");
|
|
5
|
+
Object.defineProperty(exports, "AuthzProviderClass", { enumerable: true, get: function () { return authz_provider_1.AuthzProviderClass; } });
|
|
6
|
+
var user_decorator_1 = require("./user.decorator");
|
|
7
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return user_decorator_1.User; } });
|
|
8
|
+
var errors_1 = require("./errors");
|
|
9
|
+
Object.defineProperty(exports, "AuthzError", { enumerable: true, get: function () { return errors_1.AuthzError; } });
|
|
10
|
+
Object.defineProperty(exports, "AuthzVerificationError", { enumerable: true, get: function () { return errors_1.AuthzVerificationError; } });
|
|
11
|
+
Object.defineProperty(exports, "AuthzAnonymousError", { enumerable: true, get: function () { return errors_1.AuthzAnonymousError; } });
|
|
12
|
+
var jwt_1 = require("./jwt");
|
|
13
|
+
Object.defineProperty(exports, "ExtractJwt", { enumerable: true, get: function () { return jwt_1.ExtractJwt; } });
|
|
14
|
+
Object.defineProperty(exports, "createJwtAuthzModule", { enumerable: true, get: function () { return jwt_1.createJwtAuthzModule; } });
|
|
15
|
+
var session_1 = require("./session");
|
|
16
|
+
Object.defineProperty(exports, "cereateSessionAuthzModule", { enumerable: true, get: function () { return session_1.cereateSessionAuthzModule; } });
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ParseOptions } from 'cookie';
|
|
2
|
-
|
|
3
|
-
declare const parseAuthHeader: (hdrValue: unknown) => {
|
|
1
|
+
import type { ParseOptions } from 'cookie';
|
|
2
|
+
export declare const parseAuthHeader: (hdrValue: unknown) => {
|
|
4
3
|
scheme: string;
|
|
5
4
|
value: string;
|
|
6
5
|
} | null;
|
|
7
|
-
interface JwtFromRequestFunction<T = any> {
|
|
6
|
+
export interface JwtFromRequestFunction<T = any> {
|
|
8
7
|
(req: T): string | null;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
@@ -12,7 +11,7 @@ interface JwtFromRequestFunction<T = any> {
|
|
|
12
11
|
*
|
|
13
12
|
* Same as `passportjs` [jwt extractors](https://www.passportjs.org/packages/passport-jwt/#included-extractors)
|
|
14
13
|
*/
|
|
15
|
-
declare const ExtractJwt: {
|
|
14
|
+
export declare const ExtractJwt: {
|
|
16
15
|
/**
|
|
17
16
|
* Creates an extractor function to retrieve a token from the request header.
|
|
18
17
|
*
|
|
@@ -72,5 +71,3 @@ declare const ExtractJwt: {
|
|
|
72
71
|
*/
|
|
73
72
|
fromExtractors: (extractors: JwtFromRequestFunction[]) => JwtFromRequestFunction;
|
|
74
73
|
};
|
|
75
|
-
|
|
76
|
-
export { ExtractJwt, type JwtFromRequestFunction, parseAuthHeader };
|