@twin.org/api-auth-entity-storage-service 0.0.3-next.22 → 0.0.3-next.23

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.
Files changed (76) hide show
  1. package/dist/es/entities/authenticationAuditEntry.js +101 -0
  2. package/dist/es/entities/authenticationAuditEntry.js.map +1 -0
  3. package/dist/es/entities/authenticationRateEntry.js +37 -0
  4. package/dist/es/entities/authenticationRateEntry.js.map +1 -0
  5. package/dist/es/index.js +9 -0
  6. package/dist/es/index.js.map +1 -1
  7. package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -1
  8. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js.map +1 -1
  9. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js +4 -0
  10. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js.map +1 -0
  11. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js +2 -0
  12. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js.map +1 -0
  13. package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js +2 -0
  14. package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js.map +1 -0
  15. package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js +2 -0
  16. package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js.map +1 -0
  17. package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js +0 -2
  18. package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -1
  19. package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -1
  20. package/dist/es/processors/authHeaderProcessor.js +18 -4
  21. package/dist/es/processors/authHeaderProcessor.js.map +1 -1
  22. package/dist/es/restEntryPoints.js +7 -0
  23. package/dist/es/restEntryPoints.js.map +1 -1
  24. package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +174 -0
  25. package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +1 -0
  26. package/dist/es/schema.js +4 -0
  27. package/dist/es/schema.js.map +1 -1
  28. package/dist/es/services/entityStorageAuthenticationAdminService.js +59 -4
  29. package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -1
  30. package/dist/es/services/entityStorageAuthenticationAuditService.js +178 -0
  31. package/dist/es/services/entityStorageAuthenticationAuditService.js.map +1 -0
  32. package/dist/es/services/entityStorageAuthenticationRateService.js +202 -0
  33. package/dist/es/services/entityStorageAuthenticationRateService.js.map +1 -0
  34. package/dist/es/services/entityStorageAuthenticationService.js +152 -8
  35. package/dist/es/services/entityStorageAuthenticationService.js.map +1 -1
  36. package/dist/es/utils/tokenHelper.js +11 -1
  37. package/dist/es/utils/tokenHelper.js.map +1 -1
  38. package/dist/types/entities/authenticationAuditEntry.d.ts +49 -0
  39. package/dist/types/entities/authenticationRateEntry.d.ts +17 -0
  40. package/dist/types/index.d.ts +9 -0
  41. package/dist/types/models/IAuthHeaderProcessorConstructorOptions.d.ts +5 -0
  42. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +5 -0
  43. package/dist/types/models/IEntityStorageAuthenticationAuditServiceConfig.d.ts +9 -0
  44. package/dist/types/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.d.ts +15 -0
  45. package/dist/types/models/IEntityStorageAuthenticationRateServiceConfig.d.ts +10 -0
  46. package/dist/types/models/IEntityStorageAuthenticationRateServiceConstructorOptions.d.ts +20 -0
  47. package/dist/types/models/IEntityStorageAuthenticationServiceConfig.d.ts +17 -1
  48. package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +10 -0
  49. package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +29 -0
  50. package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +59 -0
  51. package/dist/types/services/entityStorageAuthenticationRateService.d.ts +60 -0
  52. package/dist/types/services/entityStorageAuthenticationService.d.ts +6 -0
  53. package/dist/types/utils/tokenHelper.d.ts +2 -1
  54. package/docs/changelog.md +16 -0
  55. package/docs/reference/classes/AuthenticationAuditEntry.md +101 -0
  56. package/docs/reference/classes/AuthenticationRateEntry.md +37 -0
  57. package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +4 -4
  58. package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +157 -0
  59. package/docs/reference/classes/EntityStorageAuthenticationRateService.md +227 -0
  60. package/docs/reference/classes/EntityStorageAuthenticationService.md +26 -0
  61. package/docs/reference/classes/TokenHelper.md +7 -1
  62. package/docs/reference/functions/authenticationAuditCreate.md +31 -0
  63. package/docs/reference/functions/authenticationAuditQuery.md +31 -0
  64. package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +25 -0
  65. package/docs/reference/index.md +12 -0
  66. package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +14 -0
  67. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +14 -0
  68. package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConfig.md +11 -0
  69. package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md +25 -0
  70. package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConfig.md +17 -0
  71. package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md +39 -0
  72. package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +43 -1
  73. package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +28 -0
  74. package/docs/reference/variables/tagsAuthenticationAudit.md +5 -0
  75. package/locales/en.json +10 -1
  76. package/package.json +5 -4
@@ -0,0 +1,227 @@
1
+ # Class: EntityStorageAuthenticationRateService
2
+
3
+ Implementation of the authentication rate component using entity storage.
4
+
5
+ ## Implements
6
+
7
+ - `IAuthenticationRateComponent`
8
+
9
+ ## Constructors
10
+
11
+ ### Constructor
12
+
13
+ > **new EntityStorageAuthenticationRateService**(`options?`): `EntityStorageAuthenticationRateService`
14
+
15
+ Create a new instance of EntityStorageAuthenticationRateService.
16
+
17
+ #### Parameters
18
+
19
+ ##### options?
20
+
21
+ [`IEntityStorageAuthenticationRateServiceConstructorOptions`](../interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md)
22
+
23
+ The constructor options.
24
+
25
+ #### Returns
26
+
27
+ `EntityStorageAuthenticationRateService`
28
+
29
+ ## Properties
30
+
31
+ ### CLASS\_NAME {#class_name}
32
+
33
+ > `readonly` `static` **CLASS\_NAME**: `string`
34
+
35
+ Runtime name for the class.
36
+
37
+ ## Methods
38
+
39
+ ### registerAction() {#registeraction}
40
+
41
+ > **registerAction**(`action`, `config`): `Promise`\<`void`\>
42
+
43
+ Register or update rate-limit configuration for an action.
44
+
45
+ #### Parameters
46
+
47
+ ##### action
48
+
49
+ `string`
50
+
51
+ The action name.
52
+
53
+ ##### config
54
+
55
+ `IAuthenticationRateActionConfig`
56
+
57
+ The action configuration.
58
+
59
+ #### Returns
60
+
61
+ `Promise`\<`void`\>
62
+
63
+ Nothing.
64
+
65
+ #### Implementation of
66
+
67
+ `IAuthenticationRateComponent.registerAction`
68
+
69
+ ***
70
+
71
+ ### unregisterAction() {#unregisteraction}
72
+
73
+ > **unregisterAction**(`action`): `Promise`\<`void`\>
74
+
75
+ Unregister rate-limit configuration for an action.
76
+
77
+ #### Parameters
78
+
79
+ ##### action
80
+
81
+ `string`
82
+
83
+ The action name.
84
+
85
+ #### Returns
86
+
87
+ `Promise`\<`void`\>
88
+
89
+ Nothing.
90
+
91
+ #### Implementation of
92
+
93
+ `IAuthenticationRateComponent.unregisterAction`
94
+
95
+ ***
96
+
97
+ ### className() {#classname}
98
+
99
+ > **className**(): `string`
100
+
101
+ Returns the class name of the component.
102
+
103
+ #### Returns
104
+
105
+ `string`
106
+
107
+ The class name of the component.
108
+
109
+ #### Implementation of
110
+
111
+ `IAuthenticationRateComponent.className`
112
+
113
+ ***
114
+
115
+ ### start() {#start}
116
+
117
+ > **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
118
+
119
+ The service needs to be started when the application is initialized.
120
+
121
+ #### Parameters
122
+
123
+ ##### nodeLoggingComponentType?
124
+
125
+ `string`
126
+
127
+ The node logging component type.
128
+
129
+ #### Returns
130
+
131
+ `Promise`\<`void`\>
132
+
133
+ Nothing.
134
+
135
+ #### Implementation of
136
+
137
+ `IAuthenticationRateComponent.start`
138
+
139
+ ***
140
+
141
+ ### stop() {#stop}
142
+
143
+ > **stop**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
144
+
145
+ The component needs to be stopped when the node is closed.
146
+
147
+ #### Parameters
148
+
149
+ ##### nodeLoggingComponentType?
150
+
151
+ `string`
152
+
153
+ The node logging component type.
154
+
155
+ #### Returns
156
+
157
+ `Promise`\<`void`\>
158
+
159
+ Nothing.
160
+
161
+ #### Implementation of
162
+
163
+ `IAuthenticationRateComponent.stop`
164
+
165
+ ***
166
+
167
+ ### check() {#check}
168
+
169
+ > **check**(`action`, `identifier`): `Promise`\<`string`\>
170
+
171
+ Check the authentication rate for a given action and identifier.
172
+
173
+ #### Parameters
174
+
175
+ ##### action
176
+
177
+ `string`
178
+
179
+ The action to be checked.
180
+
181
+ ##### identifier
182
+
183
+ `string`
184
+
185
+ The identifier to be checked.
186
+
187
+ #### Returns
188
+
189
+ `Promise`\<`string`\>
190
+
191
+ The rate entry id.
192
+
193
+ #### Implementation of
194
+
195
+ `IAuthenticationRateComponent.check`
196
+
197
+ ***
198
+
199
+ ### clear() {#clear}
200
+
201
+ > **clear**(`action`, `identifier`): `Promise`\<`void`\>
202
+
203
+ Clear the authentication rate entry for the given action and identifier.
204
+
205
+ #### Parameters
206
+
207
+ ##### action
208
+
209
+ `string`
210
+
211
+ The action to clear.
212
+
213
+ ##### identifier
214
+
215
+ `string`
216
+
217
+ The identifier to clear.
218
+
219
+ #### Returns
220
+
221
+ `Promise`\<`void`\>
222
+
223
+ Nothing.
224
+
225
+ #### Implementation of
226
+
227
+ `IAuthenticationRateComponent.clear`
@@ -80,6 +80,32 @@ Nothing.
80
80
 
81
81
  ***
82
82
 
83
+ ### stop() {#stop}
84
+
85
+ > **stop**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
86
+
87
+ The component needs to be stopped when the node is closed.
88
+
89
+ #### Parameters
90
+
91
+ ##### nodeLoggingComponentType?
92
+
93
+ `string`
94
+
95
+ The node logging component type.
96
+
97
+ #### Returns
98
+
99
+ `Promise`\<`void`\>
100
+
101
+ Nothing.
102
+
103
+ #### Implementation of
104
+
105
+ `IAuthenticationComponent.stop`
106
+
107
+ ***
108
+
83
109
  ### login() {#login}
84
110
 
85
111
  > **login**(`email`, `password`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
@@ -82,7 +82,7 @@ The new token and its expiry date.
82
82
 
83
83
  ### verify() {#verify}
84
84
 
85
- > `static` **verify**(`vaultConnector`, `signingKeyName`, `token`, `requiredScopes?`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
85
+ > `static` **verify**(`vaultConnector`, `signingKeyName`, `token`, `requiredScopes?`, `verifyUser?`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
86
86
 
87
87
  Verify the token.
88
88
 
@@ -112,6 +112,12 @@ The token to verify.
112
112
 
113
113
  The required scopes.
114
114
 
115
+ ##### verifyUser?
116
+
117
+ (`userIdentity`, `organizationIdentity`) => `Promise`\<`string`[]\>
118
+
119
+ A function to verify the user identity and organization, which can be used to check if the user is still active or not.
120
+
115
121
  #### Returns
116
122
 
117
123
  `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
@@ -0,0 +1,31 @@
1
+ # Function: authenticationAuditCreate()
2
+
3
+ > **authenticationAuditCreate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`ICreatedResponse`\>
4
+
5
+ Create an authentication audit entry.
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
+ `IAuditCreateRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`ICreatedResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,31 @@
1
+ # Function: authenticationAuditQuery()
2
+
3
+ > **authenticationAuditQuery**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditQueryResponse`\>
4
+
5
+ Query authentication audit entries.
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
+ `IAuditQueryRequest`
24
+
25
+ The request.
26
+
27
+ ## Returns
28
+
29
+ `Promise`\<`IAuditQueryResponse`\>
30
+
31
+ The response object with additional http response properties.
@@ -0,0 +1,25 @@
1
+ # Function: generateRestRoutesAuthenticationAudit()
2
+
3
+ > **generateRestRoutesAuthenticationAudit**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
4
+
5
+ The REST routes for authentication audit.
6
+
7
+ ## Parameters
8
+
9
+ ### baseRouteName
10
+
11
+ `string`
12
+
13
+ Prefix to prepend to the paths.
14
+
15
+ ### componentName
16
+
17
+ `string`
18
+
19
+ The name of the component to use in the routes stored in the ComponentFactory.
20
+
21
+ ## Returns
22
+
23
+ `IRestRoute`\<`any`, `any`\>[]
24
+
25
+ The generated routes.
@@ -2,9 +2,13 @@
2
2
 
3
3
  ## Classes
4
4
 
5
+ - [AuthenticationAuditEntry](classes/AuthenticationAuditEntry.md)
6
+ - [AuthenticationRateEntry](classes/AuthenticationRateEntry.md)
5
7
  - [AuthenticationUser](classes/AuthenticationUser.md)
6
8
  - [AuthHeaderProcessor](classes/AuthHeaderProcessor.md)
7
9
  - [EntityStorageAuthenticationAdminService](classes/EntityStorageAuthenticationAdminService.md)
10
+ - [EntityStorageAuthenticationAuditService](classes/EntityStorageAuthenticationAuditService.md)
11
+ - [EntityStorageAuthenticationRateService](classes/EntityStorageAuthenticationRateService.md)
8
12
  - [EntityStorageAuthenticationService](classes/EntityStorageAuthenticationService.md)
9
13
  - [TokenHelper](classes/TokenHelper.md)
10
14
 
@@ -14,6 +18,10 @@
14
18
  - [IAuthHeaderProcessorConstructorOptions](interfaces/IAuthHeaderProcessorConstructorOptions.md)
15
19
  - [IEntityStorageAuthenticationAdminServiceConfig](interfaces/IEntityStorageAuthenticationAdminServiceConfig.md)
16
20
  - [IEntityStorageAuthenticationAdminServiceConstructorOptions](interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md)
21
+ - [IEntityStorageAuthenticationAuditServiceConfig](interfaces/IEntityStorageAuthenticationAuditServiceConfig.md)
22
+ - [IEntityStorageAuthenticationAuditServiceConstructorOptions](interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md)
23
+ - [IEntityStorageAuthenticationRateServiceConfig](interfaces/IEntityStorageAuthenticationRateServiceConfig.md)
24
+ - [IEntityStorageAuthenticationRateServiceConstructorOptions](interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md)
17
25
  - [IEntityStorageAuthenticationServiceConfig](interfaces/IEntityStorageAuthenticationServiceConfig.md)
18
26
  - [IEntityStorageAuthenticationServiceConstructorOptions](interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md)
19
27
 
@@ -21,6 +29,7 @@
21
29
 
22
30
  - [restEntryPoints](variables/restEntryPoints.md)
23
31
  - [tagsAuthenticationAdmin](variables/tagsAuthenticationAdmin.md)
32
+ - [tagsAuthenticationAudit](variables/tagsAuthenticationAudit.md)
24
33
  - [tagsAuthentication](variables/tagsAuthentication.md)
25
34
 
26
35
  ## Functions
@@ -32,6 +41,9 @@
32
41
  - [authenticationAdminGetUser](functions/authenticationAdminGetUser.md)
33
42
  - [authenticationAdminGetUserByIdentity](functions/authenticationAdminGetUserByIdentity.md)
34
43
  - [authenticationAdminRemoveUser](functions/authenticationAdminRemoveUser.md)
44
+ - [generateRestRoutesAuthenticationAudit](functions/generateRestRoutesAuthenticationAudit.md)
45
+ - [authenticationAuditCreate](functions/authenticationAuditCreate.md)
46
+ - [authenticationAuditQuery](functions/authenticationAuditQuery.md)
35
47
  - [generateRestRoutesAuthentication](functions/generateRestRoutesAuthentication.md)
36
48
  - [authenticationLogin](functions/authenticationLogin.md)
37
49
  - [authenticationLogout](functions/authenticationLogout.md)
@@ -4,6 +4,20 @@ Options for the AuthHeaderProcessor constructor.
4
4
 
5
5
  ## Properties
6
6
 
7
+ ### authenticationAdminServiceType? {#authenticationadminservicetype}
8
+
9
+ > `optional` **authenticationAdminServiceType?**: `string`
10
+
11
+ The admin service.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ authentication-admin
17
+ ```
18
+
19
+ ***
20
+
7
21
  ### vaultConnectorType? {#vaultconnectortype}
8
22
 
9
23
  > `optional` **vaultConnectorType?**: `string`
@@ -18,6 +18,20 @@ authentication-user
18
18
 
19
19
  ***
20
20
 
21
+ ### authenticationAuditServiceType? {#authenticationauditservicetype}
22
+
23
+ > `optional` **authenticationAuditServiceType?**: `string`
24
+
25
+ The audit service.
26
+
27
+ #### Default
28
+
29
+ ```ts
30
+ authentication-audit
31
+ ```
32
+
33
+ ***
34
+
21
35
  ### config? {#config}
22
36
 
23
37
  > `optional` **config?**: [`IEntityStorageAuthenticationAdminServiceConfig`](IEntityStorageAuthenticationAdminServiceConfig.md)
@@ -0,0 +1,11 @@
1
+ # Interface: IEntityStorageAuthenticationAuditServiceConfig
2
+
3
+ Config for the EntityStorageAuthenticationAuditService constructor.
4
+
5
+ ## Properties
6
+
7
+ ### ipHashSalt? {#iphashsalt}
8
+
9
+ > `optional` **ipHashSalt?**: `string`
10
+
11
+ The server-side salt for hashing IP addresses in audit logs, if configured.
@@ -0,0 +1,25 @@
1
+ # Interface: IEntityStorageAuthenticationAuditServiceConstructorOptions
2
+
3
+ Options for the EntityStorageAuthenticationAuditService constructor.
4
+
5
+ ## Properties
6
+
7
+ ### authenticationAuditEntryStorageType? {#authenticationauditentrystoragetype}
8
+
9
+ > `optional` **authenticationAuditEntryStorageType?**: `string`
10
+
11
+ The entity storage for the audit entries.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ authentication-audit-entry
17
+ ```
18
+
19
+ ***
20
+
21
+ ### config? {#config}
22
+
23
+ > `optional` **config?**: [`IEntityStorageAuthenticationAuditServiceConfig`](IEntityStorageAuthenticationAuditServiceConfig.md)
24
+
25
+ The configuration for the authentication audit service.
@@ -0,0 +1,17 @@
1
+ # Interface: IEntityStorageAuthenticationRateServiceConfig
2
+
3
+ Configuration for the entity storage authentication rate service.
4
+
5
+ ## Properties
6
+
7
+ ### cleanupIntervalMinutes? {#cleanupintervalminutes}
8
+
9
+ > `optional` **cleanupIntervalMinutes?**: `number`
10
+
11
+ Interval between cleanup runs in minutes.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ 5
17
+ ```
@@ -0,0 +1,39 @@
1
+ # Interface: IEntityStorageAuthenticationRateServiceConstructorOptions
2
+
3
+ Options for the EntityStorageAuthenticationRateService constructor.
4
+
5
+ ## Properties
6
+
7
+ ### authenticationRateEntryStorageType? {#authenticationrateentrystoragetype}
8
+
9
+ > `optional` **authenticationRateEntryStorageType?**: `string`
10
+
11
+ The entity storage for authentication rate entries.
12
+
13
+ #### Default
14
+
15
+ ```ts
16
+ authentication-rate-entry
17
+ ```
18
+
19
+ ***
20
+
21
+ ### taskSchedulerComponentType? {#taskschedulercomponenttype}
22
+
23
+ > `optional` **taskSchedulerComponentType?**: `string`
24
+
25
+ The task scheduler component type.
26
+
27
+ #### Default
28
+
29
+ ```ts
30
+ task-scheduler
31
+ ```
32
+
33
+ ***
34
+
35
+ ### config? {#config}
36
+
37
+ > `optional` **config?**: [`IEntityStorageAuthenticationRateServiceConfig`](IEntityStorageAuthenticationRateServiceConfig.md)
38
+
39
+ The configuration for the authentication rate service.
@@ -27,5 +27,47 @@ The default time to live for the JWT.
27
27
  #### Default
28
28
 
29
29
  ```ts
30
- 1440
30
+ 60
31
+ ```
32
+
33
+ ***
34
+
35
+ ### loginRateLimit? {#loginratelimit}
36
+
37
+ > `optional` **loginRateLimit?**: `IAuthenticationRateActionConfig`
38
+
39
+ Optional override for login failure rate limit.
40
+
41
+ #### Default
42
+
43
+ ```ts
44
+ { maxAttempts: 5, windowMinutes: 15 }
45
+ ```
46
+
47
+ ***
48
+
49
+ ### passwordChangeRateLimit? {#passwordchangeratelimit}
50
+
51
+ > `optional` **passwordChangeRateLimit?**: `IAuthenticationRateActionConfig`
52
+
53
+ Optional override for password change rate limit.
54
+
55
+ #### Default
56
+
57
+ ```ts
58
+ { maxAttempts: 5, windowMinutes: 15 }
59
+ ```
60
+
61
+ ***
62
+
63
+ ### tokenRefreshRateLimit? {#tokenrefreshratelimit}
64
+
65
+ > `optional` **tokenRefreshRateLimit?**: `IAuthenticationRateActionConfig`
66
+
67
+ Optional override for token refresh rate limit.
68
+
69
+ #### Default
70
+
71
+ ```ts
72
+ { maxAttempts: 30, windowMinutes: 60 }
31
73
  ```
@@ -46,6 +46,34 @@ authentication-admin
46
46
 
47
47
  ***
48
48
 
49
+ ### authenticationAuditServiceType? {#authenticationauditservicetype}
50
+
51
+ > `optional` **authenticationAuditServiceType?**: `string`
52
+
53
+ The audit service.
54
+
55
+ #### Default
56
+
57
+ ```ts
58
+ authentication-audit
59
+ ```
60
+
61
+ ***
62
+
63
+ ### authenticationRateServiceType? {#authenticationrateservicetype}
64
+
65
+ > `optional` **authenticationRateServiceType?**: `string`
66
+
67
+ The rate service.
68
+
69
+ #### Default
70
+
71
+ ```ts
72
+ authentication-rate
73
+ ```
74
+
75
+ ***
76
+
49
77
  ### config? {#config}
50
78
 
51
79
  > `optional` **config?**: [`IEntityStorageAuthenticationServiceConfig`](IEntityStorageAuthenticationServiceConfig.md)
@@ -0,0 +1,5 @@
1
+ # Variable: tagsAuthenticationAudit
2
+
3
+ > `const` **tagsAuthenticationAudit**: `ITag`[]
4
+
5
+ The tag to associate with the routes.
package/locales/en.json CHANGED
@@ -15,15 +15,24 @@
15
15
  "userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\"",
16
16
  "currentPasswordMismatch": "The current password is incorrect"
17
17
  },
18
+ "entityStorageAuthenticationRateService": {
19
+ "actionConfigMissing": "No rate-limit configuration exists for action \"{action}\".",
20
+ "rateLimitExceeded": "The rate limit for action \"{action}\" has been exceeded. Retry after {retryAfterSeconds} seconds."
21
+ },
18
22
  "tokenHelper": {
19
23
  "missing": "The JSON Web token could not be found in the authorization header",
20
24
  "payloadMissingSubject": "The JSON Web token payload does not contain a subject",
21
25
  "payloadMissingOrganization": "The JSON Web token payload does not contain an organization",
22
26
  "expired": "The JSON Web token has expired",
23
- "insufficientScopes": "The JSON Web token does not have the required scopes to access this resource"
27
+ "insufficientScopes": "The JSON Web token does not have the required scopes to access this resource",
28
+ "userNotVerified": "The user associated with the JSON Web token could not be verified",
29
+ "organizationNotVerified": "The organization associated with the JSON Web token could not be verified"
24
30
  },
25
31
  "authHeaderProcessor": {
26
32
  "tenantIdMismatch": "The tenant ID in the token does not match the tenant ID in the context"
33
+ },
34
+ "validation": {
35
+ "saltEntropyTooLow": "Salt must have at least 8 unique characters for sufficient entropy."
27
36
  }
28
37
  }
29
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/api-auth-entity-storage-service",
3
- "version": "0.0.3-next.22",
3
+ "version": "0.0.3-next.23",
4
4
  "description": "Authentication service implementation and REST routes backed by entity storage.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,9 +14,10 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/api-auth-entity-storage-models": "0.0.3-next.22",
18
- "@twin.org/api-core": "0.0.3-next.22",
19
- "@twin.org/api-models": "0.0.3-next.22",
17
+ "@twin.org/api-auth-entity-storage-models": "0.0.3-next.23",
18
+ "@twin.org/api-core": "0.0.3-next.23",
19
+ "@twin.org/api-models": "0.0.3-next.23",
20
+ "@twin.org/background-task-models": "next",
20
21
  "@twin.org/context": "next",
21
22
  "@twin.org/core": "next",
22
23
  "@twin.org/crypto": "next",