@nocobase/plugin-auth 2.1.0-beta.23 → 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/constants.d.ts +5 -0
- package/dist/constants.js +7 -0
- package/dist/externalVersion.js +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -0
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/node_modules/ms/package.json +1 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +3 -0
- package/dist/server/migrations/20241229080941-create-token-policy-config.js +2 -7
- package/dist/server/plugin.js +1 -6
- package/package.json +2 -2
package/dist/constants.d.ts
CHANGED
|
@@ -11,3 +11,8 @@ export declare const tokenPolicyCacheKey: string;
|
|
|
11
11
|
export declare const tokenPolicyCollectionName = "tokenControlConfig";
|
|
12
12
|
export declare const issuedTokensCollectionName = "issuedTokens";
|
|
13
13
|
export declare const RENEWED_JTI_CACHE_MS = 10000;
|
|
14
|
+
export declare const defaultTokenPolicyConfig: {
|
|
15
|
+
tokenExpirationTime: string;
|
|
16
|
+
sessionExpirationTime: string;
|
|
17
|
+
expiredTokenRenewLimit: string;
|
|
18
|
+
};
|
package/dist/constants.js
CHANGED
|
@@ -27,6 +27,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
27
27
|
var constants_exports = {};
|
|
28
28
|
__export(constants_exports, {
|
|
29
29
|
RENEWED_JTI_CACHE_MS: () => RENEWED_JTI_CACHE_MS,
|
|
30
|
+
defaultTokenPolicyConfig: () => defaultTokenPolicyConfig,
|
|
30
31
|
issuedTokensCollectionName: () => issuedTokensCollectionName,
|
|
31
32
|
tokenPolicyCacheKey: () => tokenPolicyCacheKey,
|
|
32
33
|
tokenPolicyCollectionName: () => tokenPolicyCollectionName,
|
|
@@ -38,9 +39,15 @@ const tokenPolicyCacheKey = "auth:" + tokenPolicyRecordKey;
|
|
|
38
39
|
const tokenPolicyCollectionName = "tokenControlConfig";
|
|
39
40
|
const issuedTokensCollectionName = "issuedTokens";
|
|
40
41
|
const RENEWED_JTI_CACHE_MS = 1e4;
|
|
42
|
+
const defaultTokenPolicyConfig = {
|
|
43
|
+
tokenExpirationTime: "1d",
|
|
44
|
+
sessionExpirationTime: "7d",
|
|
45
|
+
expiredTokenRenewLimit: "1d"
|
|
46
|
+
};
|
|
41
47
|
// Annotate the CommonJS export names for ESM import in node:
|
|
42
48
|
0 && (module.exports = {
|
|
43
49
|
RENEWED_JTI_CACHE_MS,
|
|
50
|
+
defaultTokenPolicyConfig,
|
|
44
51
|
issuedTokensCollectionName,
|
|
45
52
|
tokenPolicyCacheKey,
|
|
46
53
|
tokenPolicyCollectionName,
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,26 +8,26 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.1.0-beta.
|
|
11
|
+
"@nocobase/client": "2.1.0-beta.25",
|
|
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.25",
|
|
15
15
|
"axios": "1.7.7",
|
|
16
16
|
"lodash": "4.18.1",
|
|
17
|
-
"@nocobase/client-v2": "2.1.0-beta.
|
|
17
|
+
"@nocobase/client-v2": "2.1.0-beta.25",
|
|
18
18
|
"react-i18next": "11.18.6",
|
|
19
|
-
"@nocobase/auth": "2.1.0-beta.
|
|
20
|
-
"@nocobase/database": "2.1.0-beta.
|
|
21
|
-
"@nocobase/cache": "2.1.0-beta.
|
|
22
|
-
"@nocobase/server": "2.1.0-beta.
|
|
23
|
-
"@nocobase/logger": "2.1.0-beta.
|
|
24
|
-
"@nocobase/test": "2.1.0-beta.
|
|
19
|
+
"@nocobase/auth": "2.1.0-beta.25",
|
|
20
|
+
"@nocobase/database": "2.1.0-beta.25",
|
|
21
|
+
"@nocobase/cache": "2.1.0-beta.25",
|
|
22
|
+
"@nocobase/server": "2.1.0-beta.25",
|
|
23
|
+
"@nocobase/logger": "2.1.0-beta.25",
|
|
24
|
+
"@nocobase/test": "2.1.0-beta.25",
|
|
25
25
|
"@formily/antd-v5": "1.2.3",
|
|
26
26
|
"antd": "5.24.2",
|
|
27
27
|
"@formily/shared": "2.3.7",
|
|
28
28
|
"@formily/react": "2.3.7",
|
|
29
29
|
"@emotion/css": "11.13.0",
|
|
30
30
|
"@ant-design/icons": "5.6.1",
|
|
31
|
-
"@nocobase/actions": "2.1.0-beta.
|
|
31
|
+
"@nocobase/actions": "2.1.0-beta.25",
|
|
32
32
|
"@formily/core": "2.3.7"
|
|
33
33
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
export { AuthModel, BasicAuth, default, presetAuthType } from './server';
|
|
9
|
+
export { AuthModel, BasicAuth, default, presetAuthType, defaultTokenPolicyConfig } from './server';
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __export(src_exports, {
|
|
|
39
39
|
AuthModel: () => import_server.AuthModel,
|
|
40
40
|
BasicAuth: () => import_server.BasicAuth,
|
|
41
41
|
default: () => import_server.default,
|
|
42
|
+
defaultTokenPolicyConfig: () => import_server.defaultTokenPolicyConfig,
|
|
42
43
|
presetAuthType: () => import_server.presetAuthType
|
|
43
44
|
});
|
|
44
45
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -47,5 +48,6 @@ var import_server = __toESM(require("./server"));
|
|
|
47
48
|
0 && (module.exports = {
|
|
48
49
|
AuthModel,
|
|
49
50
|
BasicAuth,
|
|
51
|
+
defaultTokenPolicyConfig,
|
|
50
52
|
presetAuthType
|
|
51
53
|
});
|
|
@@ -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-05-06T11:07:37.705Z"}
|
|
@@ -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-05-06T11:07:37.800Z"}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@
|
|
|
9
9
|
export { BasicAuth } from './basic-auth';
|
|
10
10
|
export { AuthModel } from './model/authenticator';
|
|
11
11
|
export { presetAuthType } from '../preset';
|
|
12
|
+
export { defaultTokenPolicyConfig } from '../constants';
|
|
12
13
|
export { default } from './plugin';
|
|
13
14
|
export * from '../constants';
|
package/dist/server/index.js
CHANGED
|
@@ -40,18 +40,21 @@ __export(server_exports, {
|
|
|
40
40
|
AuthModel: () => import_authenticator.AuthModel,
|
|
41
41
|
BasicAuth: () => import_basic_auth.BasicAuth,
|
|
42
42
|
default: () => import_plugin.default,
|
|
43
|
+
defaultTokenPolicyConfig: () => import_constants.defaultTokenPolicyConfig,
|
|
43
44
|
presetAuthType: () => import_preset.presetAuthType
|
|
44
45
|
});
|
|
45
46
|
module.exports = __toCommonJS(server_exports);
|
|
46
47
|
var import_basic_auth = require("./basic-auth");
|
|
47
48
|
var import_authenticator = require("./model/authenticator");
|
|
48
49
|
var import_preset = require("../preset");
|
|
50
|
+
var import_constants = require("../constants");
|
|
49
51
|
var import_plugin = __toESM(require("./plugin"));
|
|
50
52
|
__reExport(server_exports, require("../constants"), module.exports);
|
|
51
53
|
// Annotate the CommonJS export names for ESM import in node:
|
|
52
54
|
0 && (module.exports = {
|
|
53
55
|
AuthModel,
|
|
54
56
|
BasicAuth,
|
|
57
|
+
defaultTokenPolicyConfig,
|
|
55
58
|
presetAuthType,
|
|
56
59
|
...require("../constants")
|
|
57
60
|
});
|
|
@@ -41,18 +41,13 @@ class create_token_policy_config_default extends import_server.Migration {
|
|
|
41
41
|
if (tokenPolicy) {
|
|
42
42
|
this.app.authManager.tokenController.setConfig(tokenPolicy.config);
|
|
43
43
|
} else {
|
|
44
|
-
const config = {
|
|
45
|
-
tokenExpirationTime: "1d",
|
|
46
|
-
sessionExpirationTime: "7d",
|
|
47
|
-
expiredTokenRenewLimit: "1d"
|
|
48
|
-
};
|
|
49
44
|
await tokenPolicyRepo.create({
|
|
50
45
|
values: {
|
|
51
46
|
key: import_constants.tokenPolicyRecordKey,
|
|
52
|
-
config
|
|
47
|
+
config: import_constants.defaultTokenPolicyConfig
|
|
53
48
|
}
|
|
54
49
|
});
|
|
55
|
-
this.app.authManager.tokenController.setConfig(
|
|
50
|
+
this.app.authManager.tokenController.setConfig(import_constants.defaultTokenPolicyConfig);
|
|
56
51
|
}
|
|
57
52
|
}
|
|
58
53
|
}
|
package/dist/server/plugin.js
CHANGED
|
@@ -311,15 +311,10 @@ class PluginAuthServer extends import_server.Plugin {
|
|
|
311
311
|
if (res) {
|
|
312
312
|
return;
|
|
313
313
|
}
|
|
314
|
-
const config = {
|
|
315
|
-
tokenExpirationTime: "1d",
|
|
316
|
-
sessionExpirationTime: "7d",
|
|
317
|
-
expiredTokenRenewLimit: "1d"
|
|
318
|
-
};
|
|
319
314
|
await tokenPolicyRepo.create({
|
|
320
315
|
values: {
|
|
321
316
|
key: import_constants.tokenPolicyRecordKey,
|
|
322
|
-
config
|
|
317
|
+
config: import_constants.defaultTokenPolicyConfig
|
|
323
318
|
}
|
|
324
319
|
});
|
|
325
320
|
}
|
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.25",
|
|
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",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
32
32
|
"description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
|
|
33
33
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "824f8b8200e9fe086135768934d3ef427b212446",
|
|
35
35
|
"keywords": [
|
|
36
36
|
"Authentication",
|
|
37
37
|
"Security"
|