@nocobase/plugin-idp-oauth 2.1.0-beta.24 → 2.1.0-beta.25
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/externalVersion.js
CHANGED
|
@@ -11,10 +11,11 @@ module.exports = {
|
|
|
11
11
|
"antd": "5.24.2",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/client": "2.1.0-beta.
|
|
15
|
-
"@nocobase/flow-engine": "2.1.0-beta.
|
|
16
|
-
"@nocobase/server": "2.1.0-beta.
|
|
17
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
18
|
-
"@nocobase/
|
|
19
|
-
"@nocobase/
|
|
14
|
+
"@nocobase/client": "2.1.0-beta.25",
|
|
15
|
+
"@nocobase/flow-engine": "2.1.0-beta.25",
|
|
16
|
+
"@nocobase/server": "2.1.0-beta.25",
|
|
17
|
+
"@nocobase/cache": "2.1.0-beta.25",
|
|
18
|
+
"@nocobase/plugin-auth": "2.1.0-beta.25",
|
|
19
|
+
"@nocobase/utils": "2.1.0-beta.25",
|
|
20
|
+
"@nocobase/database": "2.1.0-beta.25"
|
|
20
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"light-my-request","version":"6.6.0","description":"Fake HTTP injection library","main":"index.js","type":"commonjs","types":"types/index.d.ts","dependencies":{"cookie":"^1.0.1","process-warning":"^4.0.0","set-cookie-parser":"^2.6.0"},"devDependencies":{"@fastify/ajv-compiler":"^4.0.0","@fastify/pre-commit":"^2.1.0","@types/node":"^22.7.7","c8":"^10.1.2","end-of-stream":"^1.4.4","eslint":"^9.17.0","express":"^4.19.2","form-auto-content":"^3.2.1","form-data":"^4.0.0","formdata-node":"^6.0.3","multer":"^1.4.5-lts.1","neostandard":"^0.12.0","tinybench":"^3.0.0","tsd":"^0.31.0","undici":"^7.0.0"},"scripts":{"benchmark":"node benchmark/benchmark.js","coverage":"npm run unit -- --cov --coverage-report=html","lint":"eslint","lint:fix":"eslint --fix","test":"npm run lint && npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 --100 node --test"},"repository":{"type":"git","url":"git+https://github.com/fastify/light-my-request.git"},"keywords":["http","inject","fake","request","server"],"author":"Tomas Della Vedova - @delvedor (http://delved.org)","contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/fastify/light-my-request/issues"},"homepage":"https://github.com/fastify/light-my-request#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"_lastModified":"2026-
|
|
1
|
+
{"name":"light-my-request","version":"6.6.0","description":"Fake HTTP injection library","main":"index.js","type":"commonjs","types":"types/index.d.ts","dependencies":{"cookie":"^1.0.1","process-warning":"^4.0.0","set-cookie-parser":"^2.6.0"},"devDependencies":{"@fastify/ajv-compiler":"^4.0.0","@fastify/pre-commit":"^2.1.0","@types/node":"^22.7.7","c8":"^10.1.2","end-of-stream":"^1.4.4","eslint":"^9.17.0","express":"^4.19.2","form-auto-content":"^3.2.1","form-data":"^4.0.0","formdata-node":"^6.0.3","multer":"^1.4.5-lts.1","neostandard":"^0.12.0","tinybench":"^3.0.0","tsd":"^0.31.0","undici":"^7.0.0"},"scripts":{"benchmark":"node benchmark/benchmark.js","coverage":"npm run unit -- --cov --coverage-report=html","lint":"eslint","lint:fix":"eslint --fix","test":"npm run lint && npm run test:unit && npm run test:typescript","test:typescript":"tsd","test:unit":"c8 --100 node --test"},"repository":{"type":"git","url":"git+https://github.com/fastify/light-my-request.git"},"keywords":["http","inject","fake","request","server"],"author":"Tomas Della Vedova - @delvedor (http://delved.org)","contributors":[{"name":"Matteo Collina","email":"hello@matteocollina.com"},{"name":"Manuel Spigolon","email":"behemoth89@gmail.com"},{"name":"Aras Abbasi","email":"aras.abbasi@gmail.com"},{"name":"Frazer Smith","email":"frazer.dev@icloud.com","url":"https://github.com/fdawgs"}],"license":"BSD-3-Clause","bugs":{"url":"https://github.com/fastify/light-my-request/issues"},"homepage":"https://github.com/fastify/light-my-request#readme","funding":[{"type":"github","url":"https://github.com/sponsors/fastify"},{"type":"opencollective","url":"https://opencollective.com/fastify"}],"_lastModified":"2026-05-06T11:08:06.437Z"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e={900:e=>{var r=1e3;var s=r*60;var a=s*60;var n=a*24;var t=n*7;var u=n*365.25;e.exports=function(e,r){r=r||{};var s=typeof e;if(s==="string"&&e.length>0){return parse(e)}else if(s==="number"&&isFinite(e)){return r.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!c){return}var i=parseFloat(c[1]);var o=(c[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return i*u;case"weeks":case"week":case"w":return i*t;case"days":case"day":case"d":return i*n;case"hours":case"hour":case"hrs":case"hr":case"h":return i*a;case"minutes":case"minute":case"mins":case"min":case"m":return i*s;case"seconds":case"second":case"secs":case"sec":case"s":return i*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return undefined}}function fmtShort(e){var t=Math.abs(e);if(t>=n){return Math.round(e/n)+"d"}if(t>=a){return Math.round(e/a)+"h"}if(t>=s){return Math.round(e/s)+"m"}if(t>=r){return Math.round(e/r)+"s"}return e+"ms"}function fmtLong(e){var t=Math.abs(e);if(t>=n){return plural(e,t,n,"day")}if(t>=a){return plural(e,t,a,"hour")}if(t>=s){return plural(e,t,s,"minute")}if(t>=r){return plural(e,t,r,"second")}return e+" ms"}function plural(e,r,s,a){var n=r>=s*1.5;return Math.round(e/s)+" "+a+(n?"s":"")}}};var r={};function __nccwpck_require__(s){var a=r[s];if(a!==undefined){return a.exports}var n=r[s]={exports:{}};var t=true;try{e[s](n,n.exports,__nccwpck_require__);t=false}finally{if(t)delete r[s]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var s=__nccwpck_require__(900);module.exports=s})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2026-05-06T11:08:06.491Z"}
|
package/dist/server/service.js
CHANGED
|
@@ -39,12 +39,14 @@ __export(service_exports, {
|
|
|
39
39
|
IdpOauthService: () => IdpOauthService
|
|
40
40
|
});
|
|
41
41
|
module.exports = __toCommonJS(service_exports);
|
|
42
|
+
var import_plugin_auth = require("@nocobase/plugin-auth");
|
|
42
43
|
var import_server = require("@nocobase/server");
|
|
43
44
|
var import_node_fs = __toESM(require("node:fs"));
|
|
44
45
|
var import_light_my_request = __toESM(require("light-my-request"));
|
|
45
46
|
var import_node_crypto = require("node:crypto");
|
|
46
47
|
var import_node_path = __toESM(require("node:path"));
|
|
47
48
|
var import_utils = require("@nocobase/utils");
|
|
49
|
+
var import_ms = __toESM(require("ms"));
|
|
48
50
|
var import_db_adapter = require("./db-adapter");
|
|
49
51
|
var import_utils2 = require("./utils");
|
|
50
52
|
let oidcModulePromise = null;
|
|
@@ -64,6 +66,14 @@ function getJoseModule() {
|
|
|
64
66
|
const defaultSupportedScopes = ["openid", "offline_access", "profile", "email"];
|
|
65
67
|
const envJwksKeys = ["IDP_OAUTH_JWKS", "OAUTH_JWKS"];
|
|
66
68
|
const MAX_CACHE_TTL_MS = 2147483647;
|
|
69
|
+
const DEFAULT_ACCESS_TOKEN_TTL_SECONDS = Math.floor((0, import_ms.default)(import_plugin_auth.defaultTokenPolicyConfig.tokenExpirationTime) / 1e3);
|
|
70
|
+
const DEFAULT_SESSION_TTL_SECONDS = Math.floor((0, import_ms.default)(import_plugin_auth.defaultTokenPolicyConfig.sessionExpirationTime) / 1e3);
|
|
71
|
+
function policyMillisecondsToSeconds(value, fallback) {
|
|
72
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
|
|
73
|
+
return fallback;
|
|
74
|
+
}
|
|
75
|
+
return Math.max(1, Math.floor(value / 1e3));
|
|
76
|
+
}
|
|
67
77
|
class IdpOauthService {
|
|
68
78
|
constructor(app, bridgeTokenCache) {
|
|
69
79
|
this.app = app;
|
|
@@ -488,6 +498,12 @@ class IdpOauthService {
|
|
|
488
498
|
throw new Error("JWT secret is required for plugin-idp-oauth");
|
|
489
499
|
}
|
|
490
500
|
const jwks = await this.getProviderSigningJwks(appName);
|
|
501
|
+
const tokenPolicy = await this.app.authManager.tokenController.getConfig();
|
|
502
|
+
const accessTokenTtl = policyMillisecondsToSeconds(
|
|
503
|
+
tokenPolicy == null ? void 0 : tokenPolicy.tokenExpirationTime,
|
|
504
|
+
DEFAULT_ACCESS_TOKEN_TTL_SECONDS
|
|
505
|
+
);
|
|
506
|
+
const sessionTtl = policyMillisecondsToSeconds(tokenPolicy == null ? void 0 : tokenPolicy.sessionExpirationTime, DEFAULT_SESSION_TTL_SECONDS);
|
|
491
507
|
return {
|
|
492
508
|
adapter: (0, import_db_adapter.createDbAdapter)(this.app, "oidcStates"),
|
|
493
509
|
clients: [],
|
|
@@ -552,12 +568,12 @@ class IdpOauthService {
|
|
|
552
568
|
}
|
|
553
569
|
},
|
|
554
570
|
ttl: {
|
|
555
|
-
AccessToken:
|
|
571
|
+
AccessToken: accessTokenTtl,
|
|
556
572
|
AuthorizationCode: 60,
|
|
557
|
-
Grant:
|
|
573
|
+
Grant: sessionTtl,
|
|
558
574
|
IdToken: 60 * 60,
|
|
559
|
-
RefreshToken:
|
|
560
|
-
Session:
|
|
575
|
+
RefreshToken: sessionTtl,
|
|
576
|
+
Session: sessionTtl,
|
|
561
577
|
Interaction: 60 * 60
|
|
562
578
|
},
|
|
563
579
|
pkce: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-idp-oauth",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.25",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "IdP: OAuth",
|
|
6
6
|
"displayName.zh-CN": "IdP: OAuth",
|
|
@@ -10,15 +10,17 @@
|
|
|
10
10
|
"@types/oidc-provider": "^9.5.0",
|
|
11
11
|
"jose": "^6.2.1",
|
|
12
12
|
"light-my-request": "^6.6.0",
|
|
13
|
+
"ms": "^2.1.3",
|
|
13
14
|
"oidc-provider": "~9.7.0"
|
|
14
15
|
},
|
|
15
16
|
"peerDependencies": {
|
|
16
17
|
"@nocobase/client": "2.x",
|
|
18
|
+
"@nocobase/plugin-auth": "2.x",
|
|
17
19
|
"@nocobase/server": "2.x",
|
|
18
20
|
"@nocobase/test": "2.x"
|
|
19
21
|
},
|
|
20
22
|
"keywords": [
|
|
21
23
|
"Authentication"
|
|
22
24
|
],
|
|
23
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "824f8b8200e9fe086135768934d3ef427b212446"
|
|
24
26
|
}
|