@3sixty/api-auth-entity-storage-service 0.20.0-next.0 → 0.20.0-next.1
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 -1
- package/dist/es/entities/authenticationUser.js +1 -9
- package/dist/es/entities/authenticationUser.js.map +1 -1
- package/dist/es/entities/authenticationUserV0.js +69 -0
- package/dist/es/entities/authenticationUserV0.js.map +1 -0
- package/dist/es/index.js +1 -9
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IAuthHeaderProcessorConfig.js.map +1 -1
- package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -1
- package/dist/es/models/IAuthTokenContext.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -1
- package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -1
- package/dist/es/processors/authHeaderProcessor.js +9 -14
- package/dist/es/processors/authHeaderProcessor.js.map +1 -1
- package/dist/es/restEntryPoints.js +1 -8
- package/dist/es/restEntryPoints.js.map +1 -1
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js +22 -14
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js.map +1 -1
- package/dist/es/routes/entityStorageAuthenticationRoutes.js +45 -1
- package/dist/es/routes/entityStorageAuthenticationRoutes.js.map +1 -1
- package/dist/es/schema.js +2 -4
- package/dist/es/schema.js.map +1 -1
- package/dist/es/services/entityStorageAuthenticationAdminService.js +69 -68
- package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -1
- package/dist/es/services/entityStorageAuthenticationService.js +29 -17
- package/dist/es/services/entityStorageAuthenticationService.js.map +1 -1
- package/dist/es/utils/passwordHelper.js +7 -5
- package/dist/es/utils/passwordHelper.js.map +1 -1
- package/dist/es/utils/tokenHelper.js +2 -23
- package/dist/es/utils/tokenHelper.js.map +1 -1
- package/dist/types/entities/authenticationUser.d.ts +0 -4
- package/dist/types/entities/authenticationUserV0.d.ts +33 -0
- package/dist/types/index.d.ts +1 -9
- package/dist/types/models/IAuthHeaderProcessorConfig.d.ts +1 -2
- package/dist/types/models/IAuthTokenContext.d.ts +0 -4
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +14 -3
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +6 -1
- package/dist/types/models/IEntityStorageAuthenticationServiceConfig.d.ts +7 -2
- package/dist/types/restEntryPoints.d.ts +1 -1
- package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +10 -2
- package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +6 -2
- package/dist/types/services/entityStorageAuthenticationService.d.ts +6 -1
- package/dist/types/utils/passwordHelper.d.ts +6 -3
- package/dist/types/utils/tokenHelper.d.ts +2 -11
- package/docs/changelog.md +19 -0
- package/docs/examples.md +9 -93
- package/docs/open-api/spec.json +178 -956
- package/docs/reference/classes/AuthHeaderProcessor.md +4 -0
- package/docs/reference/classes/AuthenticationUser.md +0 -8
- package/docs/reference/classes/AuthenticationUserV0.md +69 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +11 -3
- package/docs/reference/classes/EntityStorageAuthenticationService.md +18 -0
- package/docs/reference/classes/PasswordHelper.md +4 -4
- package/docs/reference/classes/TokenHelper.md +2 -44
- package/docs/reference/functions/authenticationPasswordPolicy.md +31 -0
- package/docs/reference/index.md +2 -15
- package/docs/reference/interfaces/IAuthHeaderProcessorConfig.md +1 -2
- package/docs/reference/interfaces/IAuthTokenContext.md +0 -8
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +38 -4
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +15 -1
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +15 -1
- package/docs/reference/variables/restEntryPoints.md +1 -1
- package/locales/en.json +1 -16
- package/package.json +7 -8
- package/dist/es/entities/authenticationAuditEntry.js +0 -121
- package/dist/es/entities/authenticationAuditEntry.js.map +0 -1
- package/dist/es/entities/authenticationRateEntry.js +0 -37
- package/dist/es/entities/authenticationRateEntry.js.map +0 -1
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js +0 -4
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js.map +0 -1
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js +0 -2
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js.map +0 -1
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js +0 -2
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js.map +0 -1
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js +0 -2
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js.map +0 -1
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +0 -343
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +0 -1
- package/dist/es/services/entityStorageAuthenticationAuditService.js +0 -240
- package/dist/es/services/entityStorageAuthenticationAuditService.js.map +0 -1
- package/dist/es/services/entityStorageAuthenticationRateService.js +0 -213
- package/dist/es/services/entityStorageAuthenticationRateService.js.map +0 -1
- package/dist/types/entities/authenticationAuditEntry.d.ts +0 -49
- package/dist/types/entities/authenticationRateEntry.d.ts +0 -17
- package/dist/types/models/IEntityStorageAuthenticationAuditServiceConfig.d.ts +0 -9
- package/dist/types/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.d.ts +0 -15
- package/dist/types/models/IEntityStorageAuthenticationRateServiceConfig.d.ts +0 -10
- package/dist/types/models/IEntityStorageAuthenticationRateServiceConstructorOptions.d.ts +0 -25
- package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +0 -54
- package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +0 -72
- package/dist/types/services/entityStorageAuthenticationRateService.d.ts +0 -60
- package/docs/reference/classes/AuthenticationAuditEntry.md +0 -101
- package/docs/reference/classes/AuthenticationRateEntry.md +0 -37
- package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +0 -241
- package/docs/reference/classes/EntityStorageAuthenticationRateService.md +0 -227
- package/docs/reference/functions/authenticationAuditCreate.md +0 -37
- package/docs/reference/functions/authenticationAuditGet.md +0 -31
- package/docs/reference/functions/authenticationAuditQuery.md +0 -31
- package/docs/reference/functions/authenticationAuditRemove.md +0 -31
- package/docs/reference/functions/authenticationAuditUpdate.md +0 -31
- package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +0 -25
- package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConfig.md +0 -11
- package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md +0 -25
- package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConfig.md +0 -17
- package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md +0 -53
- package/docs/reference/variables/tagsAuthenticationAudit.md +0 -5
|
@@ -132,6 +132,8 @@ The context IDs of the request.
|
|
|
132
132
|
|
|
133
133
|
##### processorState
|
|
134
134
|
|
|
135
|
+
\{\[`id`: `string`\]: `unknown`; \}
|
|
136
|
+
|
|
135
137
|
The state handed through the processors.
|
|
136
138
|
|
|
137
139
|
#### Returns
|
|
@@ -180,6 +182,8 @@ The context IDs of the request.
|
|
|
180
182
|
|
|
181
183
|
##### processorState
|
|
182
184
|
|
|
185
|
+
\{\[`id`: `string`\]: `unknown`; \}
|
|
186
|
+
|
|
183
187
|
The state handed through the processors.
|
|
184
188
|
|
|
185
189
|
#### Returns
|
|
@@ -54,14 +54,6 @@ The users organization.
|
|
|
54
54
|
|
|
55
55
|
***
|
|
56
56
|
|
|
57
|
-
### scope {#scope}
|
|
58
|
-
|
|
59
|
-
> **scope**: `string`
|
|
60
|
-
|
|
61
|
-
The scope assigned to the user, comma separated.
|
|
62
|
-
|
|
63
|
-
***
|
|
64
|
-
|
|
65
57
|
### passwordVersion? {#passwordversion}
|
|
66
58
|
|
|
67
59
|
> `optional` **passwordVersion?**: `number`
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Class: AuthenticationUserV0
|
|
2
|
+
|
|
3
|
+
Class defining the storage for user login credentials.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new AuthenticationUserV0**(): `AuthenticationUserV0`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`AuthenticationUserV0`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### email {#email}
|
|
18
|
+
|
|
19
|
+
> **email**: `string`
|
|
20
|
+
|
|
21
|
+
The user e-mail address.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### password {#password}
|
|
26
|
+
|
|
27
|
+
> **password**: `string`
|
|
28
|
+
|
|
29
|
+
The encrypted password for the user.
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### salt {#salt}
|
|
34
|
+
|
|
35
|
+
> **salt**: `string`
|
|
36
|
+
|
|
37
|
+
The salt for the password.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### identity {#identity}
|
|
42
|
+
|
|
43
|
+
> **identity**: `string`
|
|
44
|
+
|
|
45
|
+
The user identity.
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### organization {#organization}
|
|
50
|
+
|
|
51
|
+
> **organization**: `string`
|
|
52
|
+
|
|
53
|
+
The users organization.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### scope {#scope}
|
|
58
|
+
|
|
59
|
+
> **scope**: `string`
|
|
60
|
+
|
|
61
|
+
The scope assigned to the user, comma separated.
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### passwordVersion? {#passwordversion}
|
|
66
|
+
|
|
67
|
+
> `optional` **passwordVersion?**: `number`
|
|
68
|
+
|
|
69
|
+
The password version counter, incremented on every password change to invalidate existing tokens.
|
|
@@ -36,11 +36,19 @@ Runtime name for the class.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### DEFAULT\_ESCALATED\_PRIVILEGE\
|
|
39
|
+
### DEFAULT\_ESCALATED\_PRIVILEGE\_ROLE {#default_escalated_privilege_role}
|
|
40
40
|
|
|
41
|
-
> `readonly` `static` **DEFAULT\_ESCALATED\_PRIVILEGE\
|
|
41
|
+
> `readonly` `static` **DEFAULT\_ESCALATED\_PRIVILEGE\_ROLE**: `string` = `"global-admin"`
|
|
42
42
|
|
|
43
|
-
The
|
|
43
|
+
The default role that grants escalated privilege.
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### DEFAULT\_AUTHORIZATION\_MODEL\_ID {#default_authorization_model_id}
|
|
48
|
+
|
|
49
|
+
> `readonly` `static` **DEFAULT\_AUTHORIZATION\_MODEL\_ID**: `string` = `"system"`
|
|
50
|
+
|
|
51
|
+
The default authorization model ID used to look up roles.
|
|
44
52
|
|
|
45
53
|
## Methods
|
|
46
54
|
|
|
@@ -219,3 +219,21 @@ A promise that resolves when the password has been updated and the rate limit cl
|
|
|
219
219
|
#### Implementation of
|
|
220
220
|
|
|
221
221
|
`IAuthenticationComponent.updatePassword`
|
|
222
|
+
|
|
223
|
+
***
|
|
224
|
+
|
|
225
|
+
### passwordPolicy() {#passwordpolicy}
|
|
226
|
+
|
|
227
|
+
> **passwordPolicy**(): `Promise`\<`IPasswordOptions`\>
|
|
228
|
+
|
|
229
|
+
Get the password policy used for password validation.
|
|
230
|
+
|
|
231
|
+
#### Returns
|
|
232
|
+
|
|
233
|
+
`Promise`\<`IPasswordOptions`\>
|
|
234
|
+
|
|
235
|
+
The password policy options.
|
|
236
|
+
|
|
237
|
+
#### Implementation of
|
|
238
|
+
|
|
239
|
+
`IAuthenticationComponent.passwordPolicy`
|
|
@@ -24,7 +24,7 @@ Runtime name for the class.
|
|
|
24
24
|
|
|
25
25
|
### updatePassword() {#updatepassword}
|
|
26
26
|
|
|
27
|
-
> `static` **updatePassword**(`userEntityStorage`, `authenticationAuditService`, `user`, `newPassword`, `currentPassword?`, `
|
|
27
|
+
> `static` **updatePassword**(`userEntityStorage`, `authenticationAuditService`, `user`, `newPassword`, `currentPassword?`, `options?`): `Promise`\<`void`\>
|
|
28
28
|
|
|
29
29
|
Update the password for a user.
|
|
30
30
|
Validates password strength, verifies the current password if provided, then hashes and stores the new password and raises an audit event.
|
|
@@ -61,11 +61,11 @@ The new password to set.
|
|
|
61
61
|
|
|
62
62
|
The current password to verify against, if supplied.
|
|
63
63
|
|
|
64
|
-
#####
|
|
64
|
+
##### options?
|
|
65
65
|
|
|
66
|
-
`
|
|
66
|
+
`IPasswordOptions`
|
|
67
67
|
|
|
68
|
-
Optional
|
|
68
|
+
Optional password length validation options.
|
|
69
69
|
|
|
70
70
|
#### Returns
|
|
71
71
|
|
|
@@ -24,7 +24,7 @@ Runtime name for the class.
|
|
|
24
24
|
|
|
25
25
|
### createToken() {#createtoken}
|
|
26
26
|
|
|
27
|
-
> `static` **createToken**(`vaultConnector`, `nodeId`, `signingKeyName`, `userIdentity`, `organizationIdentity`, `tenantId`, `ttlMinutes`, `
|
|
27
|
+
> `static` **createToken**(`vaultConnector`, `nodeId`, `signingKeyName`, `userIdentity`, `organizationIdentity`, `tenantId`, `ttlMinutes`, `passwordVersion?`): `Promise`\<\{ `token`: `string`; `expiry`: `number`; \}\>
|
|
28
28
|
|
|
29
29
|
Create a new token.
|
|
30
30
|
|
|
@@ -72,12 +72,6 @@ The tenant id for the token.
|
|
|
72
72
|
|
|
73
73
|
The time to live for the token in minutes.
|
|
74
74
|
|
|
75
|
-
##### scope?
|
|
76
|
-
|
|
77
|
-
`string`
|
|
78
|
-
|
|
79
|
-
The scopes for the token.
|
|
80
|
-
|
|
81
75
|
##### passwordVersion?
|
|
82
76
|
|
|
83
77
|
`number`
|
|
@@ -94,7 +88,7 @@ The new token and its expiry date.
|
|
|
94
88
|
|
|
95
89
|
### verify() {#verify}
|
|
96
90
|
|
|
97
|
-
> `static` **verify**(`vaultConnector`, `nodeId`, `signingKeyName`, `token`, `
|
|
91
|
+
> `static` **verify**(`vaultConnector`, `nodeId`, `signingKeyName`, `token`, `verifyUser?`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
|
|
98
92
|
|
|
99
93
|
Verify the token.
|
|
100
94
|
|
|
@@ -124,12 +118,6 @@ The signing key name, expected to match the JWT key identifier.
|
|
|
124
118
|
|
|
125
119
|
The token to verify.
|
|
126
120
|
|
|
127
|
-
##### requiredScopes?
|
|
128
|
-
|
|
129
|
-
`string`[]
|
|
130
|
-
|
|
131
|
-
The required scopes.
|
|
132
|
-
|
|
133
121
|
##### verifyUser?
|
|
134
122
|
|
|
135
123
|
(`sub`, `org`, `tid`, `passwordVersion`) => `Promise`\<`string`[]\>
|
|
@@ -148,36 +136,6 @@ UnauthorizedError if the token is missing, invalid or expired.
|
|
|
148
136
|
|
|
149
137
|
***
|
|
150
138
|
|
|
151
|
-
### verifyScopes() {#verifyscopes}
|
|
152
|
-
|
|
153
|
-
> `static` **verifyScopes**(`scope`, `requiredScopes?`): `void`
|
|
154
|
-
|
|
155
|
-
Verify that a token carries all of the required scopes.
|
|
156
|
-
|
|
157
|
-
#### Parameters
|
|
158
|
-
|
|
159
|
-
##### scope
|
|
160
|
-
|
|
161
|
-
`string` \| `undefined`
|
|
162
|
-
|
|
163
|
-
The comma separated scopes from the token.
|
|
164
|
-
|
|
165
|
-
##### requiredScopes?
|
|
166
|
-
|
|
167
|
-
`string`[]
|
|
168
|
-
|
|
169
|
-
The scopes the caller must hold.
|
|
170
|
-
|
|
171
|
-
#### Returns
|
|
172
|
-
|
|
173
|
-
`void`
|
|
174
|
-
|
|
175
|
-
#### Throws
|
|
176
|
-
|
|
177
|
-
UnauthorizedError if any of the required scopes is missing.
|
|
178
|
-
|
|
179
|
-
***
|
|
180
|
-
|
|
181
139
|
### extractTokenFromHeaders() {#extracttokenfromheaders}
|
|
182
140
|
|
|
183
141
|
> `static` **extractTokenFromHeaders**(`headers?`, `cookieName?`): \{ `token`: `string`; `location`: `"authorization"` \| `"cookie"`; \} \| `undefined`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationPasswordPolicy()
|
|
2
|
+
|
|
3
|
+
> **authenticationPasswordPolicy**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IPasswordPolicyResponse` & `IRestRouteResponseOptions`\>
|
|
4
|
+
|
|
5
|
+
Get the password policy.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### httpRequestContext
|
|
10
|
+
|
|
11
|
+
`IHttpRequestContext`
|
|
12
|
+
|
|
13
|
+
The request context for the API.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes.
|
|
20
|
+
|
|
21
|
+
### request
|
|
22
|
+
|
|
23
|
+
`INoContentRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`IPasswordPolicyResponse` & `IRestRouteResponseOptions`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
package/docs/reference/index.md
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Classes
|
|
4
4
|
|
|
5
|
-
- [AuthenticationAuditEntry](classes/AuthenticationAuditEntry.md)
|
|
6
|
-
- [AuthenticationRateEntry](classes/AuthenticationRateEntry.md)
|
|
7
5
|
- [AuthenticationUser](classes/AuthenticationUser.md)
|
|
6
|
+
- [AuthenticationUserV0](classes/AuthenticationUserV0.md)
|
|
8
7
|
- [AuthHeaderProcessor](classes/AuthHeaderProcessor.md)
|
|
9
8
|
- [EntityStorageAuthenticationAdminService](classes/EntityStorageAuthenticationAdminService.md)
|
|
10
|
-
- [EntityStorageAuthenticationAuditService](classes/EntityStorageAuthenticationAuditService.md)
|
|
11
|
-
- [EntityStorageAuthenticationRateService](classes/EntityStorageAuthenticationRateService.md)
|
|
12
9
|
- [EntityStorageAuthenticationService](classes/EntityStorageAuthenticationService.md)
|
|
13
10
|
- [PasswordHelper](classes/PasswordHelper.md)
|
|
14
11
|
- [TokenHelper](classes/TokenHelper.md)
|
|
@@ -20,10 +17,6 @@
|
|
|
20
17
|
- [IAuthTokenContext](interfaces/IAuthTokenContext.md)
|
|
21
18
|
- [IEntityStorageAuthenticationAdminServiceConfig](interfaces/IEntityStorageAuthenticationAdminServiceConfig.md)
|
|
22
19
|
- [IEntityStorageAuthenticationAdminServiceConstructorOptions](interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md)
|
|
23
|
-
- [IEntityStorageAuthenticationAuditServiceConfig](interfaces/IEntityStorageAuthenticationAuditServiceConfig.md)
|
|
24
|
-
- [IEntityStorageAuthenticationAuditServiceConstructorOptions](interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md)
|
|
25
|
-
- [IEntityStorageAuthenticationRateServiceConfig](interfaces/IEntityStorageAuthenticationRateServiceConfig.md)
|
|
26
|
-
- [IEntityStorageAuthenticationRateServiceConstructorOptions](interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md)
|
|
27
20
|
- [IEntityStorageAuthenticationServiceConfig](interfaces/IEntityStorageAuthenticationServiceConfig.md)
|
|
28
21
|
- [IEntityStorageAuthenticationServiceConstructorOptions](interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md)
|
|
29
22
|
|
|
@@ -31,7 +24,6 @@
|
|
|
31
24
|
|
|
32
25
|
- [restEntryPoints](variables/restEntryPoints.md)
|
|
33
26
|
- [tagsAuthenticationAdmin](variables/tagsAuthenticationAdmin.md)
|
|
34
|
-
- [tagsAuthenticationAudit](variables/tagsAuthenticationAudit.md)
|
|
35
27
|
- [tagsAuthentication](variables/tagsAuthentication.md)
|
|
36
28
|
|
|
37
29
|
## Functions
|
|
@@ -43,15 +35,10 @@
|
|
|
43
35
|
- [authenticationAdminGetUser](functions/authenticationAdminGetUser.md)
|
|
44
36
|
- [authenticationAdminGetUserByIdentity](functions/authenticationAdminGetUserByIdentity.md)
|
|
45
37
|
- [authenticationAdminRemoveUser](functions/authenticationAdminRemoveUser.md)
|
|
46
|
-
- [generateRestRoutesAuthenticationAudit](functions/generateRestRoutesAuthenticationAudit.md)
|
|
47
|
-
- [authenticationAuditCreate](functions/authenticationAuditCreate.md)
|
|
48
|
-
- [authenticationAuditGet](functions/authenticationAuditGet.md)
|
|
49
|
-
- [authenticationAuditUpdate](functions/authenticationAuditUpdate.md)
|
|
50
|
-
- [authenticationAuditRemove](functions/authenticationAuditRemove.md)
|
|
51
|
-
- [authenticationAuditQuery](functions/authenticationAuditQuery.md)
|
|
52
38
|
- [generateRestRoutesAuthentication](functions/generateRestRoutesAuthentication.md)
|
|
53
39
|
- [authenticationLogin](functions/authenticationLogin.md)
|
|
54
40
|
- [authenticationLogout](functions/authenticationLogout.md)
|
|
55
41
|
- [authenticationRefreshToken](functions/authenticationRefreshToken.md)
|
|
56
42
|
- [authenticationUpdatePassword](functions/authenticationUpdatePassword.md)
|
|
43
|
+
- [authenticationPasswordPolicy](functions/authenticationPasswordPolicy.md)
|
|
57
44
|
- [initSchema](functions/initSchema.md)
|
|
@@ -48,8 +48,7 @@ The time in milliseconds a verified token is kept in the in-memory cache, counte
|
|
|
48
48
|
was verified and not extended by use, set to 0 to disable caching. A hit skips the vault
|
|
49
49
|
signature check, the tenant lookup and the user lookup, so this is also the longest a password
|
|
50
50
|
change, a user removal or a signing key rotation can go unnoticed. An entry never outlives the
|
|
51
|
-
expiry claim of its own token either.
|
|
52
|
-
request.
|
|
51
|
+
expiry claim of its own token either.
|
|
53
52
|
|
|
54
53
|
#### Default
|
|
55
54
|
|
|
@@ -45,14 +45,6 @@ The organization of the verified user.
|
|
|
45
45
|
|
|
46
46
|
***
|
|
47
47
|
|
|
48
|
-
### scope? {#scope}
|
|
49
|
-
|
|
50
|
-
> `optional` **scope?**: `string`
|
|
51
|
-
|
|
52
|
-
The comma separated scopes carried by the token.
|
|
53
|
-
|
|
54
|
-
***
|
|
55
|
-
|
|
56
48
|
### expires? {#expires}
|
|
57
49
|
|
|
58
50
|
> `optional` **expires?**: `number`
|
|
@@ -13,13 +13,47 @@ The minimum password length.
|
|
|
13
13
|
#### Default
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
-
|
|
16
|
+
15
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### maxPasswordLength? {#maxpasswordlength}
|
|
22
22
|
|
|
23
|
-
> `optional` **
|
|
23
|
+
> `optional` **maxPasswordLength?**: `number`
|
|
24
24
|
|
|
25
|
-
The
|
|
25
|
+
The maximum password length.
|
|
26
|
+
|
|
27
|
+
#### Default
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
128
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
***
|
|
34
|
+
|
|
35
|
+
### escalatedPrivilegeRole? {#escalatedprivilegerole}
|
|
36
|
+
|
|
37
|
+
> `optional` **escalatedPrivilegeRole?**: `string`
|
|
38
|
+
|
|
39
|
+
The role that grants escalated privilege, only callers holding it can modify accounts that hold it.
|
|
40
|
+
|
|
41
|
+
#### Default
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
global-admin
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### authorizationModelId? {#authorizationmodelid}
|
|
50
|
+
|
|
51
|
+
> `optional` **authorizationModelId?**: `string`
|
|
52
|
+
|
|
53
|
+
The authorization model ID used to look up roles.
|
|
54
|
+
|
|
55
|
+
#### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
system
|
|
59
|
+
```
|
package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md
CHANGED
|
@@ -22,7 +22,7 @@ authentication-user
|
|
|
22
22
|
|
|
23
23
|
> `optional` **authenticationAuditServiceType?**: `string`
|
|
24
24
|
|
|
25
|
-
The audit
|
|
25
|
+
The audit component.
|
|
26
26
|
|
|
27
27
|
#### Default
|
|
28
28
|
|
|
@@ -32,6 +32,20 @@ authentication-audit
|
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
|
+
### authorizationComponentType? {#authorizationcomponenttype}
|
|
36
|
+
|
|
37
|
+
> `optional` **authorizationComponentType?**: `string`
|
|
38
|
+
|
|
39
|
+
The authorization component used to guard accounts with escalated privilege.
|
|
40
|
+
|
|
41
|
+
#### Default
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
authorization
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
35
49
|
### config? {#config}
|
|
36
50
|
|
|
37
51
|
> `optional` **config?**: [`IEntityStorageAuthenticationAdminServiceConfig`](IEntityStorageAuthenticationAdminServiceConfig.md)
|
|
@@ -41,7 +41,21 @@ The minimum password length for new password validation.
|
|
|
41
41
|
#### Default
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
|
-
|
|
44
|
+
15
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### maxPasswordLength? {#maxpasswordlength}
|
|
50
|
+
|
|
51
|
+
> `optional` **maxPasswordLength?**: `number`
|
|
52
|
+
|
|
53
|
+
The maximum password length for new password validation.
|
|
54
|
+
|
|
55
|
+
#### Default
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
128
|
|
45
59
|
```
|
|
46
60
|
|
|
47
61
|
***
|
package/locales/en.json
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
"removeUserFailed": "Removing the user failed",
|
|
15
15
|
"updatePasswordFailed": "Updating the user's password failed",
|
|
16
16
|
"userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\"",
|
|
17
|
-
"
|
|
18
|
-
"insufficientScopeForEscalatedTarget": "Caller does not hold the required scope \"{scopeName}\" to modify an account with escalated privilege."
|
|
17
|
+
"insufficientRoleForEscalatedTarget": "Caller does not hold the required role \"{roleName}\" to modify an account with escalated privilege."
|
|
19
18
|
},
|
|
20
19
|
"authHeaderProcessor": {
|
|
21
20
|
"nodeIdNotSet": "The node ID has not been set"
|
|
@@ -23,16 +22,6 @@
|
|
|
23
22
|
"passwordHelper": {
|
|
24
23
|
"currentPasswordMismatch": "The current password is incorrect"
|
|
25
24
|
},
|
|
26
|
-
"entityStorageAuthenticationAuditService": {
|
|
27
|
-
"auditEntryNotFound": "The audit entry with the specified identifier could not be found \"{notFoundId}\"",
|
|
28
|
-
"getAuditEntryFailed": "Getting the audit entry failed",
|
|
29
|
-
"updateAuditEntryFailed": "Updating the audit entry failed",
|
|
30
|
-
"removeAuditEntryFailed": "Removing the audit entry failed"
|
|
31
|
-
},
|
|
32
|
-
"entityStorageAuthenticationRateService": {
|
|
33
|
-
"actionConfigMissing": "No rate-limit configuration exists for action \"{action}\".",
|
|
34
|
-
"rateLimitExceeded": "The rate limit for action \"{action}\" has been exceeded. Retry after {retryAfterSeconds} seconds."
|
|
35
|
-
},
|
|
36
25
|
"tokenHelper": {
|
|
37
26
|
"missing": "The JSON Web token could not be found in the authorization header",
|
|
38
27
|
"headerKeyIdMismatch": "The JSON Web token key identifier does not match the expected signing key",
|
|
@@ -40,13 +29,9 @@
|
|
|
40
29
|
"payloadMissingSubject": "The JSON Web token payload does not contain a subject",
|
|
41
30
|
"payloadMissingOrganization": "The JSON Web token payload does not contain an organization",
|
|
42
31
|
"expired": "The JSON Web token has expired",
|
|
43
|
-
"insufficientScopes": "The JSON Web token does not have the required scopes to access this resource",
|
|
44
32
|
"userNotVerified": "The user associated with the JSON Web token could not be verified",
|
|
45
33
|
"organizationNotVerified": "The organization associated with the JSON Web token could not be verified",
|
|
46
34
|
"tenantNotVerified": "The tenant associated with the JSON Web token could not be verified"
|
|
47
|
-
},
|
|
48
|
-
"validation": {
|
|
49
|
-
"saltEntropyTooLow": "Salt must have at least 8 unique characters for sufficient entropy."
|
|
50
35
|
}
|
|
51
36
|
}
|
|
52
37
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3sixty/api-auth-entity-storage-service",
|
|
3
|
-
"version": "0.20.0-next.
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
4
|
"description": "Authentication service implementation and REST routes backed by entity storage.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/3sixtyglobal/api.git",
|
|
7
|
+
"url": "git+https://github.com/3sixtyglobal/api-auth.git",
|
|
8
8
|
"directory": "packages/api-auth-entity-storage-service"
|
|
9
9
|
},
|
|
10
10
|
"author": "martyn.janes@iota.org",
|
|
@@ -14,16 +14,15 @@
|
|
|
14
14
|
"node": ">=24.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@3sixty/api-auth-entity-storage-models": "0.20.0-next.
|
|
18
|
-
"@3sixty/api-
|
|
19
|
-
"@3sixty/api-models": "
|
|
20
|
-
"@3sixty/
|
|
17
|
+
"@3sixty/api-auth-entity-storage-models": "0.20.0-next.1",
|
|
18
|
+
"@3sixty/api-auth-models": "0.20.0-next.1",
|
|
19
|
+
"@3sixty/api-models": "next",
|
|
20
|
+
"@3sixty/authorization-models": "next",
|
|
21
21
|
"@3sixty/context": "next",
|
|
22
22
|
"@3sixty/core": "next",
|
|
23
23
|
"@3sixty/crypto": "next",
|
|
24
24
|
"@3sixty/entity": "next",
|
|
25
25
|
"@3sixty/entity-storage-models": "next",
|
|
26
|
-
"@3sixty/logging-models": "next",
|
|
27
26
|
"@3sixty/nameof": "next",
|
|
28
27
|
"@3sixty/vault-models": "next",
|
|
29
28
|
"@3sixty/web": "next"
|
|
@@ -59,7 +58,7 @@
|
|
|
59
58
|
"business-logic"
|
|
60
59
|
],
|
|
61
60
|
"bugs": {
|
|
62
|
-
"url": "git+https://github.com/3sixtyglobal/api/issues"
|
|
61
|
+
"url": "git+https://github.com/3sixtyglobal/api-auth/issues"
|
|
63
62
|
},
|
|
64
63
|
"homepage": "https://3sixty.global"
|
|
65
64
|
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 IOTA Stiftung.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
-
import { SortDirection, entity, property } from "@3sixty/entity";
|
|
4
|
-
/**
|
|
5
|
-
* Class defining the storage for authentication audit entries.
|
|
6
|
-
*/
|
|
7
|
-
let AuthenticationAuditEntry = class AuthenticationAuditEntry {
|
|
8
|
-
/**
|
|
9
|
-
* The unique identifier for the audit entry.
|
|
10
|
-
*/
|
|
11
|
-
id;
|
|
12
|
-
/**
|
|
13
|
-
* The timestamp of the audit entry in ISO 8601 format.
|
|
14
|
-
*/
|
|
15
|
-
dateCreated;
|
|
16
|
-
/**
|
|
17
|
-
* The audit event that occurred.
|
|
18
|
-
*/
|
|
19
|
-
event;
|
|
20
|
-
/**
|
|
21
|
-
* The actor identifier, could be e-mail, username, or other unique identifier.
|
|
22
|
-
*/
|
|
23
|
-
actorId;
|
|
24
|
-
/**
|
|
25
|
-
* The node identifier associated with the audit entry, if applicable.
|
|
26
|
-
*/
|
|
27
|
-
nodeId;
|
|
28
|
-
/**
|
|
29
|
-
* The organization identifier associated with the audit entry, if applicable.
|
|
30
|
-
*/
|
|
31
|
-
organizationId;
|
|
32
|
-
/**
|
|
33
|
-
* The tenant identifier associated with the audit entry, if applicable.
|
|
34
|
-
*/
|
|
35
|
-
tenantId;
|
|
36
|
-
/**
|
|
37
|
-
* The hashed IP addresses of the client.
|
|
38
|
-
*/
|
|
39
|
-
ipAddressHashes;
|
|
40
|
-
/**
|
|
41
|
-
* The user agent string of the client.
|
|
42
|
-
*/
|
|
43
|
-
userAgent;
|
|
44
|
-
/**
|
|
45
|
-
* The correlation ID for request tracing.
|
|
46
|
-
*/
|
|
47
|
-
correlationId;
|
|
48
|
-
/**
|
|
49
|
-
* Additional data related to the audit entry, such as IP address, user agent, etc.
|
|
50
|
-
*/
|
|
51
|
-
data;
|
|
52
|
-
};
|
|
53
|
-
__decorate([
|
|
54
|
-
property({ type: "string", isPrimary: true, maxLength: 255 }),
|
|
55
|
-
__metadata("design:type", String)
|
|
56
|
-
], AuthenticationAuditEntry.prototype, "id", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
property({
|
|
59
|
-
type: "string",
|
|
60
|
-
format: "date-time",
|
|
61
|
-
isSecondary: true,
|
|
62
|
-
indexGroup: [{ name: "actorDate", direction: SortDirection.Descending, index: 1 }]
|
|
63
|
-
}),
|
|
64
|
-
__metadata("design:type", String)
|
|
65
|
-
], AuthenticationAuditEntry.prototype, "dateCreated", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
property({
|
|
68
|
-
type: "string",
|
|
69
|
-
maxLength: 128,
|
|
70
|
-
isSecondary: true
|
|
71
|
-
}),
|
|
72
|
-
__metadata("design:type", String)
|
|
73
|
-
], AuthenticationAuditEntry.prototype, "event", void 0);
|
|
74
|
-
__decorate([
|
|
75
|
-
property({
|
|
76
|
-
type: "string",
|
|
77
|
-
maxLength: 255,
|
|
78
|
-
isSecondary: true,
|
|
79
|
-
optional: true,
|
|
80
|
-
indexGroup: [{ name: "actorDate", direction: SortDirection.Ascending, index: 0 }]
|
|
81
|
-
}),
|
|
82
|
-
__metadata("design:type", String)
|
|
83
|
-
], AuthenticationAuditEntry.prototype, "actorId", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
property({ type: "string", maxLength: 255, isSecondary: true, optional: true }),
|
|
86
|
-
__metadata("design:type", String)
|
|
87
|
-
], AuthenticationAuditEntry.prototype, "nodeId", void 0);
|
|
88
|
-
__decorate([
|
|
89
|
-
property({ type: "string", maxLength: 255, isSecondary: true, optional: true }),
|
|
90
|
-
__metadata("design:type", String)
|
|
91
|
-
], AuthenticationAuditEntry.prototype, "organizationId", void 0);
|
|
92
|
-
__decorate([
|
|
93
|
-
property({
|
|
94
|
-
type: "string",
|
|
95
|
-
maxLength: 255,
|
|
96
|
-
isSecondary: true,
|
|
97
|
-
optional: true
|
|
98
|
-
}),
|
|
99
|
-
__metadata("design:type", String)
|
|
100
|
-
], AuthenticationAuditEntry.prototype, "tenantId", void 0);
|
|
101
|
-
__decorate([
|
|
102
|
-
property({ type: "array", optional: true }),
|
|
103
|
-
__metadata("design:type", Array)
|
|
104
|
-
], AuthenticationAuditEntry.prototype, "ipAddressHashes", void 0);
|
|
105
|
-
__decorate([
|
|
106
|
-
property({ type: "string", maxLength: 1024, optional: true }),
|
|
107
|
-
__metadata("design:type", String)
|
|
108
|
-
], AuthenticationAuditEntry.prototype, "userAgent", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
property({ type: "string", maxLength: 255, optional: true }),
|
|
111
|
-
__metadata("design:type", String)
|
|
112
|
-
], AuthenticationAuditEntry.prototype, "correlationId", void 0);
|
|
113
|
-
__decorate([
|
|
114
|
-
property({ type: "object", optional: true }),
|
|
115
|
-
__metadata("design:type", Object)
|
|
116
|
-
], AuthenticationAuditEntry.prototype, "data", void 0);
|
|
117
|
-
AuthenticationAuditEntry = __decorate([
|
|
118
|
-
entity()
|
|
119
|
-
], AuthenticationAuditEntry);
|
|
120
|
-
export { AuthenticationAuditEntry };
|
|
121
|
-
//# sourceMappingURL=authenticationAuditEntry.js.map
|