@vsaas/loopback 12.1.1 → 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 +56 -20
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@ The goal of this fork is practical compatibility for the common upstream use cas
|
|
|
11
11
|
- public legacy subpaths preserved through `exports` even though the old root `.js` wrappers were removed
|
|
12
12
|
- modern tooling with `tsdown`, `vitest`, and `oxlint`
|
|
13
13
|
- callback-compatible APIs that continue to work with `Promise` and `async/await`
|
|
14
|
+
- general fixed-window and failure-lockout rate limiting with weighted/batch consumption
|
|
15
|
+
- optional TOTP and one-time recovery-code authentication for `User` models
|
|
14
16
|
|
|
15
17
|
## Installation
|
|
16
18
|
|
|
@@ -23,9 +25,13 @@ If you are also using the related forks, pair it with `@vsaas/loopback-boot`, `@
|
|
|
23
25
|
## Documentation
|
|
24
26
|
|
|
25
27
|
- [Application guide](./docs/application-guide.md)
|
|
28
|
+
- [Rate limiting](./docs/rate-limiting.md)
|
|
29
|
+
- [Two-factor authentication](./docs/two-factor-authentication.md)
|
|
30
|
+
- [Two-factor authenticator loss runbook](./docs/two-factor-authenticator-loss-runbook.md)
|
|
26
31
|
- [@vsaas/loopback-boot](../loopback-boot/README.md)
|
|
27
32
|
- [@vsaas/loopback-datasource-juggler](../loopback-datasource-juggler/README.md)
|
|
28
33
|
- [@vsaas/remoting](../remoting/README.md)
|
|
34
|
+
- [@vsaas/loopback-component-rate-limit-redis](../loopback-component-rate-limit-redis/README.md)
|
|
29
35
|
- [@vsaas/loopback-component-storage](../loopback-component-storage/README.md)
|
|
30
36
|
- [@vsaas/loopback-softdelete-mixin4](../loopback-softdelete-mixin/README.md)
|
|
31
37
|
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "RateLimitState",
|
|
3
|
+
"base": "PersistedModel",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"id": true
|
|
9
|
+
},
|
|
10
|
+
"namespace": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"required": true
|
|
13
|
+
},
|
|
14
|
+
"scope": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
"subjectType": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": true
|
|
21
|
+
},
|
|
22
|
+
"bucket": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"required": true
|
|
25
|
+
},
|
|
26
|
+
"subjectKeyId": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"required": true
|
|
29
|
+
},
|
|
30
|
+
"formatVersion": {
|
|
31
|
+
"type": "number",
|
|
32
|
+
"required": true,
|
|
33
|
+
"default": 1
|
|
34
|
+
},
|
|
35
|
+
"policyFingerprint": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"required": true
|
|
38
|
+
},
|
|
39
|
+
"failureCount": {
|
|
40
|
+
"type": "number",
|
|
41
|
+
"required": true,
|
|
42
|
+
"default": 0
|
|
43
|
+
},
|
|
44
|
+
"attemptCount": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"required": true,
|
|
47
|
+
"default": 0
|
|
48
|
+
},
|
|
49
|
+
"lockoutLevel": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"required": true,
|
|
52
|
+
"default": 0
|
|
53
|
+
},
|
|
54
|
+
"windowStartedAt": {
|
|
55
|
+
"type": "date"
|
|
56
|
+
},
|
|
57
|
+
"lastAttemptAt": {
|
|
58
|
+
"type": "date"
|
|
59
|
+
},
|
|
60
|
+
"lastFailureAt": {
|
|
61
|
+
"type": "date"
|
|
62
|
+
},
|
|
63
|
+
"blockedUntil": {
|
|
64
|
+
"type": "date"
|
|
65
|
+
},
|
|
66
|
+
"revision": {
|
|
67
|
+
"type": "number",
|
|
68
|
+
"required": true,
|
|
69
|
+
"default": 0
|
|
70
|
+
},
|
|
71
|
+
"lastOperationId": {
|
|
72
|
+
"type": "string"
|
|
73
|
+
},
|
|
74
|
+
"lastOperationResultJson": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
"createdAt": {
|
|
78
|
+
"type": "date",
|
|
79
|
+
"defaultFn": "now"
|
|
80
|
+
},
|
|
81
|
+
"updatedAt": {
|
|
82
|
+
"type": "date",
|
|
83
|
+
"defaultFn": "now"
|
|
84
|
+
},
|
|
85
|
+
"expiresAt": {
|
|
86
|
+
"type": "date",
|
|
87
|
+
"required": true
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"indexes": {
|
|
91
|
+
"rate_limit_expiry": {
|
|
92
|
+
"keys": {
|
|
93
|
+
"expiresAt": 1
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"rate_limit_bucket": {
|
|
97
|
+
"keys": {
|
|
98
|
+
"namespace": 1,
|
|
99
|
+
"scope": 1,
|
|
100
|
+
"subjectType": 1,
|
|
101
|
+
"bucket": 1,
|
|
102
|
+
"blockedUntil": 1
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"rate_limit_policy": {
|
|
106
|
+
"keys": {
|
|
107
|
+
"namespace": 1,
|
|
108
|
+
"scope": 1,
|
|
109
|
+
"bucket": 1,
|
|
110
|
+
"policyFingerprint": 1
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"acls": [
|
|
115
|
+
{
|
|
116
|
+
"principalType": "ROLE",
|
|
117
|
+
"principalId": "$everyone",
|
|
118
|
+
"permission": "DENY"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TwoFactorChallenge",
|
|
3
|
+
"base": "PersistedModel",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"id": true
|
|
9
|
+
},
|
|
10
|
+
"principalType": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"required": true
|
|
13
|
+
},
|
|
14
|
+
"principalId": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
"credentialId": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": true
|
|
21
|
+
},
|
|
22
|
+
"credentialVersion": {
|
|
23
|
+
"type": "number",
|
|
24
|
+
"required": true
|
|
25
|
+
},
|
|
26
|
+
"flowType": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"required": true,
|
|
29
|
+
"default": "external"
|
|
30
|
+
},
|
|
31
|
+
"principalBindingKeyId": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"required": true
|
|
34
|
+
},
|
|
35
|
+
"principalBindingDigest": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"required": true
|
|
38
|
+
},
|
|
39
|
+
"status": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"required": true,
|
|
42
|
+
"default": "pending"
|
|
43
|
+
},
|
|
44
|
+
"attempts": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"required": true,
|
|
47
|
+
"default": 0
|
|
48
|
+
},
|
|
49
|
+
"maxAttempts": {
|
|
50
|
+
"type": "number",
|
|
51
|
+
"required": true
|
|
52
|
+
},
|
|
53
|
+
"verificationLeaseId": {
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"verificationLeaseExpiresAt": {
|
|
57
|
+
"type": "date"
|
|
58
|
+
},
|
|
59
|
+
"encryptedLoginContext": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"required": true
|
|
62
|
+
},
|
|
63
|
+
"loginContextKeyId": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"required": true
|
|
66
|
+
},
|
|
67
|
+
"includeUser": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"required": true,
|
|
70
|
+
"default": false
|
|
71
|
+
},
|
|
72
|
+
"createdAt": {
|
|
73
|
+
"type": "date",
|
|
74
|
+
"defaultFn": "now"
|
|
75
|
+
},
|
|
76
|
+
"expiresAt": {
|
|
77
|
+
"type": "date",
|
|
78
|
+
"required": true
|
|
79
|
+
},
|
|
80
|
+
"claimedAt": {
|
|
81
|
+
"type": "date"
|
|
82
|
+
},
|
|
83
|
+
"consumedAt": {
|
|
84
|
+
"type": "date"
|
|
85
|
+
},
|
|
86
|
+
"issuedTokenId": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"hidden": ["encryptedLoginContext", "principalBindingDigest", "issuedTokenId"],
|
|
91
|
+
"indexes": {
|
|
92
|
+
"two_factor_challenge_expiry": {
|
|
93
|
+
"keys": {
|
|
94
|
+
"expiresAt": 1
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"two_factor_challenge_principal_status": {
|
|
98
|
+
"keys": {
|
|
99
|
+
"principalType": 1,
|
|
100
|
+
"principalId": 1,
|
|
101
|
+
"status": 1
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"acls": [
|
|
106
|
+
{
|
|
107
|
+
"principalType": "ROLE",
|
|
108
|
+
"principalId": "$everyone",
|
|
109
|
+
"permission": "DENY"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TwoFactorCredential",
|
|
3
|
+
"base": "PersistedModel",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"id": true,
|
|
9
|
+
"defaultFn": "guid"
|
|
10
|
+
},
|
|
11
|
+
"principalType": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": true
|
|
14
|
+
},
|
|
15
|
+
"principalId": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"required": true
|
|
18
|
+
},
|
|
19
|
+
"provider": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"required": true,
|
|
22
|
+
"default": "totp"
|
|
23
|
+
},
|
|
24
|
+
"totpAlgorithm": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"required": true,
|
|
27
|
+
"default": "SHA1"
|
|
28
|
+
},
|
|
29
|
+
"totpDigits": {
|
|
30
|
+
"type": "number",
|
|
31
|
+
"required": true,
|
|
32
|
+
"default": 6
|
|
33
|
+
},
|
|
34
|
+
"totpPeriod": {
|
|
35
|
+
"type": "number",
|
|
36
|
+
"required": true,
|
|
37
|
+
"default": 30
|
|
38
|
+
},
|
|
39
|
+
"status": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"required": true,
|
|
42
|
+
"default": "pending"
|
|
43
|
+
},
|
|
44
|
+
"version": {
|
|
45
|
+
"type": "number",
|
|
46
|
+
"required": true,
|
|
47
|
+
"default": 1
|
|
48
|
+
},
|
|
49
|
+
"encryptedSecret": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
"secretKeyId": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"enrollmentTokenDigest": {
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
"activeRecoveryCodeSetId": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"activeRecoveryCodeFormatVersion": {
|
|
62
|
+
"type": "number"
|
|
63
|
+
},
|
|
64
|
+
"activeRecoveryCodeLength": {
|
|
65
|
+
"type": "number"
|
|
66
|
+
},
|
|
67
|
+
"lastUsedCounter": {
|
|
68
|
+
"type": "number",
|
|
69
|
+
"required": true,
|
|
70
|
+
"default": -1
|
|
71
|
+
},
|
|
72
|
+
"pendingExpiresAt": {
|
|
73
|
+
"type": "date"
|
|
74
|
+
},
|
|
75
|
+
"confirmedAt": {
|
|
76
|
+
"type": "date"
|
|
77
|
+
},
|
|
78
|
+
"disabledAt": {
|
|
79
|
+
"type": "date"
|
|
80
|
+
},
|
|
81
|
+
"createdAt": {
|
|
82
|
+
"type": "date",
|
|
83
|
+
"defaultFn": "now"
|
|
84
|
+
},
|
|
85
|
+
"updatedAt": {
|
|
86
|
+
"type": "date",
|
|
87
|
+
"defaultFn": "now"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"hidden": ["encryptedSecret", "enrollmentTokenDigest"],
|
|
91
|
+
"indexes": {
|
|
92
|
+
"two_factor_principal_provider_unique": {
|
|
93
|
+
"keys": {
|
|
94
|
+
"principalType": 1,
|
|
95
|
+
"principalId": 1,
|
|
96
|
+
"provider": 1
|
|
97
|
+
},
|
|
98
|
+
"options": {
|
|
99
|
+
"unique": true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"two_factor_principal_status": {
|
|
103
|
+
"keys": {
|
|
104
|
+
"principalType": 1,
|
|
105
|
+
"principalId": 1,
|
|
106
|
+
"status": 1
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"acls": [
|
|
111
|
+
{
|
|
112
|
+
"principalType": "ROLE",
|
|
113
|
+
"principalId": "$everyone",
|
|
114
|
+
"permission": "DENY"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "TwoFactorRecoveryCode",
|
|
3
|
+
"base": "PersistedModel",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"properties": {
|
|
6
|
+
"id": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"id": true
|
|
9
|
+
},
|
|
10
|
+
"credentialId": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"required": true
|
|
13
|
+
},
|
|
14
|
+
"setId": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"required": true
|
|
17
|
+
},
|
|
18
|
+
"keyId": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"required": true
|
|
21
|
+
},
|
|
22
|
+
"status": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"required": true,
|
|
25
|
+
"default": "unused"
|
|
26
|
+
},
|
|
27
|
+
"reservationId": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"reservationExpiresAt": {
|
|
31
|
+
"type": "date"
|
|
32
|
+
},
|
|
33
|
+
"reservationOwnerType": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"reservationOwnerId": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"createdAt": {
|
|
40
|
+
"type": "date",
|
|
41
|
+
"defaultFn": "now"
|
|
42
|
+
},
|
|
43
|
+
"usedAt": {
|
|
44
|
+
"type": "date"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"indexes": {
|
|
48
|
+
"two_factor_recovery_credential": {
|
|
49
|
+
"keys": {
|
|
50
|
+
"credentialId": 1,
|
|
51
|
+
"setId": 1,
|
|
52
|
+
"status": 1
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"acls": [
|
|
57
|
+
{
|
|
58
|
+
"principalType": "ROLE",
|
|
59
|
+
"principalId": "$everyone",
|
|
60
|
+
"permission": "DENY"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
package/common/models/user.json
CHANGED
|
@@ -46,6 +46,36 @@
|
|
|
46
46
|
"permission": "ALLOW",
|
|
47
47
|
"property": "login"
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
"principalType": "ROLE",
|
|
51
|
+
"principalId": "$everyone",
|
|
52
|
+
"permission": "ALLOW",
|
|
53
|
+
"property": "verifyTwoFactor"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"principalType": "ROLE",
|
|
57
|
+
"principalId": "$authenticated",
|
|
58
|
+
"permission": "ALLOW",
|
|
59
|
+
"property": "beginTwoFactorEnrollment"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"principalType": "ROLE",
|
|
63
|
+
"principalId": "$authenticated",
|
|
64
|
+
"permission": "ALLOW",
|
|
65
|
+
"property": "confirmTwoFactorEnrollment"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"principalType": "ROLE",
|
|
69
|
+
"principalId": "$authenticated",
|
|
70
|
+
"permission": "ALLOW",
|
|
71
|
+
"property": "regenerateTwoFactorRecoveryCodes"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"principalType": "ROLE",
|
|
75
|
+
"principalId": "$authenticated",
|
|
76
|
+
"permission": "ALLOW",
|
|
77
|
+
"property": "disableTwoFactor"
|
|
78
|
+
},
|
|
49
79
|
{
|
|
50
80
|
"principalType": "ROLE",
|
|
51
81
|
"principalId": "$everyone",
|
|
@@ -3,8 +3,15 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __esmMin = (fn, res) => () =>
|
|
7
|
-
|
|
6
|
+
var __esmMin = (fn, res, err) => () => {
|
|
7
|
+
if (err) throw err[0];
|
|
8
|
+
try {
|
|
9
|
+
return fn && (res = fn(fn = 0)), res;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw err = [e], e;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
8
15
|
var __exportAll = (all, no_symbols) => {
|
|
9
16
|
let target = {};
|
|
10
17
|
for (var name in all) __defProp(target, name, {
|
|
@@ -50,9 +50,7 @@ var require_acl = /* @__PURE__ */ require_runtime$1.__commonJSMin(((exports, mod
|
|
|
50
50
|
case ACL.EXECUTE:
|
|
51
51
|
isMatchingAccessType = true;
|
|
52
52
|
break;
|
|
53
|
-
case ACL.WRITE:
|
|
54
|
-
isMatchingAccessType = requestedValue === ACL.REPLICATE;
|
|
55
|
-
break;
|
|
53
|
+
case ACL.WRITE: isMatchingAccessType = requestedValue === ACL.REPLICATE;
|
|
56
54
|
}
|
|
57
55
|
if (isMatchingMethodName || isMatchingAccessType) score += 3;
|
|
58
56
|
else if (ruleValue === ACL.ALL) score += 2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -124,18 +124,19 @@ var require_change = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, mo
|
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
function doRectify(checkpoint, rev) {
|
|
127
|
-
if (rev)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
change.
|
|
135
|
-
|
|
127
|
+
if (rev) {
|
|
128
|
+
if (currentRev === rev) {
|
|
129
|
+
change.debug("ASSERTION FAILED: Change currentRev==rev should have been already handled");
|
|
130
|
+
return cb(null, change);
|
|
131
|
+
} else {
|
|
132
|
+
change.rev = rev;
|
|
133
|
+
change.debug("updated revision (was " + currentRev + ")");
|
|
134
|
+
if (change.checkpoint !== checkpoint) {
|
|
135
|
+
change.prev = currentRev;
|
|
136
|
+
change.debug("updated prev");
|
|
137
|
+
}
|
|
136
138
|
}
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
+
} else {
|
|
139
140
|
change.rev = null;
|
|
140
141
|
change.debug("updated revision (was " + currentRev + ")");
|
|
141
142
|
if (change.checkpoint !== checkpoint) {
|
|
@@ -226,13 +227,15 @@ var require_change = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, mo
|
|
|
226
227
|
localChange = new Change(localChange);
|
|
227
228
|
localModelIds.push(localChange.modelId);
|
|
228
229
|
const remoteChange = remoteChangeIndex[localChange.modelId];
|
|
229
|
-
if (remoteChange && !localChange.equals(remoteChange))
|
|
230
|
-
remoteChange.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
230
|
+
if (remoteChange && !localChange.equals(remoteChange)) {
|
|
231
|
+
if (remoteChange.conflictsWith(localChange)) {
|
|
232
|
+
remoteChange.debug("remote conflict");
|
|
233
|
+
localChange.debug("local conflict");
|
|
234
|
+
conflicts.push(localChange);
|
|
235
|
+
} else {
|
|
236
|
+
remoteChange.debug("remote delta");
|
|
237
|
+
deltas.push(remoteChange);
|
|
238
|
+
}
|
|
236
239
|
}
|
|
237
240
|
});
|
|
238
241
|
modelIds.forEach(function(id) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region src/common/models/rate-limit-state.ts
|
|
3
|
+
var require_rate_limit_state = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.cjs").__commonJSMin(((exports, module) => {
|
|
4
|
+
module.exports = function configureRateLimitState(_RateLimitState) {};
|
|
5
|
+
}));
|
|
6
|
+
//#endregion
|
|
7
|
+
module.exports = require_rate_limit_state();
|