@nocobase/plugin-auth 2.2.34 → 2.2.35
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,21 +8,21 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.2.
|
|
11
|
+
"@nocobase/client": "2.2.35",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/utils": "2.2.
|
|
14
|
+
"@nocobase/utils": "2.2.35",
|
|
15
15
|
"axios": "1.20.0",
|
|
16
16
|
"lodash": "4.18.1",
|
|
17
|
-
"@nocobase/client-v2": "2.2.
|
|
18
|
-
"@nocobase/flow-engine": "2.2.
|
|
17
|
+
"@nocobase/client-v2": "2.2.35",
|
|
18
|
+
"@nocobase/flow-engine": "2.2.35",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/auth": "2.2.
|
|
21
|
-
"@nocobase/database": "2.2.
|
|
22
|
-
"@nocobase/cache": "2.2.
|
|
23
|
-
"@nocobase/server": "2.2.
|
|
24
|
-
"@nocobase/logger": "2.2.
|
|
25
|
-
"@nocobase/test": "2.2.
|
|
20
|
+
"@nocobase/auth": "2.2.35",
|
|
21
|
+
"@nocobase/database": "2.2.35",
|
|
22
|
+
"@nocobase/cache": "2.2.35",
|
|
23
|
+
"@nocobase/server": "2.2.35",
|
|
24
|
+
"@nocobase/logger": "2.2.35",
|
|
25
|
+
"@nocobase/test": "2.2.35",
|
|
26
26
|
"@formily/antd-v5": "1.2.3",
|
|
27
27
|
"antd": "5.24.2",
|
|
28
28
|
"@formily/shared": "2.3.7",
|
|
@@ -30,6 +30,6 @@ module.exports = {
|
|
|
30
30
|
"@emotion/css": "11.13.0",
|
|
31
31
|
"@ant-design/icons": "5.6.1",
|
|
32
32
|
"ahooks": "3.7.8",
|
|
33
|
-
"@nocobase/actions": "2.2.
|
|
33
|
+
"@nocobase/actions": "2.2.35",
|
|
34
34
|
"@formily/core": "2.3.7"
|
|
35
35
|
};
|
|
@@ -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-10-
|
|
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-10-28T02:42:23.931Z"}
|
|
@@ -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-10-
|
|
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-10-28T02:42:24.018Z"}
|
package/dist/server/storer.d.ts
CHANGED
|
@@ -23,8 +23,10 @@ export declare class Storer implements IStorer {
|
|
|
23
23
|
cache: Cache;
|
|
24
24
|
authManager: AuthManager;
|
|
25
25
|
});
|
|
26
|
+
private getAuthConfig;
|
|
27
|
+
private prepare;
|
|
26
28
|
renderJsonTemplate(authenticator: any): any;
|
|
27
29
|
getCache(): Promise<AuthModel[]>;
|
|
28
30
|
setCache(authenticators: AuthModel[]): Promise<void>;
|
|
29
|
-
get(name: string): Promise<
|
|
31
|
+
get(name: string): Promise<any>;
|
|
30
32
|
}
|
package/dist/server/storer.js
CHANGED
|
@@ -29,6 +29,7 @@ __export(storer_exports, {
|
|
|
29
29
|
Storer: () => Storer
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(storer_exports);
|
|
32
|
+
const RENDERED = Symbol("authenticatorOptionsRendered");
|
|
32
33
|
class Storer {
|
|
33
34
|
db;
|
|
34
35
|
cache;
|
|
@@ -50,25 +51,37 @@ class Storer {
|
|
|
50
51
|
await this.cache.delValueInObject(this.key, model.name);
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
|
-
await this.cache.setValueInObject(this.key, model.name, this.
|
|
54
|
+
await this.cache.setValueInObject(this.key, model.name, this.prepare(model));
|
|
54
55
|
});
|
|
55
56
|
this.db.on("authenticators.afterDestroy", async (model) => {
|
|
56
57
|
await this.cache.delValueInObject(this.key, model.name);
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
getAuthConfig(authType) {
|
|
60
61
|
var _a, _b;
|
|
62
|
+
return (_b = (_a = this.authManager) == null ? void 0 : _a.getAuthConfig) == null ? void 0 : _b.call(_a, authType);
|
|
63
|
+
}
|
|
64
|
+
prepare(authenticator) {
|
|
65
|
+
return this.renderJsonTemplate(authenticator);
|
|
66
|
+
}
|
|
67
|
+
renderJsonTemplate(authenticator) {
|
|
68
|
+
var _a, _b, _c;
|
|
61
69
|
if (!authenticator) {
|
|
62
70
|
return authenticator;
|
|
63
71
|
}
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
72
|
+
const options = (_a = authenticator.dataValues) == null ? void 0 : _a.options;
|
|
73
|
+
if (options && authenticator[RENDERED] === options) {
|
|
74
|
+
return authenticator;
|
|
75
|
+
}
|
|
76
|
+
const $env = (_b = this.app) == null ? void 0 : _b.environment;
|
|
77
|
+
const config = this.getAuthConfig(authenticator.authType);
|
|
78
|
+
if (!$env || !config) {
|
|
66
79
|
return authenticator;
|
|
67
80
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
omit: (_b = config == null ? void 0 : config.auth) == null ? void 0 : _b["optionsKeysNotAllowedInEnv"]
|
|
81
|
+
authenticator.dataValues.options = $env.renderJsonTemplate(options, {
|
|
82
|
+
omit: (_c = config.auth) == null ? void 0 : _c["optionsKeysNotAllowedInEnv"]
|
|
71
83
|
});
|
|
84
|
+
authenticator[RENDERED] = authenticator.dataValues.options;
|
|
72
85
|
return authenticator;
|
|
73
86
|
}
|
|
74
87
|
async getCache() {
|
|
@@ -80,7 +93,7 @@ class Storer {
|
|
|
80
93
|
}
|
|
81
94
|
async setCache(authenticators) {
|
|
82
95
|
const obj = authenticators.reduce((obj2, authenticator) => {
|
|
83
|
-
obj2[authenticator.name] = this.
|
|
96
|
+
obj2[authenticator.name] = this.prepare(authenticator);
|
|
84
97
|
return obj2;
|
|
85
98
|
}, {});
|
|
86
99
|
await this.cache.set(this.key, obj);
|
|
@@ -93,8 +106,8 @@ class Storer {
|
|
|
93
106
|
await this.setCache(authenticators);
|
|
94
107
|
authenticators = await this.getCache();
|
|
95
108
|
}
|
|
96
|
-
const authenticator = authenticators.find((authenticator2) => authenticator2.name === name);
|
|
97
|
-
return authenticator
|
|
109
|
+
const authenticator = authenticators.find((authenticator2) => authenticator2.name === name) || authenticators[0];
|
|
110
|
+
return this.renderJsonTemplate(authenticator);
|
|
98
111
|
}
|
|
99
112
|
}
|
|
100
113
|
// 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.2.
|
|
3
|
+
"version": "2.2.35",
|
|
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": "13ccdcf7d176e839b42bd530b58e4b9639e46d3f",
|
|
35
35
|
"keywords": [
|
|
36
36
|
"Authentication",
|
|
37
37
|
"Security"
|