@tachybase/plugin-password-policy 1.0.6
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/README.md +1 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/IPFilterForm.d.ts +1 -0
- package/dist/client/PasswordAttemptForm.d.ts +1 -0
- package/dist/client/PasswordStrengthSettingsForm.d.ts +2 -0
- package/dist/client/SignInFailsTable.d.ts +2 -0
- package/dist/client/UserLocksTable.d.ts +2 -0
- package/dist/client/collections/signInFails.d.ts +2 -0
- package/dist/client/collections/userLocks.d.ts +2 -0
- package/dist/client/hooks/usePasswordStrength.d.ts +11 -0
- package/dist/client/hooks/usePasswordValidator.d.ts +16 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js +4 -0
- package/dist/client/locale.d.ts +6 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +44 -0
- package/dist/externalVersion.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +107 -0
- package/dist/locale/zh-CN.json +107 -0
- package/dist/node_modules/geoip-lite/LICENSE +50 -0
- package/dist/node_modules/geoip-lite/data/city.checksum +1 -0
- package/dist/node_modules/geoip-lite/data/country.checksum +1 -0
- package/dist/node_modules/geoip-lite/data/geoip-city-names.dat +0 -0
- package/dist/node_modules/geoip-lite/data/geoip-city.dat +0 -0
- package/dist/node_modules/geoip-lite/data/geoip-city6.dat +0 -0
- package/dist/node_modules/geoip-lite/data/geoip-country.dat +0 -0
- package/dist/node_modules/geoip-lite/data/geoip-country6.dat +0 -0
- package/dist/node_modules/geoip-lite/lib/fsWatcher.js +83 -0
- package/dist/node_modules/geoip-lite/lib/geoip.js +1 -0
- package/dist/node_modules/geoip-lite/lib/utils.js +98 -0
- package/dist/node_modules/geoip-lite/node_modules/.bin/rimraf +17 -0
- package/dist/node_modules/geoip-lite/package.json +1 -0
- package/dist/node_modules/geoip-lite/scripts/updatedb.js +685 -0
- package/dist/node_modules/geoip-lite/test/geo-lookup.js +56 -0
- package/dist/node_modules/geoip-lite/test/memory_usage.js +3 -0
- package/dist/node_modules/geoip-lite/test/tests.js +197 -0
- package/dist/server/actions/IpFilterController.d.ts +7 -0
- package/dist/server/actions/IpFilterController.js +124 -0
- package/dist/server/actions/PasswordAttemptController.d.ts +7 -0
- package/dist/server/actions/PasswordAttemptController.js +123 -0
- package/dist/server/actions/PasswordStrengthController.d.ts +7 -0
- package/dist/server/actions/PasswordStrengthController.js +123 -0
- package/dist/server/actions/SignInFailsController.d.ts +5 -0
- package/dist/server/actions/SignInFailsController.js +156 -0
- package/dist/server/actions/UserLocksController.d.ts +4 -0
- package/dist/server/actions/UserLocksController.js +102 -0
- package/dist/server/collections/ipFilter.d.ts +2 -0
- package/dist/server/collections/ipFilter.js +51 -0
- package/dist/server/collections/passwordAttempt.d.ts +2 -0
- package/dist/server/collections/passwordAttempt.js +55 -0
- package/dist/server/collections/passwordHistory.d.ts +2 -0
- package/dist/server/collections/passwordHistory.js +46 -0
- package/dist/server/collections/passwordStrengthConfig.d.ts +2 -0
- package/dist/server/collections/passwordStrengthConfig.js +59 -0
- package/dist/server/collections/signInFail.d.ts +2 -0
- package/dist/server/collections/signInFail.js +56 -0
- package/dist/server/collections/userLocks.d.ts +2 -0
- package/dist/server/collections/userLocks.js +51 -0
- package/dist/server/collections/users.d.ts +2 -0
- package/dist/server/collections/users.js +42 -0
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +33 -0
- package/dist/server/plugin.d.ts +5 -0
- package/dist/server/plugin.js +129 -0
- package/dist/server/services/IPFilterService.d.ts +49 -0
- package/dist/server/services/IPFilterService.js +270 -0
- package/dist/server/services/PasswordAttemptService.d.ts +75 -0
- package/dist/server/services/PasswordAttemptService.js +595 -0
- package/dist/server/services/PasswordStrengthService.d.ts +28 -0
- package/dist/server/services/PasswordStrengthService.js +313 -0
- package/dist/types/geoip-lite.d.js +0 -0
- package/package.json +25 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var assert = require('assert');
|
|
2
|
+
var t1 =+ new Date();
|
|
3
|
+
var geoip = require('../lib/geoip');
|
|
4
|
+
var t2 =+ new Date();
|
|
5
|
+
|
|
6
|
+
if (process.argv.length > 2) {
|
|
7
|
+
console.dir(geoip.lookup(process.argv[2]));
|
|
8
|
+
var t3 =+ new Date();
|
|
9
|
+
console.log('Startup: %dms, exec: %dms', t2 - t1, t3 - t2);
|
|
10
|
+
process.exit();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var f = [];
|
|
14
|
+
var ip;
|
|
15
|
+
var n = 30000;
|
|
16
|
+
var nf = [];
|
|
17
|
+
var r;
|
|
18
|
+
var ts =+ new Date();
|
|
19
|
+
|
|
20
|
+
for (var i = 0; i < n; i++) {
|
|
21
|
+
if ((i % 2) === 0) {
|
|
22
|
+
ip = Math.round((Math.random() * 0xff000000)+ 0xffffff);
|
|
23
|
+
} else {
|
|
24
|
+
ip = '2001:' +
|
|
25
|
+
Math.round(Math.random()*0xffff).toString(16) + ':' +
|
|
26
|
+
Math.round(Math.random()*0xffff).toString(16) + ':' +
|
|
27
|
+
Math.round(Math.random()*0xffff).toString(16) + ':' +
|
|
28
|
+
Math.round(Math.random()*0xffff).toString(16) + ':' +
|
|
29
|
+
Math.round(Math.random()*0xffff).toString(16) + ':' +
|
|
30
|
+
Math.round(Math.random()*0xffff).toString(16) + ':' +
|
|
31
|
+
Math.round(Math.random()*0xffff).toString(16) + '';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
r = geoip.lookup(ip);
|
|
35
|
+
|
|
36
|
+
if (r === null) {
|
|
37
|
+
nf.push(ip);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
f.push([ip, r]);
|
|
42
|
+
|
|
43
|
+
assert.ok(geoip.cmp(ip, r.range[0]) >= 0 , 'Problem with ' + geoip.pretty(ip) + ' < ' + geoip.pretty(r.range[0]));
|
|
44
|
+
assert.ok(geoip.cmp(ip, r.range[1]) <= 0 , 'Problem with ' + geoip.pretty(ip) + ' > ' + geoip.pretty(r.range[1]));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var te =+ new Date();
|
|
48
|
+
|
|
49
|
+
/*
|
|
50
|
+
f.forEach(function(ip) {
|
|
51
|
+
console.log("%s bw %s & %s is %s", geoip.pretty(ip[0]), geoip.pretty(ip[1].range[0]), geoip.pretty(ip[1].range[1]), ip[1].country);
|
|
52
|
+
});
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
console.log("Found %d (%d/%d) ips in %dms (%s ip/s) (%sμs/ip)", n, f.length, nf.length, te-ts, (n*1000 / (te-ts)).toFixed(3), ((te-ts) * 1000 / n).toFixed(0));
|
|
56
|
+
console.log("Took %d ms to startup", t2 - t1);
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
var geoip = require('../lib/geoip');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
testLookup: function(test) {
|
|
5
|
+
test.expect(2);
|
|
6
|
+
|
|
7
|
+
var ip = '8.8.4.4';
|
|
8
|
+
var ipv6 = '2001:4860:b002::68';
|
|
9
|
+
|
|
10
|
+
var actual = geoip.lookup(ip);
|
|
11
|
+
|
|
12
|
+
test.ok(actual, 'should return data about IPv4.');
|
|
13
|
+
|
|
14
|
+
actual = geoip.lookup(ipv6);
|
|
15
|
+
|
|
16
|
+
test.ok(actual, 'should return data about IPv6.');
|
|
17
|
+
|
|
18
|
+
test.done();
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
testDataIP4: function(test) {
|
|
22
|
+
test.expect(9);
|
|
23
|
+
|
|
24
|
+
var ip = '72.229.28.185';
|
|
25
|
+
|
|
26
|
+
var actual = geoip.lookup(ip);
|
|
27
|
+
|
|
28
|
+
test.notStrictEqual(actual.range, undefined, 'should contain IPv4 range');
|
|
29
|
+
|
|
30
|
+
test.strictEqual(actual.country, 'US', "should match country");
|
|
31
|
+
|
|
32
|
+
test.strictEqual(actual.region, 'NY', "should match region");
|
|
33
|
+
|
|
34
|
+
test.strictEqual(actual.eu, '0', "should match eu");
|
|
35
|
+
|
|
36
|
+
test.strictEqual(actual.timezone, 'America/New_York', "should match timezone");
|
|
37
|
+
|
|
38
|
+
test.strictEqual(actual.city, 'New York', "should match city");
|
|
39
|
+
|
|
40
|
+
test.ok(actual.ll, 'should contain coordinates');
|
|
41
|
+
|
|
42
|
+
test.strictEqual(actual.metro, 501, "should match metro");
|
|
43
|
+
|
|
44
|
+
test.strictEqual(actual.area, 1, "should match area");
|
|
45
|
+
|
|
46
|
+
test.done();
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
testDataIP6: function(test) {
|
|
50
|
+
test.expect(9);
|
|
51
|
+
|
|
52
|
+
var ipv6 = '2001:1c04:400::1';
|
|
53
|
+
|
|
54
|
+
var actual = geoip.lookup(ipv6);
|
|
55
|
+
|
|
56
|
+
test.notStrictEqual(actual.range, undefined, 'should contain IPv6 range');
|
|
57
|
+
|
|
58
|
+
test.strictEqual(actual.country, 'NL', "should match country");
|
|
59
|
+
|
|
60
|
+
test.strictEqual(actual.region, 'NH', "should match region");
|
|
61
|
+
|
|
62
|
+
test.strictEqual(actual.eu, '1', "should match eu");
|
|
63
|
+
|
|
64
|
+
test.strictEqual(actual.timezone, 'Europe/Amsterdam', "should match timezone");
|
|
65
|
+
|
|
66
|
+
test.strictEqual(actual.city, 'Amsterdam', "should match city");
|
|
67
|
+
|
|
68
|
+
test.ok(actual.ll, 'should contain coordinates');
|
|
69
|
+
|
|
70
|
+
test.strictEqual(actual.metro, 0, "should match metro");
|
|
71
|
+
|
|
72
|
+
test.strictEqual(actual.area, 5, "should match area");
|
|
73
|
+
|
|
74
|
+
test.done();
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
testUTF8: function(test) {
|
|
78
|
+
test.expect(2);
|
|
79
|
+
|
|
80
|
+
var ip = "2.139.175.1";
|
|
81
|
+
var expected = "Pamplona";
|
|
82
|
+
var actual = geoip.lookup(ip);
|
|
83
|
+
|
|
84
|
+
test.ok(actual, "Should return a non-null value for " + ip);
|
|
85
|
+
test.equal(actual.city, expected, "UTF8 city name does not match");
|
|
86
|
+
|
|
87
|
+
test.done();
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
testMetro: function(test) {
|
|
91
|
+
test.expect(2);
|
|
92
|
+
|
|
93
|
+
var actual = geoip.lookup("23.240.63.68");
|
|
94
|
+
|
|
95
|
+
test.equal(actual.city, "Riverside"); //keeps changing with each update from one city to other (close to each other geographically)
|
|
96
|
+
test.equal(actual.metro, 803);
|
|
97
|
+
|
|
98
|
+
test.done();
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
testIPv4MappedIPv6: function (test) {
|
|
102
|
+
test.expect(2);
|
|
103
|
+
|
|
104
|
+
var actual = geoip.lookup("195.16.170.74");
|
|
105
|
+
|
|
106
|
+
test.equal(actual.city, "");
|
|
107
|
+
test.equal(actual.metro, 0);
|
|
108
|
+
|
|
109
|
+
test.done();
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
testSyncReload: function (test) {
|
|
113
|
+
test.expect(6);
|
|
114
|
+
|
|
115
|
+
//get original data
|
|
116
|
+
var before4 = geoip.lookup("75.82.117.180");
|
|
117
|
+
test.notEqual(before4, null);
|
|
118
|
+
|
|
119
|
+
var before6 = geoip.lookup("::ffff:173.185.182.82");
|
|
120
|
+
test.notEqual(before6, null);
|
|
121
|
+
|
|
122
|
+
//clear data;
|
|
123
|
+
geoip.clear();
|
|
124
|
+
|
|
125
|
+
//make sure data is cleared
|
|
126
|
+
var none4 = geoip.lookup("75.82.117.180");
|
|
127
|
+
test.equal(none4, null);
|
|
128
|
+
var none6 = geoip.lookup("::ffff:173.185.182.82");
|
|
129
|
+
test.equal(none6, null);
|
|
130
|
+
|
|
131
|
+
//reload data synchronized
|
|
132
|
+
geoip.reloadDataSync();
|
|
133
|
+
|
|
134
|
+
//make sure we have value from before
|
|
135
|
+
var after4 = geoip.lookup("75.82.117.180");
|
|
136
|
+
test.deepEqual(before4, after4);
|
|
137
|
+
var after6 = geoip.lookup("::ffff:173.185.182.82");
|
|
138
|
+
test.deepEqual(before6, after6);
|
|
139
|
+
|
|
140
|
+
test.done();
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
testAsyncReload: function (test) {
|
|
144
|
+
test.expect(6);
|
|
145
|
+
|
|
146
|
+
//get original data
|
|
147
|
+
var before4 = geoip.lookup("75.82.117.180");
|
|
148
|
+
test.notEqual(before4, null);
|
|
149
|
+
var before6 = geoip.lookup("::ffff:173.185.182.82");
|
|
150
|
+
test.notEqual(before6, null);
|
|
151
|
+
|
|
152
|
+
//clear data;
|
|
153
|
+
geoip.clear();
|
|
154
|
+
|
|
155
|
+
//make sure data is cleared
|
|
156
|
+
var none4 = geoip.lookup("75.82.117.180");
|
|
157
|
+
test.equal(none4, null);
|
|
158
|
+
var none6 = geoip.lookup("::ffff:173.185.182.82");
|
|
159
|
+
test.equal(none6, null);
|
|
160
|
+
|
|
161
|
+
//reload data asynchronously
|
|
162
|
+
geoip.reloadData(function(){
|
|
163
|
+
//make sure we have value from before
|
|
164
|
+
var after4 = geoip.lookup("75.82.117.180");
|
|
165
|
+
test.deepEqual(before4, after4);
|
|
166
|
+
var after6 = geoip.lookup("::ffff:173.185.182.82");
|
|
167
|
+
test.deepEqual(before6, after6);
|
|
168
|
+
|
|
169
|
+
test.done();
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
testUnassigned: function (test) {
|
|
174
|
+
test.expect(8);
|
|
175
|
+
|
|
176
|
+
var ip = '1.1.1.1';
|
|
177
|
+
|
|
178
|
+
var actual = geoip.lookup(ip);
|
|
179
|
+
|
|
180
|
+
test.notStrictEqual(actual.range, undefined, 'should contain IPv4 range');
|
|
181
|
+
|
|
182
|
+
test.strictEqual(actual.country, '', "should match empty country");
|
|
183
|
+
|
|
184
|
+
test.strictEqual(actual.region, '', "should match empty region");
|
|
185
|
+
|
|
186
|
+
test.strictEqual(actual.eu, '', "should match empty eu");
|
|
187
|
+
|
|
188
|
+
test.strictEqual(actual.timezone, '', "should match empty timezone");
|
|
189
|
+
|
|
190
|
+
test.strictEqual(actual.city, '', "should match empty city");
|
|
191
|
+
|
|
192
|
+
test.strictEqual(actual.ll[0], null, 'should contain empty coordinates');
|
|
193
|
+
test.strictEqual(actual.ll[1], null, 'should contain empty coordinates');
|
|
194
|
+
|
|
195
|
+
test.done();
|
|
196
|
+
}
|
|
197
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context, Next } from '@tachybase/actions';
|
|
2
|
+
import { IPFilterService } from '../services/IPFilterService';
|
|
3
|
+
export declare class IpFilterController {
|
|
4
|
+
ipFilterService: IPFilterService;
|
|
5
|
+
getConfig(ctx: Context, next: Next): Promise<any>;
|
|
6
|
+
setConfig(ctx: Context, next: Next): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
26
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
27
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
28
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
29
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
30
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
31
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
35
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
36
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
37
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
38
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
39
|
+
return __privateGet(this, extra);
|
|
40
|
+
}, set [name](x) {
|
|
41
|
+
return __privateSet(this, extra, x);
|
|
42
|
+
} }, name));
|
|
43
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
44
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
45
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
46
|
+
if (k) {
|
|
47
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
48
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
49
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
50
|
+
}
|
|
51
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
52
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
53
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
54
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
55
|
+
}
|
|
56
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
57
|
+
};
|
|
58
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
59
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
62
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
63
|
+
var IpFilterController_exports = {};
|
|
64
|
+
__export(IpFilterController_exports, {
|
|
65
|
+
IpFilterController: () => IpFilterController
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(IpFilterController_exports);
|
|
68
|
+
var import_utils = require("@tachybase/utils");
|
|
69
|
+
var import_IPFilterService = require("../services/IPFilterService");
|
|
70
|
+
var _setConfig_dec, _getConfig_dec, _ipFilterService_dec, _IpFilterController_decorators, _init;
|
|
71
|
+
_IpFilterController_decorators = [(0, import_utils.Controller)("ipFilter")], _ipFilterService_dec = [(0, import_utils.Inject)(() => import_IPFilterService.IPFilterService)], _getConfig_dec = [(0, import_utils.Action)("get")], _setConfig_dec = [(0, import_utils.Action)("put")];
|
|
72
|
+
class IpFilterController {
|
|
73
|
+
constructor() {
|
|
74
|
+
__runInitializers(_init, 5, this);
|
|
75
|
+
this.ipFilterService = __runInitializers(_init, 8, this), __runInitializers(_init, 11, this);
|
|
76
|
+
}
|
|
77
|
+
async getConfig(ctx, next) {
|
|
78
|
+
const repo = ctx.db.getRepository("ipFilter");
|
|
79
|
+
const data = await repo.findOne();
|
|
80
|
+
ctx.body = data;
|
|
81
|
+
return next();
|
|
82
|
+
}
|
|
83
|
+
async setConfig(ctx, next) {
|
|
84
|
+
const { values } = ctx.action.params;
|
|
85
|
+
let transaction;
|
|
86
|
+
try {
|
|
87
|
+
transaction = await ctx.db.sequelize.transaction();
|
|
88
|
+
const repo = ctx.db.getRepository("ipFilter");
|
|
89
|
+
const existOne = await repo.findOne({
|
|
90
|
+
transaction
|
|
91
|
+
});
|
|
92
|
+
let data;
|
|
93
|
+
if (!existOne) {
|
|
94
|
+
data = await repo.create({
|
|
95
|
+
values,
|
|
96
|
+
transaction
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
data = await repo.update({
|
|
100
|
+
filterByTk: values == null ? void 0 : values.id,
|
|
101
|
+
values,
|
|
102
|
+
transaction
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
await transaction.commit();
|
|
106
|
+
ctx.body = data;
|
|
107
|
+
} catch (err) {
|
|
108
|
+
ctx.app.logger.error("put ip filter config error", err);
|
|
109
|
+
if (transaction) await transaction.rollback();
|
|
110
|
+
throw err;
|
|
111
|
+
}
|
|
112
|
+
return next();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
_init = __decoratorStart(null);
|
|
116
|
+
__decorateElement(_init, 1, "getConfig", _getConfig_dec, IpFilterController);
|
|
117
|
+
__decorateElement(_init, 1, "setConfig", _setConfig_dec, IpFilterController);
|
|
118
|
+
__decorateElement(_init, 5, "ipFilterService", _ipFilterService_dec, IpFilterController);
|
|
119
|
+
IpFilterController = __decorateElement(_init, 0, "IpFilterController", _IpFilterController_decorators, IpFilterController);
|
|
120
|
+
__runInitializers(_init, 1, IpFilterController);
|
|
121
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
122
|
+
0 && (module.exports = {
|
|
123
|
+
IpFilterController
|
|
124
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context, Next } from '@tachybase/actions';
|
|
2
|
+
import { PasswordAttemptService } from '../services/PasswordAttemptService';
|
|
3
|
+
export declare class PasswordAttemptController {
|
|
4
|
+
passwordAttemptService: PasswordAttemptService;
|
|
5
|
+
getConfig(ctx: Context, next: Next): Promise<any>;
|
|
6
|
+
setConfiguration(ctx: Context, next: Next): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
26
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
27
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
28
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
29
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
30
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
31
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
35
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
36
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
37
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
38
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
39
|
+
return __privateGet(this, extra);
|
|
40
|
+
}, set [name](x) {
|
|
41
|
+
return __privateSet(this, extra, x);
|
|
42
|
+
} }, name));
|
|
43
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
44
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
45
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
46
|
+
if (k) {
|
|
47
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
48
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
49
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
50
|
+
}
|
|
51
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
52
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
53
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
54
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
55
|
+
}
|
|
56
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
57
|
+
};
|
|
58
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
59
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
62
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
63
|
+
var PasswordAttemptController_exports = {};
|
|
64
|
+
__export(PasswordAttemptController_exports, {
|
|
65
|
+
PasswordAttemptController: () => PasswordAttemptController
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(PasswordAttemptController_exports);
|
|
68
|
+
var import_utils = require("@tachybase/utils");
|
|
69
|
+
var import_PasswordAttemptService = require("../services/PasswordAttemptService");
|
|
70
|
+
var _setConfiguration_dec, _getConfig_dec, _passwordAttemptService_dec, _PasswordAttemptController_decorators, _init;
|
|
71
|
+
_PasswordAttemptController_decorators = [(0, import_utils.Controller)("passwordAttempt")], _passwordAttemptService_dec = [(0, import_utils.Inject)(() => import_PasswordAttemptService.PasswordAttemptService)], _getConfig_dec = [(0, import_utils.Action)("get")], _setConfiguration_dec = [(0, import_utils.Action)("put")];
|
|
72
|
+
class PasswordAttemptController {
|
|
73
|
+
constructor() {
|
|
74
|
+
__runInitializers(_init, 5, this);
|
|
75
|
+
this.passwordAttemptService = __runInitializers(_init, 8, this), __runInitializers(_init, 11, this);
|
|
76
|
+
}
|
|
77
|
+
async getConfig(ctx, next) {
|
|
78
|
+
const repo = ctx.db.getRepository("passwordAttempt");
|
|
79
|
+
const data = await repo.findOne();
|
|
80
|
+
ctx.body = data;
|
|
81
|
+
return next();
|
|
82
|
+
}
|
|
83
|
+
async setConfiguration(ctx, next) {
|
|
84
|
+
const params = ctx.action.params;
|
|
85
|
+
let transaction;
|
|
86
|
+
try {
|
|
87
|
+
const transaction2 = await ctx.db.sequelize.transaction();
|
|
88
|
+
const repo = ctx.db.getRepository("passwordAttempt");
|
|
89
|
+
const existOne = await repo.findOne({
|
|
90
|
+
transaction: transaction2
|
|
91
|
+
});
|
|
92
|
+
let data;
|
|
93
|
+
if (!existOne) {
|
|
94
|
+
data = await repo.create({
|
|
95
|
+
values: params.values,
|
|
96
|
+
transaction: transaction2
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
data = await repo.update({
|
|
100
|
+
filterByTk: params.values.id,
|
|
101
|
+
values: params.values,
|
|
102
|
+
transaction: transaction2
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
await transaction2.commit();
|
|
106
|
+
ctx.body = data;
|
|
107
|
+
} catch (err) {
|
|
108
|
+
ctx.app.logger.error("put password policy config error", err);
|
|
109
|
+
transaction == null ? void 0 : transaction.rollback();
|
|
110
|
+
}
|
|
111
|
+
return next();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
_init = __decoratorStart(null);
|
|
115
|
+
__decorateElement(_init, 1, "getConfig", _getConfig_dec, PasswordAttemptController);
|
|
116
|
+
__decorateElement(_init, 1, "setConfiguration", _setConfiguration_dec, PasswordAttemptController);
|
|
117
|
+
__decorateElement(_init, 5, "passwordAttemptService", _passwordAttemptService_dec, PasswordAttemptController);
|
|
118
|
+
PasswordAttemptController = __decorateElement(_init, 0, "PasswordAttemptController", _PasswordAttemptController_decorators, PasswordAttemptController);
|
|
119
|
+
__runInitializers(_init, 1, PasswordAttemptController);
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
PasswordAttemptController
|
|
123
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Context, Next } from '@tachybase/actions';
|
|
2
|
+
import { PasswordStrengthService } from '../services/PasswordStrengthService';
|
|
3
|
+
export declare class PasswordStrengthController {
|
|
4
|
+
passwordStrengthService: PasswordStrengthService;
|
|
5
|
+
getConfig(ctx: Context, next: Next): Promise<any>;
|
|
6
|
+
setConfiguration(ctx: Context, next: Next): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
7
|
+
var __typeError = (msg) => {
|
|
8
|
+
throw TypeError(msg);
|
|
9
|
+
};
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
var __export = (target, all) => {
|
|
13
|
+
for (var name in all)
|
|
14
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var __decoratorStart = (base) => [, , , __create((base == null ? void 0 : base[__knownSymbol("metadata")]) ?? null)];
|
|
26
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
27
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
28
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
29
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
30
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
31
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
32
|
+
return value;
|
|
33
|
+
};
|
|
34
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
35
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
36
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
37
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
38
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
39
|
+
return __privateGet(this, extra);
|
|
40
|
+
}, set [name](x) {
|
|
41
|
+
return __privateSet(this, extra, x);
|
|
42
|
+
} }, name));
|
|
43
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
44
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
45
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
46
|
+
if (k) {
|
|
47
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
48
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
49
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
50
|
+
}
|
|
51
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
52
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
53
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
54
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
55
|
+
}
|
|
56
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
57
|
+
};
|
|
58
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
59
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
60
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
61
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
62
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
63
|
+
var PasswordStrengthController_exports = {};
|
|
64
|
+
__export(PasswordStrengthController_exports, {
|
|
65
|
+
PasswordStrengthController: () => PasswordStrengthController
|
|
66
|
+
});
|
|
67
|
+
module.exports = __toCommonJS(PasswordStrengthController_exports);
|
|
68
|
+
var import_utils = require("@tachybase/utils");
|
|
69
|
+
var import_PasswordStrengthService = require("../services/PasswordStrengthService");
|
|
70
|
+
var _setConfiguration_dec, _getConfig_dec, _passwordStrengthService_dec, _PasswordStrengthController_decorators, _init;
|
|
71
|
+
_PasswordStrengthController_decorators = [(0, import_utils.Controller)("passwordStrengthConfig")], _passwordStrengthService_dec = [(0, import_utils.Inject)(() => import_PasswordStrengthService.PasswordStrengthService)], _getConfig_dec = [(0, import_utils.Action)("get")], _setConfiguration_dec = [(0, import_utils.Action)("put")];
|
|
72
|
+
class PasswordStrengthController {
|
|
73
|
+
constructor() {
|
|
74
|
+
__runInitializers(_init, 5, this);
|
|
75
|
+
this.passwordStrengthService = __runInitializers(_init, 8, this), __runInitializers(_init, 11, this);
|
|
76
|
+
}
|
|
77
|
+
async getConfig(ctx, next) {
|
|
78
|
+
const repo = ctx.db.getRepository("passwordStrengthConfig");
|
|
79
|
+
const data = await repo.findOne();
|
|
80
|
+
ctx.body = data;
|
|
81
|
+
return next();
|
|
82
|
+
}
|
|
83
|
+
async setConfiguration(ctx, next) {
|
|
84
|
+
const params = ctx.action.params;
|
|
85
|
+
let transaction;
|
|
86
|
+
try {
|
|
87
|
+
const transaction2 = await ctx.db.sequelize.transaction();
|
|
88
|
+
const repo = ctx.db.getRepository("passwordStrengthConfig");
|
|
89
|
+
const existOne = await repo.findOne({
|
|
90
|
+
transaction: transaction2
|
|
91
|
+
});
|
|
92
|
+
let data;
|
|
93
|
+
if (!existOne) {
|
|
94
|
+
data = await repo.create({
|
|
95
|
+
values: params.values,
|
|
96
|
+
transaction: transaction2
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
data = await repo.update({
|
|
100
|
+
filterByTk: existOne.id,
|
|
101
|
+
values: params.values,
|
|
102
|
+
transaction: transaction2
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
await transaction2.commit();
|
|
106
|
+
ctx.body = data;
|
|
107
|
+
} catch (err) {
|
|
108
|
+
ctx.app.logger.error("put password strength config error", err);
|
|
109
|
+
transaction == null ? void 0 : transaction.rollback();
|
|
110
|
+
}
|
|
111
|
+
return next();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
_init = __decoratorStart(null);
|
|
115
|
+
__decorateElement(_init, 1, "getConfig", _getConfig_dec, PasswordStrengthController);
|
|
116
|
+
__decorateElement(_init, 1, "setConfiguration", _setConfiguration_dec, PasswordStrengthController);
|
|
117
|
+
__decorateElement(_init, 5, "passwordStrengthService", _passwordStrengthService_dec, PasswordStrengthController);
|
|
118
|
+
PasswordStrengthController = __decorateElement(_init, 0, "PasswordStrengthController", _PasswordStrengthController_decorators, PasswordStrengthController);
|
|
119
|
+
__runInitializers(_init, 1, PasswordStrengthController);
|
|
120
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
121
|
+
0 && (module.exports = {
|
|
122
|
+
PasswordStrengthController
|
|
123
|
+
});
|