@nocobase/plugin-auth 2.1.0-beta.10 → 2.1.0-beta.12
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
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.12",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/utils": "2.1.0-beta.
|
|
14
|
+
"@nocobase/utils": "2.1.0-beta.12",
|
|
15
15
|
"axios": "1.7.7",
|
|
16
16
|
"lodash": "4.17.21",
|
|
17
|
-
"@nocobase/auth": "2.1.0-beta.
|
|
18
|
-
"@nocobase/database": "2.1.0-beta.
|
|
19
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
20
|
-
"@nocobase/server": "2.1.0-beta.
|
|
21
|
-
"@nocobase/logger": "2.1.0-beta.
|
|
22
|
-
"@nocobase/test": "2.1.0-beta.
|
|
17
|
+
"@nocobase/auth": "2.1.0-beta.12",
|
|
18
|
+
"@nocobase/database": "2.1.0-beta.12",
|
|
19
|
+
"@nocobase/cache": "2.1.0-beta.12",
|
|
20
|
+
"@nocobase/server": "2.1.0-beta.12",
|
|
21
|
+
"@nocobase/logger": "2.1.0-beta.12",
|
|
22
|
+
"@nocobase/test": "2.1.0-beta.12",
|
|
23
23
|
"@formily/antd-v5": "1.2.3",
|
|
24
24
|
"antd": "5.24.2",
|
|
25
25
|
"@formily/shared": "2.3.7",
|
|
@@ -27,6 +27,6 @@ module.exports = {
|
|
|
27
27
|
"react-i18next": "11.18.6",
|
|
28
28
|
"@emotion/css": "11.13.0",
|
|
29
29
|
"@ant-design/icons": "5.6.1",
|
|
30
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
30
|
+
"@nocobase/actions": "2.1.0-beta.12",
|
|
31
31
|
"@formily/core": "2.3.7"
|
|
32
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-04-08T08:12:54.895Z"}
|
|
@@ -1 +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-
|
|
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-04-08T08:12:54.987Z"}
|
|
@@ -116,35 +116,43 @@ class TokenController {
|
|
|
116
116
|
return data;
|
|
117
117
|
}
|
|
118
118
|
renew = async (jti) => {
|
|
119
|
-
const repo = this.app.db.getRepository(import_constants.issuedTokensCollectionName);
|
|
120
119
|
const model = this.app.db.getModel(import_constants.issuedTokensCollectionName);
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{ where: { jti } }
|
|
126
|
-
);
|
|
127
|
-
if (count === 1) {
|
|
128
|
-
await this.cache.set(`jti-renewed-cahce:${jti}`, { jti: newId, issuedTime }, import_constants.RENEWED_JTI_CACHE_MS);
|
|
129
|
-
this.logger.info("jti renewed", { oldJti: jti, newJti: newId, issuedTime });
|
|
130
|
-
return { jti: newId, issuedTime };
|
|
131
|
-
} else {
|
|
132
|
-
const cachedJtiData = await this.cache.get(`jti-renewed-cahce:${jti}`);
|
|
133
|
-
if (cachedJtiData) {
|
|
134
|
-
return cachedJtiData;
|
|
135
|
-
}
|
|
136
|
-
this.logger.error("jti renew failed", {
|
|
137
|
-
module: "auth",
|
|
138
|
-
submodule: "token-controller",
|
|
139
|
-
method: "renew",
|
|
140
|
-
jti,
|
|
141
|
-
code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
|
|
142
|
-
});
|
|
143
|
-
throw new import_auth.AuthError({
|
|
144
|
-
message: "Your session has expired. Please sign in again.",
|
|
145
|
-
code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
|
|
146
|
-
});
|
|
120
|
+
const cacheKey = `jti-renewed-cahce:${jti}`;
|
|
121
|
+
const cachedJtiData = await this.cache.get(cacheKey);
|
|
122
|
+
if (cachedJtiData) {
|
|
123
|
+
return cachedJtiData;
|
|
147
124
|
}
|
|
125
|
+
return await this.cache.wrap(
|
|
126
|
+
cacheKey,
|
|
127
|
+
async () => {
|
|
128
|
+
const newId = (0, import_crypto.randomUUID)();
|
|
129
|
+
const issuedTime = Date.now();
|
|
130
|
+
const [count] = await model.update(
|
|
131
|
+
{ jti: newId, issuedTime },
|
|
132
|
+
{ where: { jti } }
|
|
133
|
+
);
|
|
134
|
+
if (count === 1) {
|
|
135
|
+
this.logger.info("jti renewed", { oldJti: jti, newJti: newId, issuedTime });
|
|
136
|
+
return { jti: newId, issuedTime };
|
|
137
|
+
}
|
|
138
|
+
const renewedJtiData = await this.cache.get(cacheKey);
|
|
139
|
+
if (renewedJtiData) {
|
|
140
|
+
return renewedJtiData;
|
|
141
|
+
}
|
|
142
|
+
this.logger.error("jti renew failed", {
|
|
143
|
+
module: "auth",
|
|
144
|
+
submodule: "token-controller",
|
|
145
|
+
method: "renew",
|
|
146
|
+
jti,
|
|
147
|
+
code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
|
|
148
|
+
});
|
|
149
|
+
throw new import_auth.AuthError({
|
|
150
|
+
message: "Your session has expired. Please sign in again.",
|
|
151
|
+
code: import_auth.AuthErrorCode.TOKEN_RENEW_FAILED
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
import_constants.RENEWED_JTI_CACHE_MS
|
|
155
|
+
);
|
|
148
156
|
};
|
|
149
157
|
}
|
|
150
158
|
// Annotate the CommonJS export names for ESM import in node:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.12",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/auth",
|
|
6
6
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/auth",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
31
31
|
"description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
|
|
32
32
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "25cee9643f42f850afc4adc33c55a56850ac730d",
|
|
34
34
|
"keywords": [
|
|
35
35
|
"Authentication",
|
|
36
36
|
"Security"
|