@tachybase/plugin-password-policy 1.6.0 → 1.6.3

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.
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.6.0",
4
- "@tachybase/schema": "1.3.52",
3
+ "@tachybase/client": "1.6.3",
4
+ "@tachybase/schema": "1.6.1",
5
5
  "antd": "5.22.5",
6
- "@tego/server": "1.3.52"
6
+ "@tego/server": "1.6.1"
7
7
  };
@@ -1 +1 @@
1
- {"name":"geoip-lite","version":"1.4.10","description":"A light weight native JavaScript implementation of GeoIP API from MaxMind","keywords":["geo","geoip","ip","ipv4","ipv6","geolookup","maxmind","geolite"],"homepage":"https://github.com/geoip-lite/node-geoip","author":"Philip Tellis <philip@bluesmoon.info> (http://bluesmoon.info/)","files":["lib/","data/","test/","scripts/"],"main":"lib/geoip.js","repository":{"type":"git","url":"git://github.com/geoip-lite/node-geoip.git"},"engines":{"node":">=10.3.0"},"scripts":{"pretest":"eslint .","test":"nodeunit --reporter=minimal test/tests.js","updatedb":"node scripts/updatedb.js","updatedb-debug":"node scripts/updatedb.js debug","updatedb-force":"node scripts/updatedb.js force"},"dependencies":{"async":"2.1 - 2.6.4","chalk":"4.1 - 4.1.2","iconv-lite":"0.4.13 - 0.6.3","ip-address":"5.8.9 - 5.9.4","lazy":"1.0.11","rimraf":"2.5.2 - 2.7.1","yauzl":"2.9.2 - 2.10.0"},"config":{"update":true},"devDependencies":{"eslint":"^5.12.1","nodeunit":"^0.11.2"},"license":"Apache-2.0","_lastModified":"2025-11-20T08:15:14.421Z"}
1
+ {"name":"geoip-lite","version":"1.4.10","description":"A light weight native JavaScript implementation of GeoIP API from MaxMind","keywords":["geo","geoip","ip","ipv4","ipv6","geolookup","maxmind","geolite"],"homepage":"https://github.com/geoip-lite/node-geoip","author":"Philip Tellis <philip@bluesmoon.info> (http://bluesmoon.info/)","files":["lib/","data/","test/","scripts/"],"main":"lib/geoip.js","repository":{"type":"git","url":"git://github.com/geoip-lite/node-geoip.git"},"engines":{"node":">=10.3.0"},"scripts":{"pretest":"eslint .","test":"nodeunit --reporter=minimal test/tests.js","updatedb":"node scripts/updatedb.js","updatedb-debug":"node scripts/updatedb.js debug","updatedb-force":"node scripts/updatedb.js force"},"dependencies":{"async":"2.1 - 2.6.4","chalk":"4.1 - 4.1.2","iconv-lite":"0.4.13 - 0.6.3","ip-address":"5.8.9 - 5.9.4","lazy":"1.0.11","rimraf":"2.5.2 - 2.7.1","yauzl":"2.9.2 - 2.10.0"},"config":{"update":true},"devDependencies":{"eslint":"^5.12.1","nodeunit":"^0.11.2"},"license":"Apache-2.0","_lastModified":"2025-12-26T04:46:57.863Z"}
@@ -105,7 +105,7 @@ class IpFilterController {
105
105
  await transaction.commit();
106
106
  ctx.body = data;
107
107
  } catch (err) {
108
- ctx.app.logger.error("put ip filter config error", err);
108
+ ctx.tego.logger.error("put ip filter config error", err);
109
109
  if (transaction) await transaction.rollback();
110
110
  throw err;
111
111
  }
@@ -105,7 +105,7 @@ class PasswordAttemptController {
105
105
  await transaction2.commit();
106
106
  ctx.body = data;
107
107
  } catch (err) {
108
- ctx.app.logger.error("put password policy config error", err);
108
+ ctx.tego.logger.error("put password policy config error", err);
109
109
  transaction == null ? void 0 : transaction.rollback();
110
110
  }
111
111
  return next();
@@ -106,7 +106,7 @@ class PasswordPolicyController {
106
106
  await transaction2.commit();
107
107
  ctx.body = data;
108
108
  } catch (err) {
109
- ctx.app.logger.error("put password policy config error", err);
109
+ ctx.tego.logger.error("put password policy config error", err);
110
110
  transaction == null ? void 0 : transaction.rollback();
111
111
  }
112
112
  return next();
@@ -105,7 +105,7 @@ class PasswordStrengthController {
105
105
  await transaction2.commit();
106
106
  ctx.body = data;
107
107
  } catch (err) {
108
- ctx.app.logger.error("put password strength config error", err);
108
+ ctx.tego.logger.error("put password strength config error", err);
109
109
  transaction == null ? void 0 : transaction.rollback();
110
110
  }
111
111
  return next();
@@ -123,7 +123,7 @@ class SignInFailsController {
123
123
  totalPage: Math.ceil(count / Number(pageSize))
124
124
  };
125
125
  } catch (error) {
126
- ctx.app.logger.error("Failed to list sign-in fails:", error);
126
+ ctx.tego.logger.error("Failed to list sign-in fails:", error);
127
127
  ctx.throw(500, ctx.t("Failed to load sign-in fails history", { ns: "plugin-password-policy" }));
128
128
  }
129
129
  return next();
@@ -139,7 +139,7 @@ class SignInFailsController {
139
139
  });
140
140
  ctx.body = result;
141
141
  } catch (error) {
142
- ctx.app.logger.error("Failed to get sign-in fail record:", error);
142
+ ctx.tego.logger.error("Failed to get sign-in fail record:", error);
143
143
  ctx.throw(500, ctx.t("Failed to load sign-in fail record", { ns: "plugin-password-policy" }));
144
144
  }
145
145
  return next();
@@ -396,7 +396,8 @@ class PasswordAttemptService {
396
396
  );
397
397
  this.app.resourcer.use(
398
398
  async (ctx, next) => {
399
- if (this.config.strictLock && ctx.state.currentUser) {
399
+ var _a;
400
+ if (((_a = this.config) == null ? void 0 : _a.strictLock) && ctx.state.currentUser) {
400
401
  const userId = ctx.state.currentUser.id;
401
402
  const isLocked = await this.isUserLocked(userId);
402
403
  if (isLocked) {
@@ -396,7 +396,8 @@ class PasswordPolicyService {
396
396
  );
397
397
  this.app.resourcer.use(
398
398
  async (ctx, next) => {
399
- if (this.config.strictLock && ctx.state.currentUser) {
399
+ var _a;
400
+ if (((_a = this.config) == null ? void 0 : _a.strictLock) && ctx.state.currentUser) {
400
401
  const userId = ctx.state.currentUser.id;
401
402
  const isLocked = await this.isUserLocked(userId);
402
403
  if (isLocked) {
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-password-policy",
3
3
  "displayName": "Password policy",
4
- "version": "1.6.0",
4
+ "version": "1.6.3",
5
5
  "description": "Password policy, including password strength, password attempt limit, password lock time, ip whitelist/blacklist, etc.",
6
6
  "keywords": [
7
7
  "Security"
8
8
  ],
9
9
  "main": "dist/server/index.js",
10
10
  "devDependencies": {
11
- "@ant-design/icons": "^5.6.1",
12
- "@tachybase/schema": "1.3.52",
13
- "@tego/client": "1.3.52",
14
- "@tego/server": "1.3.52",
11
+ "@ant-design/icons": "^6.1.0",
12
+ "@tachybase/schema": "1.6.1",
13
+ "@tego/client": "1.6.1",
14
+ "@tego/server": "1.6.1",
15
15
  "antd": "5.22.5",
16
16
  "geoip-lite": "^1.4.9",
17
17
  "ipaddr.js": "^2.1.0",
18
- "@tachybase/client": "1.6.0"
18
+ "@tachybase/client": "1.6.3"
19
19
  },
20
20
  "description.zh-CN": "密码策略, 包含密码强度、密码尝试次数限制、密码锁定时间、ip黑白名单等",
21
21
  "displayName.zh-CN": "密码策略"