@vsaas/loopback 12.1.0 → 12.2.0
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 +6 -0
- package/common/models/rate-limit-state.json +121 -0
- package/common/models/two-factor-challenge.json +112 -0
- package/common/models/two-factor-credential.json +117 -0
- package/common/models/two-factor-recovery-code.json +63 -0
- package/common/models/user.json +30 -0
- package/dist/_virtual/_rolldown/runtime.cjs +9 -2
- package/dist/common/models/access-token.d.cts +3 -0
- package/dist/common/models/acl.cjs +1 -3
- package/dist/common/models/acl.d.cts +1 -0
- package/dist/common/models/application.d.cts +3 -0
- package/dist/common/models/change.cjs +21 -18
- package/dist/common/models/change.d.cts +1 -0
- package/dist/common/models/checkpoint.d.cts +3 -0
- package/dist/common/models/email.d.cts +3 -0
- package/dist/common/models/key-value-model.d.cts +3 -0
- package/dist/common/models/rate-limit-state.cjs +7 -0
- package/dist/common/models/rate-limit-state.d.cts +3 -0
- package/dist/common/models/rate-limit-state2.cjs +109 -0
- package/dist/common/models/role-mapping.d.cts +3 -0
- package/dist/common/models/role.cjs +12 -8
- package/dist/common/models/role.d.cts +1 -0
- package/dist/common/models/scope.d.cts +3 -0
- package/dist/common/models/two-factor-challenge.cjs +7 -0
- package/dist/common/models/two-factor-challenge.d.cts +3 -0
- package/dist/common/models/two-factor-challenge2.cjs +108 -0
- package/dist/common/models/two-factor-credential.cjs +7 -0
- package/dist/common/models/two-factor-credential.d.cts +3 -0
- package/dist/common/models/two-factor-credential2.cjs +103 -0
- package/dist/common/models/two-factor-recovery-code.cjs +7 -0
- package/dist/common/models/two-factor-recovery-code.d.cts +3 -0
- package/dist/common/models/two-factor-recovery-code2.cjs +57 -0
- package/dist/common/models/user.cjs +258 -21
- package/dist/common/models/user.d.cts +3 -0
- package/dist/common/models/user2.cjs +30 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +3 -0
- package/dist/lib/access-context.d.cts +33 -0
- package/dist/lib/application.d.cts +1 -0
- package/dist/lib/authentication-security-initializer.cjs +351 -0
- package/dist/lib/authentication-security-initializer.d.cts +4 -0
- package/dist/lib/builtin-models.cjs +12 -0
- package/dist/lib/builtin-models.d.cts +3 -0
- package/dist/lib/configure-shared-methods.cjs +7 -4
- package/dist/lib/configure-shared-methods.d.cts +3 -0
- package/dist/lib/connectors/base-connector.d.cts +6 -0
- package/dist/lib/connectors/mail-direct-transport.cjs +26 -23
- package/dist/lib/connectors/mail-direct-transport.d.cts +22 -0
- package/dist/lib/connectors/mail-stub-transport.d.cts +14 -0
- package/dist/lib/connectors/mail.d.cts +7 -0
- package/dist/lib/connectors/memory.d.cts +6 -0
- package/dist/lib/current-context.d.cts +3 -0
- package/dist/lib/globalize.d.cts +10 -0
- package/dist/lib/loopback.cjs +6 -0
- package/dist/lib/loopback.d.cts +1 -0
- package/dist/lib/model.d.cts +1 -0
- package/dist/lib/persisted-model.cjs +7 -12
- package/dist/lib/persisted-model.d.cts +1 -0
- package/dist/lib/rate-limit/algorithms/common.cjs +37 -0
- package/dist/lib/rate-limit/algorithms/failure-lockout.cjs +70 -0
- package/dist/lib/rate-limit/algorithms/fixed-window.cjs +61 -0
- package/dist/lib/rate-limit/algorithms/index.cjs +55 -0
- package/dist/lib/rate-limit/config.cjs +107 -0
- package/dist/lib/rate-limit/errors.cjs +58 -0
- package/dist/lib/rate-limit/index.cjs +15 -0
- package/dist/lib/rate-limit/index.d.cts +1 -0
- package/dist/lib/rate-limit/initializer.cjs +92 -0
- package/dist/lib/rate-limit/initializer.d.cts +4 -0
- package/dist/lib/rate-limit/limiter.cjs +368 -0
- package/dist/lib/rate-limit/registry.cjs +92 -0
- package/dist/lib/rate-limit/remote.cjs +180 -0
- package/dist/lib/rate-limit/remote.d.cts +6 -0
- package/dist/lib/rate-limit/stores/persisted-model.cjs +353 -0
- package/dist/lib/rate-limit/subject.cjs +127 -0
- package/dist/lib/rate-limit/types.cjs +1 -0
- package/dist/lib/rate-limit/types.d.cts +167 -0
- package/dist/lib/registry.d.cts +1 -0
- package/dist/lib/runtime.d.cts +10 -0
- package/dist/lib/server-app.d.cts +3 -0
- package/dist/lib/two-factor/config.cjs +199 -0
- package/dist/lib/two-factor/config.d.cts +55 -0
- package/dist/lib/two-factor/crypto.cjs +68 -0
- package/dist/lib/two-factor/crypto.d.cts +16 -0
- package/dist/lib/two-factor/errors.cjs +58 -0
- package/dist/lib/two-factor/errors.d.cts +18 -0
- package/dist/lib/two-factor/rate-limit.cjs +153 -0
- package/dist/lib/two-factor/rate-limit.d.cts +22 -0
- package/dist/lib/two-factor/recovery-codes.cjs +49 -0
- package/dist/lib/two-factor/recovery-codes.d.cts +16 -0
- package/dist/lib/two-factor/service.cjs +1108 -0
- package/dist/lib/two-factor/service.d.cts +78 -0
- package/dist/lib/two-factor/totp.cjs +50 -0
- package/dist/lib/two-factor/totp.d.cts +14 -0
- package/dist/lib/utils.d.cts +36 -0
- package/dist/package.cjs +46 -10
- package/dist/server/middleware/context.d.cts +3 -0
- package/dist/server/middleware/error-handler.d.cts +3 -0
- package/dist/server/middleware/favicon.d.cts +7 -0
- package/dist/server/middleware/rest.d.cts +6 -0
- package/dist/server/middleware/static.d.cts +3 -0
- package/dist/server/middleware/status.d.cts +19 -0
- package/dist/server/middleware/token.d.cts +3 -0
- package/dist/server/middleware/url-not-found.d.cts +13 -0
- package/docs/api-explorer-details.md +110 -0
- package/docs/application-guide.md +1110 -0
- package/docs/assets/explorer-api.png +0 -0
- package/docs/assets/explorer-endpoint.png +0 -0
- package/docs/assets/explorer-listing.png +0 -0
- package/docs/assets/explorer-req-res.png +0 -0
- package/docs/assets/lb-modules.png +0 -0
- package/docs/assets/loopback-architecture.png +0 -0
- package/docs/assets/loopback-concepts.png +0 -0
- package/docs/assets/loopback_ov.png +0 -0
- package/docs/rate-limiting.md +879 -0
- package/docs/two-factor-authentication.md +611 -0
- package/docs/two-factor-authenticator-loss-runbook.md +117 -0
- package/package.json +55 -19
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
//#region common/models/rate-limit-state.json
|
|
2
|
+
var require_rate_limit_state = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
3
|
+
module.exports = {
|
|
4
|
+
"name": "RateLimitState",
|
|
5
|
+
"base": "PersistedModel",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"id": true
|
|
11
|
+
},
|
|
12
|
+
"namespace": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"required": true
|
|
15
|
+
},
|
|
16
|
+
"scope": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"required": true
|
|
19
|
+
},
|
|
20
|
+
"subjectType": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"required": true
|
|
23
|
+
},
|
|
24
|
+
"bucket": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": true
|
|
27
|
+
},
|
|
28
|
+
"subjectKeyId": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"required": true
|
|
31
|
+
},
|
|
32
|
+
"formatVersion": {
|
|
33
|
+
"type": "number",
|
|
34
|
+
"required": true,
|
|
35
|
+
"default": 1
|
|
36
|
+
},
|
|
37
|
+
"policyFingerprint": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"required": true
|
|
40
|
+
},
|
|
41
|
+
"failureCount": {
|
|
42
|
+
"type": "number",
|
|
43
|
+
"required": true,
|
|
44
|
+
"default": 0
|
|
45
|
+
},
|
|
46
|
+
"attemptCount": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"required": true,
|
|
49
|
+
"default": 0
|
|
50
|
+
},
|
|
51
|
+
"lockoutLevel": {
|
|
52
|
+
"type": "number",
|
|
53
|
+
"required": true,
|
|
54
|
+
"default": 0
|
|
55
|
+
},
|
|
56
|
+
"windowStartedAt": { "type": "date" },
|
|
57
|
+
"lastAttemptAt": { "type": "date" },
|
|
58
|
+
"lastFailureAt": { "type": "date" },
|
|
59
|
+
"blockedUntil": { "type": "date" },
|
|
60
|
+
"revision": {
|
|
61
|
+
"type": "number",
|
|
62
|
+
"required": true,
|
|
63
|
+
"default": 0
|
|
64
|
+
},
|
|
65
|
+
"lastOperationId": { "type": "string" },
|
|
66
|
+
"lastOperationResultJson": { "type": "string" },
|
|
67
|
+
"createdAt": {
|
|
68
|
+
"type": "date",
|
|
69
|
+
"defaultFn": "now"
|
|
70
|
+
},
|
|
71
|
+
"updatedAt": {
|
|
72
|
+
"type": "date",
|
|
73
|
+
"defaultFn": "now"
|
|
74
|
+
},
|
|
75
|
+
"expiresAt": {
|
|
76
|
+
"type": "date",
|
|
77
|
+
"required": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"indexes": {
|
|
81
|
+
"rate_limit_expiry": { "keys": { "expiresAt": 1 } },
|
|
82
|
+
"rate_limit_bucket": { "keys": {
|
|
83
|
+
"namespace": 1,
|
|
84
|
+
"scope": 1,
|
|
85
|
+
"subjectType": 1,
|
|
86
|
+
"bucket": 1,
|
|
87
|
+
"blockedUntil": 1
|
|
88
|
+
} },
|
|
89
|
+
"rate_limit_policy": { "keys": {
|
|
90
|
+
"namespace": 1,
|
|
91
|
+
"scope": 1,
|
|
92
|
+
"bucket": 1,
|
|
93
|
+
"policyFingerprint": 1
|
|
94
|
+
} }
|
|
95
|
+
},
|
|
96
|
+
"acls": [{
|
|
97
|
+
"principalType": "ROLE",
|
|
98
|
+
"principalId": "$everyone",
|
|
99
|
+
"permission": "DENY"
|
|
100
|
+
}]
|
|
101
|
+
};
|
|
102
|
+
}));
|
|
103
|
+
//#endregion
|
|
104
|
+
Object.defineProperty(exports, "default", {
|
|
105
|
+
enumerable: true,
|
|
106
|
+
get: function() {
|
|
107
|
+
return require_rate_limit_state();
|
|
108
|
+
}
|
|
109
|
+
});
|
|
@@ -28,10 +28,12 @@ var require_role = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, modu
|
|
|
28
28
|
"roles"
|
|
29
29
|
].forEach(function(rel) {
|
|
30
30
|
Role.prototype[rel] = function(query, callback) {
|
|
31
|
-
if (!callback)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (!callback) {
|
|
32
|
+
if (typeof query === "function") {
|
|
33
|
+
callback = query;
|
|
34
|
+
query = {};
|
|
35
|
+
} else callback = utils.createPromiseCallback();
|
|
36
|
+
}
|
|
35
37
|
query = query || {};
|
|
36
38
|
query.where = query.where || {};
|
|
37
39
|
roleModel.resolveRelatedModels();
|
|
@@ -330,10 +332,12 @@ var require_role = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, modu
|
|
|
330
332
|
return callback.promise;
|
|
331
333
|
};
|
|
332
334
|
Role.getRoles = function(context, options, callback) {
|
|
333
|
-
if (!callback)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
335
|
+
if (!callback) {
|
|
336
|
+
if (typeof options === "function") {
|
|
337
|
+
callback = options;
|
|
338
|
+
options = {};
|
|
339
|
+
} else callback = utils.createPromiseCallback();
|
|
340
|
+
}
|
|
337
341
|
if (!options) options = {};
|
|
338
342
|
context.registry = this.registry;
|
|
339
343
|
if (!(context instanceof AccessContext)) context = new AccessContext(context);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region src/common/models/two-factor-challenge.ts
|
|
3
|
+
var require_two_factor_challenge = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = function configureTwoFactorChallenge(_TwoFactorChallenge) {};
|
|
5
|
+
}));
|
|
6
|
+
//#endregion
|
|
7
|
+
module.exports = require_two_factor_challenge();
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//#region common/models/two-factor-challenge.json
|
|
2
|
+
var require_two_factor_challenge = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
3
|
+
module.exports = {
|
|
4
|
+
"name": "TwoFactorChallenge",
|
|
5
|
+
"base": "PersistedModel",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"id": true
|
|
11
|
+
},
|
|
12
|
+
"principalType": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"required": true
|
|
15
|
+
},
|
|
16
|
+
"principalId": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"required": true
|
|
19
|
+
},
|
|
20
|
+
"credentialId": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"required": true
|
|
23
|
+
},
|
|
24
|
+
"credentialVersion": {
|
|
25
|
+
"type": "number",
|
|
26
|
+
"required": true
|
|
27
|
+
},
|
|
28
|
+
"flowType": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"required": true,
|
|
31
|
+
"default": "external"
|
|
32
|
+
},
|
|
33
|
+
"principalBindingKeyId": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"required": true
|
|
36
|
+
},
|
|
37
|
+
"principalBindingDigest": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"required": true
|
|
40
|
+
},
|
|
41
|
+
"status": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"required": true,
|
|
44
|
+
"default": "pending"
|
|
45
|
+
},
|
|
46
|
+
"attempts": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"required": true,
|
|
49
|
+
"default": 0
|
|
50
|
+
},
|
|
51
|
+
"maxAttempts": {
|
|
52
|
+
"type": "number",
|
|
53
|
+
"required": true
|
|
54
|
+
},
|
|
55
|
+
"verificationLeaseId": { "type": "string" },
|
|
56
|
+
"verificationLeaseExpiresAt": { "type": "date" },
|
|
57
|
+
"encryptedLoginContext": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"required": true
|
|
60
|
+
},
|
|
61
|
+
"loginContextKeyId": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"required": true
|
|
64
|
+
},
|
|
65
|
+
"includeUser": {
|
|
66
|
+
"type": "boolean",
|
|
67
|
+
"required": true,
|
|
68
|
+
"default": false
|
|
69
|
+
},
|
|
70
|
+
"createdAt": {
|
|
71
|
+
"type": "date",
|
|
72
|
+
"defaultFn": "now"
|
|
73
|
+
},
|
|
74
|
+
"expiresAt": {
|
|
75
|
+
"type": "date",
|
|
76
|
+
"required": true
|
|
77
|
+
},
|
|
78
|
+
"claimedAt": { "type": "date" },
|
|
79
|
+
"consumedAt": { "type": "date" },
|
|
80
|
+
"issuedTokenId": { "type": "string" }
|
|
81
|
+
},
|
|
82
|
+
"hidden": [
|
|
83
|
+
"encryptedLoginContext",
|
|
84
|
+
"principalBindingDigest",
|
|
85
|
+
"issuedTokenId"
|
|
86
|
+
],
|
|
87
|
+
"indexes": {
|
|
88
|
+
"two_factor_challenge_expiry": { "keys": { "expiresAt": 1 } },
|
|
89
|
+
"two_factor_challenge_principal_status": { "keys": {
|
|
90
|
+
"principalType": 1,
|
|
91
|
+
"principalId": 1,
|
|
92
|
+
"status": 1
|
|
93
|
+
} }
|
|
94
|
+
},
|
|
95
|
+
"acls": [{
|
|
96
|
+
"principalType": "ROLE",
|
|
97
|
+
"principalId": "$everyone",
|
|
98
|
+
"permission": "DENY"
|
|
99
|
+
}]
|
|
100
|
+
};
|
|
101
|
+
}));
|
|
102
|
+
//#endregion
|
|
103
|
+
Object.defineProperty(exports, "default", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function() {
|
|
106
|
+
return require_two_factor_challenge();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region src/common/models/two-factor-credential.ts
|
|
3
|
+
var require_two_factor_credential = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = function configureTwoFactorCredential(_TwoFactorCredential) {};
|
|
5
|
+
}));
|
|
6
|
+
//#endregion
|
|
7
|
+
module.exports = require_two_factor_credential();
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
//#region common/models/two-factor-credential.json
|
|
2
|
+
var require_two_factor_credential = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
3
|
+
module.exports = {
|
|
4
|
+
"name": "TwoFactorCredential",
|
|
5
|
+
"base": "PersistedModel",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"id": true,
|
|
11
|
+
"defaultFn": "guid"
|
|
12
|
+
},
|
|
13
|
+
"principalType": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"required": true
|
|
16
|
+
},
|
|
17
|
+
"principalId": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"required": true
|
|
20
|
+
},
|
|
21
|
+
"provider": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"required": true,
|
|
24
|
+
"default": "totp"
|
|
25
|
+
},
|
|
26
|
+
"totpAlgorithm": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"required": true,
|
|
29
|
+
"default": "SHA1"
|
|
30
|
+
},
|
|
31
|
+
"totpDigits": {
|
|
32
|
+
"type": "number",
|
|
33
|
+
"required": true,
|
|
34
|
+
"default": 6
|
|
35
|
+
},
|
|
36
|
+
"totpPeriod": {
|
|
37
|
+
"type": "number",
|
|
38
|
+
"required": true,
|
|
39
|
+
"default": 30
|
|
40
|
+
},
|
|
41
|
+
"status": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"required": true,
|
|
44
|
+
"default": "pending"
|
|
45
|
+
},
|
|
46
|
+
"version": {
|
|
47
|
+
"type": "number",
|
|
48
|
+
"required": true,
|
|
49
|
+
"default": 1
|
|
50
|
+
},
|
|
51
|
+
"encryptedSecret": { "type": "string" },
|
|
52
|
+
"secretKeyId": { "type": "string" },
|
|
53
|
+
"enrollmentTokenDigest": { "type": "string" },
|
|
54
|
+
"activeRecoveryCodeSetId": { "type": "string" },
|
|
55
|
+
"activeRecoveryCodeFormatVersion": { "type": "number" },
|
|
56
|
+
"activeRecoveryCodeLength": { "type": "number" },
|
|
57
|
+
"lastUsedCounter": {
|
|
58
|
+
"type": "number",
|
|
59
|
+
"required": true,
|
|
60
|
+
"default": -1
|
|
61
|
+
},
|
|
62
|
+
"pendingExpiresAt": { "type": "date" },
|
|
63
|
+
"confirmedAt": { "type": "date" },
|
|
64
|
+
"disabledAt": { "type": "date" },
|
|
65
|
+
"createdAt": {
|
|
66
|
+
"type": "date",
|
|
67
|
+
"defaultFn": "now"
|
|
68
|
+
},
|
|
69
|
+
"updatedAt": {
|
|
70
|
+
"type": "date",
|
|
71
|
+
"defaultFn": "now"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"hidden": ["encryptedSecret", "enrollmentTokenDigest"],
|
|
75
|
+
"indexes": {
|
|
76
|
+
"two_factor_principal_provider_unique": {
|
|
77
|
+
"keys": {
|
|
78
|
+
"principalType": 1,
|
|
79
|
+
"principalId": 1,
|
|
80
|
+
"provider": 1
|
|
81
|
+
},
|
|
82
|
+
"options": { "unique": true }
|
|
83
|
+
},
|
|
84
|
+
"two_factor_principal_status": { "keys": {
|
|
85
|
+
"principalType": 1,
|
|
86
|
+
"principalId": 1,
|
|
87
|
+
"status": 1
|
|
88
|
+
} }
|
|
89
|
+
},
|
|
90
|
+
"acls": [{
|
|
91
|
+
"principalType": "ROLE",
|
|
92
|
+
"principalId": "$everyone",
|
|
93
|
+
"permission": "DENY"
|
|
94
|
+
}]
|
|
95
|
+
};
|
|
96
|
+
}));
|
|
97
|
+
//#endregion
|
|
98
|
+
Object.defineProperty(exports, "default", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function() {
|
|
101
|
+
return require_two_factor_credential();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region src/common/models/two-factor-recovery-code.ts
|
|
3
|
+
var require_two_factor_recovery_code = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = function configureTwoFactorRecoveryCode(_TwoFactorRecoveryCode) {};
|
|
5
|
+
}));
|
|
6
|
+
//#endregion
|
|
7
|
+
module.exports = require_two_factor_recovery_code();
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//#region common/models/two-factor-recovery-code.json
|
|
2
|
+
var require_two_factor_recovery_code = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
3
|
+
module.exports = {
|
|
4
|
+
"name": "TwoFactorRecoveryCode",
|
|
5
|
+
"base": "PersistedModel",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"id": true
|
|
11
|
+
},
|
|
12
|
+
"credentialId": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"required": true
|
|
15
|
+
},
|
|
16
|
+
"setId": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"required": true
|
|
19
|
+
},
|
|
20
|
+
"keyId": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"required": true
|
|
23
|
+
},
|
|
24
|
+
"status": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": true,
|
|
27
|
+
"default": "unused"
|
|
28
|
+
},
|
|
29
|
+
"reservationId": { "type": "string" },
|
|
30
|
+
"reservationExpiresAt": { "type": "date" },
|
|
31
|
+
"reservationOwnerType": { "type": "string" },
|
|
32
|
+
"reservationOwnerId": { "type": "string" },
|
|
33
|
+
"createdAt": {
|
|
34
|
+
"type": "date",
|
|
35
|
+
"defaultFn": "now"
|
|
36
|
+
},
|
|
37
|
+
"usedAt": { "type": "date" }
|
|
38
|
+
},
|
|
39
|
+
"indexes": { "two_factor_recovery_credential": { "keys": {
|
|
40
|
+
"credentialId": 1,
|
|
41
|
+
"setId": 1,
|
|
42
|
+
"status": 1
|
|
43
|
+
} } },
|
|
44
|
+
"acls": [{
|
|
45
|
+
"principalType": "ROLE",
|
|
46
|
+
"principalId": "$everyone",
|
|
47
|
+
"permission": "DENY"
|
|
48
|
+
}]
|
|
49
|
+
};
|
|
50
|
+
}));
|
|
51
|
+
//#endregion
|
|
52
|
+
Object.defineProperty(exports, "default", {
|
|
53
|
+
enumerable: true,
|
|
54
|
+
get: function() {
|
|
55
|
+
return require_two_factor_recovery_code();
|
|
56
|
+
}
|
|
57
|
+
});
|