@adminide-stack/core 13.5.3-alpha.31 → 13.5.3-alpha.310
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/LICENSE +71 -674
- package/lib/core/configurations/configuration.js +0 -1
- package/lib/core/configurations/configuration.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/interfaces/middlewareLoaderData.d.ts +39 -0
- package/lib/interfaces/preferences-service.d.ts +1 -1
- package/lib/modules/account-api/enums/index.d.ts +15 -0
- package/lib/modules/account-api/enums/index.js +20 -0
- package/lib/modules/account-api/enums/index.js.map +1 -1
- package/lib/modules/billing-api/enums/index.d.ts +8 -2
- package/lib/modules/billing-api/enums/index.js +6 -0
- package/lib/modules/billing-api/enums/index.js.map +1 -1
- package/lib/utils/context-path.d.ts +37 -0
- package/lib/utils/context-path.js +43 -0
- package/lib/utils/context-path.js.map +1 -0
- package/lib/utils/context-path.test.d.ts +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/nodeContext.js +5 -1
- package/lib/utils/nodeContext.js.map +1 -1
- package/lib/utils/preferenceUri.d.ts +1 -1
- package/lib/utils/preferenceUri.js +5 -2
- package/lib/utils/preferenceUri.js.map +1 -1
- package/lib/utils/secret-api-token-denylist.d.ts +12 -0
- package/lib/utils/secret-api-token-denylist.js +22 -0
- package/lib/utils/secret-api-token-denylist.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function denylistKey(jti) {
|
|
2
|
+
return `secret-api-token:denylist:${jti}`;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Returns `true` when the token identified by `jti` has been revoked.
|
|
6
|
+
*
|
|
7
|
+
* Fails open (returns `false`) when there is no `jti`, no Redis client, or Redis errors — favouring
|
|
8
|
+
* availability over strict revocation during a Redis outage. Tokens issued before `jti` was
|
|
9
|
+
* introduced have no `jti` claim and therefore can't be denylisted; they expire normally.
|
|
10
|
+
*/
|
|
11
|
+
async function isTokenRevoked(redisClient, jti, onError) {
|
|
12
|
+
if (!jti || !redisClient?.get) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
const value = await redisClient.get(denylistKey(jti));
|
|
17
|
+
return value != null;
|
|
18
|
+
} catch (err) {
|
|
19
|
+
onError?.(err);
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}export{denylistKey,isTokenRevoked};//# sourceMappingURL=secret-api-token-denylist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secret-api-token-denylist.js","sources":["../../src/utils/secret-api-token-denylist.ts"],"sourcesContent":[null],"names":[],"mappings":"AAIM,SAAU,WAAW,CAAC,GAAW,EAAA;SACnC,CAAA,0BAAO,EAAA,GAA6B,CAAA,CAAG;AAC3C;AAEA;;;;;;AAMG;AACI,eAAe,cAAc,CAChC,WAAoC,EACpC,GAAuB,EACvB,OAAgC,EAAA;MAEhC,CAAA,OAAQ,CAAA,aAAgB,GAAE,EAAG;AACzB,IAAA,OAAA;;AAEJ,EAAA,IAAA;AACI,IAAA,MAAA,KAAM,GAAA,MAAQ,WAAM,CAAA,GAAW,CAAC,WAAI,CAAA,GAAW,CAAC,CAAA;WAChD,KAAO,IAAK,IAAI;IACpB,OAAC,GAAA,EAAA;IAAC,OAAO,GAAG,GAAG,CAAA;AACX,IAAA,OAAA,KAAO;AACP,EAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/core",
|
|
3
|
-
"version": "13.5.3-alpha.
|
|
3
|
+
"version": "13.5.3-alpha.310",
|
|
4
4
|
"description": "AdminIDE core for higher packages to depend on",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "adminide-stack-user",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"vscode-uri": "^3.0.8"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"common": "13.5.3-alpha.
|
|
33
|
+
"common": "13.5.3-alpha.310"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@common-stack/server-core": ">=0.5.21",
|
|
37
37
|
"vscode-uri": "*"
|
|
38
38
|
},
|
|
39
|
+
"gitHead": "13670bf787519e8136af5705bba4e1bb00745133",
|
|
39
40
|
"typescript": {
|
|
40
41
|
"definition": "lib/index.d.ts"
|
|
41
|
-
}
|
|
42
|
-
"gitHead": "11470b93fa262f1384c91aa8c7119826737d9903"
|
|
42
|
+
}
|
|
43
43
|
}
|