@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.
Files changed (108) hide show
  1. package/README.md +1 -1
  2. package/dist/es/entities/authenticationUser.js +1 -9
  3. package/dist/es/entities/authenticationUser.js.map +1 -1
  4. package/dist/es/entities/authenticationUserV0.js +69 -0
  5. package/dist/es/entities/authenticationUserV0.js.map +1 -0
  6. package/dist/es/index.js +1 -9
  7. package/dist/es/index.js.map +1 -1
  8. package/dist/es/models/IAuthHeaderProcessorConfig.js.map +1 -1
  9. package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -1
  10. package/dist/es/models/IAuthTokenContext.js.map +1 -1
  11. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js.map +1 -1
  12. package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js.map +1 -1
  13. package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -1
  14. package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -1
  15. package/dist/es/processors/authHeaderProcessor.js +9 -14
  16. package/dist/es/processors/authHeaderProcessor.js.map +1 -1
  17. package/dist/es/restEntryPoints.js +1 -8
  18. package/dist/es/restEntryPoints.js.map +1 -1
  19. package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js +22 -14
  20. package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js.map +1 -1
  21. package/dist/es/routes/entityStorageAuthenticationRoutes.js +45 -1
  22. package/dist/es/routes/entityStorageAuthenticationRoutes.js.map +1 -1
  23. package/dist/es/schema.js +2 -4
  24. package/dist/es/schema.js.map +1 -1
  25. package/dist/es/services/entityStorageAuthenticationAdminService.js +69 -68
  26. package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -1
  27. package/dist/es/services/entityStorageAuthenticationService.js +29 -17
  28. package/dist/es/services/entityStorageAuthenticationService.js.map +1 -1
  29. package/dist/es/utils/passwordHelper.js +7 -5
  30. package/dist/es/utils/passwordHelper.js.map +1 -1
  31. package/dist/es/utils/tokenHelper.js +2 -23
  32. package/dist/es/utils/tokenHelper.js.map +1 -1
  33. package/dist/types/entities/authenticationUser.d.ts +0 -4
  34. package/dist/types/entities/authenticationUserV0.d.ts +33 -0
  35. package/dist/types/index.d.ts +1 -9
  36. package/dist/types/models/IAuthHeaderProcessorConfig.d.ts +1 -2
  37. package/dist/types/models/IAuthTokenContext.d.ts +0 -4
  38. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +14 -3
  39. package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +6 -1
  40. package/dist/types/models/IEntityStorageAuthenticationServiceConfig.d.ts +7 -2
  41. package/dist/types/restEntryPoints.d.ts +1 -1
  42. package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +10 -2
  43. package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +6 -2
  44. package/dist/types/services/entityStorageAuthenticationService.d.ts +6 -1
  45. package/dist/types/utils/passwordHelper.d.ts +6 -3
  46. package/dist/types/utils/tokenHelper.d.ts +2 -11
  47. package/docs/changelog.md +19 -0
  48. package/docs/examples.md +9 -93
  49. package/docs/open-api/spec.json +178 -956
  50. package/docs/reference/classes/AuthHeaderProcessor.md +4 -0
  51. package/docs/reference/classes/AuthenticationUser.md +0 -8
  52. package/docs/reference/classes/AuthenticationUserV0.md +69 -0
  53. package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +11 -3
  54. package/docs/reference/classes/EntityStorageAuthenticationService.md +18 -0
  55. package/docs/reference/classes/PasswordHelper.md +4 -4
  56. package/docs/reference/classes/TokenHelper.md +2 -44
  57. package/docs/reference/functions/authenticationPasswordPolicy.md +31 -0
  58. package/docs/reference/index.md +2 -15
  59. package/docs/reference/interfaces/IAuthHeaderProcessorConfig.md +1 -2
  60. package/docs/reference/interfaces/IAuthTokenContext.md +0 -8
  61. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +38 -4
  62. package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +15 -1
  63. package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +15 -1
  64. package/docs/reference/variables/restEntryPoints.md +1 -1
  65. package/locales/en.json +1 -16
  66. package/package.json +7 -8
  67. package/dist/es/entities/authenticationAuditEntry.js +0 -121
  68. package/dist/es/entities/authenticationAuditEntry.js.map +0 -1
  69. package/dist/es/entities/authenticationRateEntry.js +0 -37
  70. package/dist/es/entities/authenticationRateEntry.js.map +0 -1
  71. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js +0 -4
  72. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js.map +0 -1
  73. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js +0 -2
  74. package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js.map +0 -1
  75. package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js +0 -2
  76. package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js.map +0 -1
  77. package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js +0 -2
  78. package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js.map +0 -1
  79. package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +0 -343
  80. package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +0 -1
  81. package/dist/es/services/entityStorageAuthenticationAuditService.js +0 -240
  82. package/dist/es/services/entityStorageAuthenticationAuditService.js.map +0 -1
  83. package/dist/es/services/entityStorageAuthenticationRateService.js +0 -213
  84. package/dist/es/services/entityStorageAuthenticationRateService.js.map +0 -1
  85. package/dist/types/entities/authenticationAuditEntry.d.ts +0 -49
  86. package/dist/types/entities/authenticationRateEntry.d.ts +0 -17
  87. package/dist/types/models/IEntityStorageAuthenticationAuditServiceConfig.d.ts +0 -9
  88. package/dist/types/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.d.ts +0 -15
  89. package/dist/types/models/IEntityStorageAuthenticationRateServiceConfig.d.ts +0 -10
  90. package/dist/types/models/IEntityStorageAuthenticationRateServiceConstructorOptions.d.ts +0 -25
  91. package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +0 -54
  92. package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +0 -72
  93. package/dist/types/services/entityStorageAuthenticationRateService.d.ts +0 -60
  94. package/docs/reference/classes/AuthenticationAuditEntry.md +0 -101
  95. package/docs/reference/classes/AuthenticationRateEntry.md +0 -37
  96. package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +0 -241
  97. package/docs/reference/classes/EntityStorageAuthenticationRateService.md +0 -227
  98. package/docs/reference/functions/authenticationAuditCreate.md +0 -37
  99. package/docs/reference/functions/authenticationAuditGet.md +0 -31
  100. package/docs/reference/functions/authenticationAuditQuery.md +0 -31
  101. package/docs/reference/functions/authenticationAuditRemove.md +0 -31
  102. package/docs/reference/functions/authenticationAuditUpdate.md +0 -31
  103. package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +0 -25
  104. package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConfig.md +0 -11
  105. package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md +0 -25
  106. package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConfig.md +0 -17
  107. package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md +0 -53
  108. package/docs/reference/variables/tagsAuthenticationAudit.md +0 -5
@@ -1,227 +0,0 @@
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
- A promise that resolves when the action configuration has been stored.
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
- A promise that resolves when the action configuration has been removed.
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
- A promise that resolves when the periodic cleanup task has been registered.
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
- A promise that resolves when the periodic cleanup task has been removed.
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
- A promise that resolves when the rate entry has been removed.
224
-
225
- #### Implementation of
226
-
227
- `IAuthenticationRateComponent.clear`
@@ -1,37 +0,0 @@
1
- # Function: authenticationAuditCreate()
2
-
3
- > **authenticationAuditCreate**(`httpRequestContext`, `componentName`, `request`, `baseRouteName`): `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
- ### baseRouteName
28
-
29
- `string`
30
-
31
- The base route name to use for the location header.
32
-
33
- ## Returns
34
-
35
- `Promise`\<`ICreatedResponse`\>
36
-
37
- The response object with additional http response properties.
@@ -1,31 +0,0 @@
1
- # Function: authenticationAuditGet()
2
-
3
- > **authenticationAuditGet**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAuditGetResponse`\>
4
-
5
- Get 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
- `IAuditGetRequest`
24
-
25
- The request.
26
-
27
- ## Returns
28
-
29
- `Promise`\<`IAuditGetResponse`\>
30
-
31
- The response object with additional http response properties.
@@ -1,31 +0,0 @@
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.
@@ -1,31 +0,0 @@
1
- # Function: authenticationAuditRemove()
2
-
3
- > **authenticationAuditRemove**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
-
5
- Remove 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
- `IAuditRemoveRequest`
24
-
25
- The request.
26
-
27
- ## Returns
28
-
29
- `Promise`\<`INoContentResponse`\>
30
-
31
- The response object with additional http response properties.
@@ -1,31 +0,0 @@
1
- # Function: authenticationAuditUpdate()
2
-
3
- > **authenticationAuditUpdate**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
4
-
5
- Update 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
- `IAuditUpdateRequest`
24
-
25
- The request.
26
-
27
- ## Returns
28
-
29
- `Promise`\<`INoContentResponse`\>
30
-
31
- The response object with additional http response properties.
@@ -1,25 +0,0 @@
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.
@@ -1,11 +0,0 @@
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.
@@ -1,25 +0,0 @@
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.
@@ -1,17 +0,0 @@
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
- ```
@@ -1,53 +0,0 @@
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
- ### platformComponentType? {#platformcomponenttype}
36
-
37
- > `optional` **platformComponentType?**: `string`
38
-
39
- The platform component type, used to run the periodic cleanup per tenant.
40
-
41
- #### Default
42
-
43
- ```ts
44
- platform
45
- ```
46
-
47
- ***
48
-
49
- ### config? {#config}
50
-
51
- > `optional` **config?**: [`IEntityStorageAuthenticationRateServiceConfig`](IEntityStorageAuthenticationRateServiceConfig.md)
52
-
53
- The configuration for the authentication rate service.
@@ -1,5 +0,0 @@
1
- # Variable: tagsAuthenticationAudit
2
-
3
- > `const` **tagsAuthenticationAudit**: `ITag`[]
4
-
5
- The tag to associate with the routes.