@alanszp/jwt 12.0.0 → 13.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/babel.config.js +7 -0
- package/dist/BitmaskUtils.d.ts +48 -0
- package/dist/BitmaskUtils.js +64 -0
- package/dist/BitmaskUtils.js.map +1 -0
- package/dist/BitmaskUtils.test.d.ts +1 -0
- package/dist/BitmaskUtils.test.js +152 -0
- package/dist/BitmaskUtils.test.js.map +1 -0
- package/dist/JWTUser.d.ts +58 -2
- package/dist/JWTUser.js +158 -3
- package/dist/JWTUser.js.map +1 -1
- package/dist/PermissionService.d.ts +26 -0
- package/dist/PermissionService.js +108 -0
- package/dist/PermissionService.js.map +1 -0
- package/dist/axiosPermissionsResolutionFactory.d.ts +4 -0
- package/dist/axiosPermissionsResolutionFactory.js +52 -0
- package/dist/axiosPermissionsResolutionFactory.js.map +1 -0
- package/dist/errors/NoPermissionError.d.ts +7 -0
- package/dist/errors/NoPermissionError.js +20 -0
- package/dist/errors/NoPermissionError.js.map +1 -0
- package/dist/errors/PermissionNotFound.d.ts +9 -0
- package/dist/errors/PermissionNotFound.js +24 -0
- package/dist/errors/PermissionNotFound.js.map +1 -0
- package/dist/errors/PermissionServiceError.d.ts +3 -0
- package/dist/errors/PermissionServiceError.js +8 -0
- package/dist/errors/PermissionServiceError.js.map +1 -0
- package/dist/errors/PermissionServiceNotInstantiated.d.ts +7 -0
- package/dist/errors/PermissionServiceNotInstantiated.js +17 -0
- package/dist/errors/PermissionServiceNotInstantiated.js.map +1 -0
- package/dist/errors/PermissionServiceRequestError.d.ts +9 -0
- package/dist/errors/PermissionServiceRequestError.js +23 -0
- package/dist/errors/PermissionServiceRequestError.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/jest.config.js +10 -0
- package/package.json +13 -5
- package/tsconfig.json +5 -2
- package/.gitignore +0 -3
- package/.npmignore +0 -3
- package/node_modules/@types/node/LICENSE +0 -21
- package/node_modules/@types/node/README.md +0 -15
- package/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/assert.d.ts +0 -996
- package/node_modules/@types/node/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/buffer.d.ts +0 -2362
- package/node_modules/@types/node/child_process.d.ts +0 -1540
- package/node_modules/@types/node/cluster.d.ts +0 -432
- package/node_modules/@types/node/console.d.ts +0 -415
- package/node_modules/@types/node/constants.d.ts +0 -19
- package/node_modules/@types/node/crypto.d.ts +0 -4487
- package/node_modules/@types/node/dgram.d.ts +0 -596
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/dns.d.ts +0 -809
- package/node_modules/@types/node/dom-events.d.ts +0 -122
- package/node_modules/@types/node/domain.d.ts +0 -170
- package/node_modules/@types/node/events.d.ts +0 -879
- package/node_modules/@types/node/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/fs.d.ts +0 -4311
- package/node_modules/@types/node/globals.d.ts +0 -411
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/@types/node/http.d.ts +0 -1887
- package/node_modules/@types/node/http2.d.ts +0 -2382
- package/node_modules/@types/node/https.d.ts +0 -550
- package/node_modules/@types/node/index.d.ts +0 -88
- package/node_modules/@types/node/inspector.d.ts +0 -2747
- package/node_modules/@types/node/module.d.ts +0 -315
- package/node_modules/@types/node/net.d.ts +0 -949
- package/node_modules/@types/node/os.d.ts +0 -478
- package/node_modules/@types/node/package.json +0 -229
- package/node_modules/@types/node/path.d.ts +0 -191
- package/node_modules/@types/node/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/process.d.ts +0 -1561
- package/node_modules/@types/node/punycode.d.ts +0 -117
- package/node_modules/@types/node/querystring.d.ts +0 -141
- package/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/readline.d.ts +0 -539
- package/node_modules/@types/node/repl.d.ts +0 -430
- package/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/stream/web.d.ts +0 -366
- package/node_modules/@types/node/stream.d.ts +0 -1701
- package/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/test.d.ts +0 -1465
- package/node_modules/@types/node/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/timers.d.ts +0 -240
- package/node_modules/@types/node/tls.d.ts +0 -1210
- package/node_modules/@types/node/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/assert/strict.d.ts +0 -8
- package/node_modules/@types/node/ts4.8/assert.d.ts +0 -996
- package/node_modules/@types/node/ts4.8/async_hooks.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/buffer.d.ts +0 -2362
- package/node_modules/@types/node/ts4.8/child_process.d.ts +0 -1540
- package/node_modules/@types/node/ts4.8/cluster.d.ts +0 -432
- package/node_modules/@types/node/ts4.8/console.d.ts +0 -415
- package/node_modules/@types/node/ts4.8/constants.d.ts +0 -19
- package/node_modules/@types/node/ts4.8/crypto.d.ts +0 -4487
- package/node_modules/@types/node/ts4.8/dgram.d.ts +0 -596
- package/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +0 -545
- package/node_modules/@types/node/ts4.8/dns/promises.d.ts +0 -425
- package/node_modules/@types/node/ts4.8/dns.d.ts +0 -809
- package/node_modules/@types/node/ts4.8/dom-events.d.ts +0 -122
- package/node_modules/@types/node/ts4.8/domain.d.ts +0 -170
- package/node_modules/@types/node/ts4.8/events.d.ts +0 -879
- package/node_modules/@types/node/ts4.8/fs/promises.d.ts +0 -1239
- package/node_modules/@types/node/ts4.8/fs.d.ts +0 -4311
- package/node_modules/@types/node/ts4.8/globals.d.ts +0 -411
- package/node_modules/@types/node/ts4.8/globals.global.d.ts +0 -1
- package/node_modules/@types/node/ts4.8/http.d.ts +0 -1887
- package/node_modules/@types/node/ts4.8/http2.d.ts +0 -2382
- package/node_modules/@types/node/ts4.8/https.d.ts +0 -550
- package/node_modules/@types/node/ts4.8/index.d.ts +0 -88
- package/node_modules/@types/node/ts4.8/inspector.d.ts +0 -2747
- package/node_modules/@types/node/ts4.8/module.d.ts +0 -315
- package/node_modules/@types/node/ts4.8/net.d.ts +0 -949
- package/node_modules/@types/node/ts4.8/os.d.ts +0 -478
- package/node_modules/@types/node/ts4.8/path.d.ts +0 -191
- package/node_modules/@types/node/ts4.8/perf_hooks.d.ts +0 -645
- package/node_modules/@types/node/ts4.8/process.d.ts +0 -1561
- package/node_modules/@types/node/ts4.8/punycode.d.ts +0 -117
- package/node_modules/@types/node/ts4.8/querystring.d.ts +0 -141
- package/node_modules/@types/node/ts4.8/readline/promises.d.ts +0 -150
- package/node_modules/@types/node/ts4.8/readline.d.ts +0 -539
- package/node_modules/@types/node/ts4.8/repl.d.ts +0 -430
- package/node_modules/@types/node/ts4.8/stream/consumers.d.ts +0 -12
- package/node_modules/@types/node/ts4.8/stream/promises.d.ts +0 -83
- package/node_modules/@types/node/ts4.8/stream/web.d.ts +0 -366
- package/node_modules/@types/node/ts4.8/stream.d.ts +0 -1701
- package/node_modules/@types/node/ts4.8/string_decoder.d.ts +0 -67
- package/node_modules/@types/node/ts4.8/test.d.ts +0 -1465
- package/node_modules/@types/node/ts4.8/timers/promises.d.ts +0 -93
- package/node_modules/@types/node/ts4.8/timers.d.ts +0 -240
- package/node_modules/@types/node/ts4.8/tls.d.ts +0 -1210
- package/node_modules/@types/node/ts4.8/trace_events.d.ts +0 -182
- package/node_modules/@types/node/ts4.8/tty.d.ts +0 -208
- package/node_modules/@types/node/ts4.8/url.d.ts +0 -927
- package/node_modules/@types/node/ts4.8/util.d.ts +0 -2183
- package/node_modules/@types/node/ts4.8/v8.d.ts +0 -764
- package/node_modules/@types/node/ts4.8/vm.d.ts +0 -903
- package/node_modules/@types/node/ts4.8/wasi.d.ts +0 -179
- package/node_modules/@types/node/ts4.8/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/ts4.8/zlib.d.ts +0 -517
- package/node_modules/@types/node/tty.d.ts +0 -208
- package/node_modules/@types/node/url.d.ts +0 -927
- package/node_modules/@types/node/util.d.ts +0 -2183
- package/node_modules/@types/node/v8.d.ts +0 -764
- package/node_modules/@types/node/vm.d.ts +0 -903
- package/node_modules/@types/node/wasi.d.ts +0 -179
- package/node_modules/@types/node/worker_threads.d.ts +0 -691
- package/node_modules/@types/node/zlib.d.ts +0 -517
- package/src/JWTUser.ts +0 -85
- package/src/index.ts +0 -3
- package/src/jwt.ts +0 -81
- package/src/types.ts +0 -31
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var _PermissionService_permissionsResolutionFn, _PermissionService_cachedPermissions, _PermissionService_observerInterval, _PermissionService_permissionsPreheatedSuccessfully;
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.PermissionService = void 0;
|
|
25
|
+
const DEFAULT_PERMISSIONS_REFETCH_TIMEOUT = 1000 * 60 * 60; // 1hs
|
|
26
|
+
class PermissionService {
|
|
27
|
+
constructor(logger, permissionsResolutionFn) {
|
|
28
|
+
_PermissionService_permissionsResolutionFn.set(this, void 0);
|
|
29
|
+
_PermissionService_cachedPermissions.set(this, void 0);
|
|
30
|
+
_PermissionService_observerInterval.set(this, void 0);
|
|
31
|
+
_PermissionService_permissionsPreheatedSuccessfully.set(this, void 0);
|
|
32
|
+
this.logger = logger;
|
|
33
|
+
__classPrivateFieldSet(this, _PermissionService_permissionsResolutionFn, permissionsResolutionFn, "f");
|
|
34
|
+
__classPrivateFieldSet(this, _PermissionService_cachedPermissions, null, "f");
|
|
35
|
+
__classPrivateFieldSet(this, _PermissionService_observerInterval, null, "f");
|
|
36
|
+
__classPrivateFieldSet(this, _PermissionService_permissionsPreheatedSuccessfully, Promise.resolve(), "f");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Retrieve all pages from a paginated {@link ListResult} request
|
|
40
|
+
* @todo this could be generalized, but tricky to do so because of the binding of the fetcher function
|
|
41
|
+
*/
|
|
42
|
+
getAllPagesFromPaginatedRequest(fetcher, pageSize = 500) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const fetcherBound = fetcher.bind(this);
|
|
45
|
+
const acc = [];
|
|
46
|
+
const firstPage = yield fetcherBound(1, pageSize);
|
|
47
|
+
acc.push(...firstPage.elements);
|
|
48
|
+
if (firstPage.total > firstPage.pageSize) {
|
|
49
|
+
const pages = Math.ceil(firstPage.total / firstPage.pageSize);
|
|
50
|
+
for (let i = 2; i <= pages; i++) {
|
|
51
|
+
const page = yield fetcherBound(i, pageSize);
|
|
52
|
+
acc.push(...page.elements);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return acc;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
hasCachedPermissions() {
|
|
59
|
+
return __classPrivateFieldGet(this, _PermissionService_cachedPermissions, "f") !== null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieve the permissions definitions
|
|
63
|
+
* @returns {Promise<Permission[]>}
|
|
64
|
+
*/
|
|
65
|
+
getPermissions(checkCache = true) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
if (checkCache) {
|
|
68
|
+
if (__classPrivateFieldGet(this, _PermissionService_cachedPermissions, "f")) {
|
|
69
|
+
this.logger.debug("auth.permission_service.get_permissions.cache_hit");
|
|
70
|
+
return __classPrivateFieldGet(this, _PermissionService_cachedPermissions, "f");
|
|
71
|
+
}
|
|
72
|
+
this.logger.debug("auth.permission_service.get_permissions.cache_miss");
|
|
73
|
+
}
|
|
74
|
+
const permissions = yield this.getAllPagesFromPaginatedRequest(__classPrivateFieldGet(this, _PermissionService_permissionsResolutionFn, "f"));
|
|
75
|
+
__classPrivateFieldSet(this, _PermissionService_cachedPermissions, permissions, "f");
|
|
76
|
+
return permissions;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
isPermissionsCacheReady() {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
yield __classPrivateFieldGet(this, _PermissionService_permissionsPreheatedSuccessfully, "f");
|
|
82
|
+
return __classPrivateFieldGet(this, _PermissionService_cachedPermissions, "f") !== null;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
reloadPermissionCache() {
|
|
86
|
+
__classPrivateFieldSet(this, _PermissionService_permissionsPreheatedSuccessfully, this.getPermissions(false)
|
|
87
|
+
.then(() => {
|
|
88
|
+
this.logger.debug("auth.permission_service.reload_permission_cache.success");
|
|
89
|
+
})
|
|
90
|
+
.catch((error) => {
|
|
91
|
+
this.logger.error("auth.permission_service.reload_permission_cache.error", { error });
|
|
92
|
+
return;
|
|
93
|
+
}), "f");
|
|
94
|
+
return __classPrivateFieldGet(this, _PermissionService_permissionsPreheatedSuccessfully, "f");
|
|
95
|
+
}
|
|
96
|
+
startPermissionObserver(permissionRefetchInMs = DEFAULT_PERMISSIONS_REFETCH_TIMEOUT) {
|
|
97
|
+
__classPrivateFieldSet(this, _PermissionService_observerInterval, setInterval(() => this.reloadPermissionCache(), permissionRefetchInMs), "f");
|
|
98
|
+
}
|
|
99
|
+
stopPermissionObserver() {
|
|
100
|
+
if (__classPrivateFieldGet(this, _PermissionService_observerInterval, "f")) {
|
|
101
|
+
clearInterval(__classPrivateFieldGet(this, _PermissionService_observerInterval, "f"));
|
|
102
|
+
__classPrivateFieldSet(this, _PermissionService_observerInterval, null, "f");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.PermissionService = PermissionService;
|
|
107
|
+
_PermissionService_permissionsResolutionFn = new WeakMap(), _PermissionService_cachedPermissions = new WeakMap(), _PermissionService_observerInterval = new WeakMap(), _PermissionService_permissionsPreheatedSuccessfully = new WeakMap();
|
|
108
|
+
//# sourceMappingURL=PermissionService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionService.js","sourceRoot":"","sources":["../src/PermissionService.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Permission } from "./types";
|
|
2
|
+
import { ListResult } from "@alanszp/core";
|
|
3
|
+
export declare type PermissionsResolutionFunction = (page: number, pageSize: number) => Promise<ListResult<Permission>>;
|
|
4
|
+
export declare function axiosPermissionsResolutionFactory(baseUrl: string, accessToken: string): () => PermissionsResolutionFunction;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.axiosPermissionsResolutionFactory = void 0;
|
|
13
|
+
const axios_node_1 = require("@alanszp/axios-node");
|
|
14
|
+
const PermissionServiceRequestError_1 = require("./errors/PermissionServiceRequestError");
|
|
15
|
+
function makeRequest(axios, baseURL, accessToken, method, url, params, retries = 5) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
try {
|
|
18
|
+
const request = yield axios.request({
|
|
19
|
+
baseURL,
|
|
20
|
+
url,
|
|
21
|
+
method,
|
|
22
|
+
params,
|
|
23
|
+
headers: {
|
|
24
|
+
authorization: `Bearer ${accessToken}`,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return request.data;
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (retries > 0) {
|
|
31
|
+
this.logger.debug("auth.permission_service.make_request.retry", {
|
|
32
|
+
retriesLeft: retries,
|
|
33
|
+
});
|
|
34
|
+
const response = yield makeRequest(axios, baseURL, accessToken, method, url, params, retries - 1);
|
|
35
|
+
return response;
|
|
36
|
+
}
|
|
37
|
+
throw new PermissionServiceRequestError_1.PermissionServiceRequestError(error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function axiosPermissionsResolutionFactory(baseUrl, accessToken) {
|
|
42
|
+
const axios = (0, axios_node_1.createAxios)();
|
|
43
|
+
return function axiosPermissionsResolution() {
|
|
44
|
+
return function getPermissionsPageFromApi(page = 1, pageSize = 500) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return makeRequest(axios, baseUrl, accessToken, "GET", "/lara/v1/permissions", { page, pageSize });
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
exports.axiosPermissionsResolutionFactory = axiosPermissionsResolutionFactory;
|
|
52
|
+
//# sourceMappingURL=axiosPermissionsResolutionFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axiosPermissionsResolutionFactory.js","sourceRoot":"","sources":["../src/axiosPermissionsResolutionFactory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkD;AAElD,0FAAuF;AAQvF,SAAe,WAAW,CACxB,KAAqC,EACrC,OAAe,EACf,WAAmB,EACnB,MAAa,EACb,GAAW,EACX,MAAgC,EAChC,UAAkB,CAAC;;QAEnB,IAAI;YACF,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAI;gBACrC,OAAO;gBACP,GAAG;gBACH,MAAM;gBACN,MAAM;gBACN,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,WAAW,EAAE;iBACvC;aACF,CAAC,CAAC;YAEH,OAAO,OAAO,CAAC,IAAI,CAAC;SACrB;QAAC,OAAO,KAAc,EAAE;YACvB,IAAI,OAAO,GAAG,CAAC,EAAE;gBACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,EAAE;oBAC9D,WAAW,EAAE,OAAO;iBACrB,CAAC,CAAC;gBACH,MAAM,QAAQ,GAAG,MAAM,WAAW,CAChC,KAAK,EACL,OAAO,EACP,WAAW,EACX,MAAM,EACN,GAAG,EACH,MAAM,EACN,OAAO,GAAG,CAAC,CACZ,CAAC;gBACF,OAAO,QAAQ,CAAC;aACjB;YACD,MAAM,IAAI,6DAA6B,CAAC,KAAK,CAAC,CAAC;SAChD;IACH,CAAC;CAAA;AAED,SAAgB,iCAAiC,CAC/C,OAAe,EACf,WAAmB;IAEnB,MAAM,KAAK,GAAG,IAAA,wBAAW,GAAE,CAAC;IAC5B,OAAO,SAAS,0BAA0B;QACxC,OAAO,SAAe,yBAAyB,CAC7C,OAAe,CAAC,EAChB,QAAQ,GAAG,GAAG;;gBAEd,OAAO,WAAW,CAChB,KAAK,EACL,OAAO,EACP,WAAW,EACX,KAAK,EACL,sBAAsB,EACtB,EAAE,IAAI,EAAE,QAAQ,EAAE,CACnB,CAAC;YACJ,CAAC;SAAA,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AApBD,8EAoBC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HttpRenderableError, RenderableContext } from "@alanszp/errors";
|
|
2
|
+
export declare class NoPermissionError extends HttpRenderableError {
|
|
3
|
+
permissionsNotMet: string[];
|
|
4
|
+
constructor(permissionsNotMet: string[]);
|
|
5
|
+
httpCode(): number;
|
|
6
|
+
context(): RenderableContext;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoPermissionError = void 0;
|
|
4
|
+
const errors_1 = require("@alanszp/errors");
|
|
5
|
+
class NoPermissionError extends errors_1.HttpRenderableError {
|
|
6
|
+
constructor(permissionsNotMet) {
|
|
7
|
+
super("No permission error");
|
|
8
|
+
this.permissionsNotMet = permissionsNotMet;
|
|
9
|
+
}
|
|
10
|
+
httpCode() {
|
|
11
|
+
return 403;
|
|
12
|
+
}
|
|
13
|
+
context() {
|
|
14
|
+
return {
|
|
15
|
+
permissionsNotMet: this.permissionsNotMet,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.NoPermissionError = NoPermissionError;
|
|
20
|
+
//# sourceMappingURL=NoPermissionError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoPermissionError.js","sourceRoot":"","sources":["../../src/errors/NoPermissionError.ts"],"names":[],"mappings":";;;AAAA,4CAAyE;AAEzE,MAAa,iBAAkB,SAAQ,4BAAmB;IAGxD,YAAY,iBAA2B;QACrC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC7B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC7C,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO;QACL,OAAO;YACL,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAC;IACJ,CAAC;CACF;AAjBD,8CAiBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RenderableContext } from "@alanszp/errors";
|
|
2
|
+
import { PermissionServiceError } from "./PermissionServiceError";
|
|
3
|
+
export declare class PermissionDefinitionNotFound extends PermissionServiceError {
|
|
4
|
+
permissionCode: string;
|
|
5
|
+
constructor(permissionCode: string);
|
|
6
|
+
renderMessage(): string;
|
|
7
|
+
httpCode(): number;
|
|
8
|
+
context(): RenderableContext;
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionDefinitionNotFound = void 0;
|
|
4
|
+
const PermissionServiceError_1 = require("./PermissionServiceError");
|
|
5
|
+
class PermissionDefinitionNotFound extends PermissionServiceError_1.PermissionServiceError {
|
|
6
|
+
constructor(permissionCode) {
|
|
7
|
+
super("Permission not found");
|
|
8
|
+
this.permissionCode = permissionCode;
|
|
9
|
+
}
|
|
10
|
+
renderMessage() {
|
|
11
|
+
return "Permission code not found in the permission definitions";
|
|
12
|
+
}
|
|
13
|
+
httpCode() {
|
|
14
|
+
// 500 Internal Server Error because this indicates a configuration problem.
|
|
15
|
+
return 500;
|
|
16
|
+
}
|
|
17
|
+
context() {
|
|
18
|
+
return {
|
|
19
|
+
permissionCode: this.permissionCode,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.PermissionDefinitionNotFound = PermissionDefinitionNotFound;
|
|
24
|
+
//# sourceMappingURL=PermissionNotFound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionNotFound.js","sourceRoot":"","sources":["../../src/errors/PermissionNotFound.ts"],"names":[],"mappings":";;;AACA,qEAAkE;AAElE,MAAa,4BAA6B,SAAQ,+CAAsB;IAGtE,YAAY,cAAsB;QAChC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,aAAa;QACX,OAAO,yDAAyD,CAAC;IACnE,CAAC;IAED,QAAQ;QACN,4EAA4E;QAC5E,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO;QACL,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAC;IACJ,CAAC;CACF;AAtBD,oEAsBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionServiceError = void 0;
|
|
4
|
+
const errors_1 = require("@alanszp/errors");
|
|
5
|
+
class PermissionServiceError extends errors_1.HttpRenderableError {
|
|
6
|
+
}
|
|
7
|
+
exports.PermissionServiceError = PermissionServiceError;
|
|
8
|
+
//# sourceMappingURL=PermissionServiceError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionServiceError.js","sourceRoot":"","sources":["../../src/errors/PermissionServiceError.ts"],"names":[],"mappings":";;;AAAA,4CAAsD;AAEtD,MAAsB,sBAAuB,SAAQ,4BAAmB;CAAG;AAA3E,wDAA2E"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RenderableContext } from "@alanszp/errors";
|
|
2
|
+
import { PermissionServiceError } from "./PermissionServiceError";
|
|
3
|
+
export declare class PermissionServiceNotInstantiated extends PermissionServiceError {
|
|
4
|
+
constructor();
|
|
5
|
+
httpCode(): number;
|
|
6
|
+
context(): RenderableContext;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionServiceNotInstantiated = void 0;
|
|
4
|
+
const PermissionServiceError_1 = require("./PermissionServiceError");
|
|
5
|
+
class PermissionServiceNotInstantiated extends PermissionServiceError_1.PermissionServiceError {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("Permission service not instantiated");
|
|
8
|
+
}
|
|
9
|
+
httpCode() {
|
|
10
|
+
return 500;
|
|
11
|
+
}
|
|
12
|
+
context() {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.PermissionServiceNotInstantiated = PermissionServiceNotInstantiated;
|
|
17
|
+
//# sourceMappingURL=PermissionServiceNotInstantiated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionServiceNotInstantiated.js","sourceRoot":"","sources":["../../src/errors/PermissionServiceNotInstantiated.ts"],"names":[],"mappings":";;;AACA,qEAAkE;AAElE,MAAa,gCAAiC,SAAQ,+CAAsB;IAC1E;QACE,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO;QACL,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAZD,4EAYC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RenderableContext } from "@alanszp/errors";
|
|
2
|
+
import { PermissionServiceError } from "./PermissionServiceError";
|
|
3
|
+
export declare class PermissionServiceRequestError extends PermissionServiceError {
|
|
4
|
+
error: unknown;
|
|
5
|
+
constructor(error: unknown);
|
|
6
|
+
renderMessage(): string;
|
|
7
|
+
httpCode(): number;
|
|
8
|
+
context(): RenderableContext;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PermissionServiceRequestError = void 0;
|
|
4
|
+
const PermissionServiceError_1 = require("./PermissionServiceError");
|
|
5
|
+
class PermissionServiceRequestError extends PermissionServiceError_1.PermissionServiceError {
|
|
6
|
+
constructor(error) {
|
|
7
|
+
super("Permission service request error");
|
|
8
|
+
this.error = error;
|
|
9
|
+
}
|
|
10
|
+
renderMessage() {
|
|
11
|
+
return "Permission service request failed. Could not validate permission integrity";
|
|
12
|
+
}
|
|
13
|
+
httpCode() {
|
|
14
|
+
return 500;
|
|
15
|
+
}
|
|
16
|
+
context() {
|
|
17
|
+
return {
|
|
18
|
+
error: this.error,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.PermissionServiceRequestError = PermissionServiceRequestError;
|
|
23
|
+
//# sourceMappingURL=PermissionServiceRequestError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PermissionServiceRequestError.js","sourceRoot":"","sources":["../../src/errors/PermissionServiceRequestError.ts"],"names":[],"mappings":";;;AACA,qEAAkE;AAElE,MAAa,6BAA8B,SAAQ,+CAAsB;IAGvE,YAAY,KAAc;QACxB,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,aAAa;QACX,OAAO,4EAA4E,CAAC;IACtF,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO;QACL,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;IACJ,CAAC;CACF;AArBD,sEAqBC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
2
|
export * from "./JWTUser";
|
|
3
3
|
export * from "./jwt";
|
|
4
|
+
export * from "./PermissionService";
|
|
5
|
+
export * from "./BitmaskUtils";
|
|
6
|
+
export * from "./errors/NoPermissionError";
|
|
7
|
+
export * from "./errors/PermissionNotFound";
|
|
8
|
+
export * from "./errors/PermissionServiceNotInstantiated";
|
|
9
|
+
export * from "./errors/PermissionServiceRequestError";
|
|
10
|
+
export * from "./axiosPermissionsResolutionFactory";
|
package/dist/index.js
CHANGED
|
@@ -13,4 +13,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./types"), exports);
|
|
14
14
|
__exportStar(require("./JWTUser"), exports);
|
|
15
15
|
__exportStar(require("./jwt"), exports);
|
|
16
|
+
__exportStar(require("./PermissionService"), exports);
|
|
17
|
+
__exportStar(require("./BitmaskUtils"), exports);
|
|
18
|
+
__exportStar(require("./errors/NoPermissionError"), exports);
|
|
19
|
+
__exportStar(require("./errors/PermissionNotFound"), exports);
|
|
20
|
+
__exportStar(require("./errors/PermissionServiceNotInstantiated"), exports);
|
|
21
|
+
__exportStar(require("./errors/PermissionServiceRequestError"), exports);
|
|
22
|
+
__exportStar(require("./axiosPermissionsResolutionFactory"), exports);
|
|
16
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,wCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,wCAAsB;AACtB,sDAAoC;AACpC,iDAA+B;AAC/B,6DAA2C;AAC3C,8DAA4C;AAC5C,4EAA0D;AAC1D,yEAAuD;AACvD,sEAAoD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -24,3 +24,10 @@ export interface VerifyOptions {
|
|
|
24
24
|
issuer: string | string[];
|
|
25
25
|
audience: string | string[];
|
|
26
26
|
}
|
|
27
|
+
export interface Permission {
|
|
28
|
+
code: string;
|
|
29
|
+
description: string;
|
|
30
|
+
position: number;
|
|
31
|
+
priority: number | null;
|
|
32
|
+
organizationReference: string;
|
|
33
|
+
}
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alanszp/jwt",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "Alan's jwt validator & signer.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"files": [
|
|
9
|
-
"**/*"
|
|
10
|
-
],
|
|
11
8
|
"publishConfig": {
|
|
12
9
|
"access": "public"
|
|
13
10
|
},
|
|
14
11
|
"scripts": {
|
|
15
12
|
"compile": "rm -rf ./dist && tsc --declaration",
|
|
16
13
|
"compile-watch": "tsc -w",
|
|
14
|
+
"test": "TZ=Etc/UTC jest",
|
|
17
15
|
"build": "yarn run compile",
|
|
18
16
|
"prepack": "yarn run build",
|
|
19
17
|
"yalc-publish": "yarn run yalc publish"
|
|
20
18
|
},
|
|
21
19
|
"devDependencies": {
|
|
20
|
+
"@babel/core": "^7.24.0",
|
|
21
|
+
"@babel/preset-env": "^7.24.0",
|
|
22
|
+
"@babel/preset-typescript": "^7.23.3",
|
|
23
|
+
"@types/jest": "^29.5.12",
|
|
22
24
|
"@types/node": "^20.11.17",
|
|
25
|
+
"babel-jest": "^29.7.0",
|
|
26
|
+
"jest": "^29.7.0",
|
|
23
27
|
"ts-node": "^10.0.0",
|
|
24
28
|
"typescript": "^4.3.4"
|
|
25
29
|
},
|
|
26
30
|
"dependencies": {
|
|
31
|
+
"@alanszp/axios-node": "^13.0.0",
|
|
32
|
+
"@alanszp/core": "^13.0.0",
|
|
33
|
+
"@alanszp/errors": "^13.0.0",
|
|
34
|
+
"@alanszp/logger": "^13.0.0",
|
|
27
35
|
"jose": "^5.2.2"
|
|
28
36
|
},
|
|
29
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "a9643f1301fe2e704611805b65e64de2ee5186cd"
|
|
30
38
|
}
|
package/tsconfig.json
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
"outDir": "dist",
|
|
5
5
|
"module": "commonjs",
|
|
6
6
|
"target": "es6",
|
|
7
|
-
"types": ["node"],
|
|
7
|
+
"types": ["jest", "node"],
|
|
8
8
|
"esModuleInterop": true,
|
|
9
9
|
"sourceMap": true,
|
|
10
10
|
|
|
11
11
|
"alwaysStrict": true,
|
|
12
12
|
"strictNullChecks": true
|
|
13
13
|
},
|
|
14
|
-
"exclude": ["node_modules"]
|
|
14
|
+
"exclude": ["node_modules"],
|
|
15
|
+
"paths": {
|
|
16
|
+
"@/*": ["src/*"]
|
|
17
|
+
}
|
|
15
18
|
}
|
package/.gitignore
DELETED
package/.npmignore
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
> `npm install --save @types/node`
|
|
3
|
-
|
|
4
|
-
# Summary
|
|
5
|
-
This package contains type definitions for node (https://nodejs.org/).
|
|
6
|
-
|
|
7
|
-
# Details
|
|
8
|
-
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
|
-
|
|
10
|
-
### Additional Details
|
|
11
|
-
* Last updated: Thu, 08 Feb 2024 20:35:44 GMT
|
|
12
|
-
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
|
-
|
|
14
|
-
# Credits
|
|
15
|
-
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
|