@3sixty/api-auth-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/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/entities/authenticationAuditEntry.js +121 -0
- package/dist/es/entities/authenticationAuditEntry.js.map +1 -0
- package/dist/es/entities/authenticationRateEntry.js +37 -0
- package/dist/es/entities/authenticationRateEntry.js.map +1 -0
- package/dist/es/index.js +17 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js +4 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationRateServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/ITenantOverrideProcessorConfig.js +4 -0
- package/dist/es/models/ITenantOverrideProcessorConfig.js.map +1 -0
- package/dist/es/models/ITenantOverrideProcessorConstructorOptions.js +2 -0
- package/dist/es/models/ITenantOverrideProcessorConstructorOptions.js.map +1 -0
- package/dist/es/processors/tenantOverrideProcessor.js +144 -0
- package/dist/es/processors/tenantOverrideProcessor.js.map +1 -0
- package/dist/es/restEntryPoints.js +13 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +355 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +1 -0
- package/dist/es/schema.js +13 -0
- package/dist/es/schema.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationAuditService.js +240 -0
- package/dist/es/services/entityStorageAuthenticationAuditService.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationRateService.js +213 -0
- package/dist/es/services/entityStorageAuthenticationRateService.js.map +1 -0
- package/dist/types/entities/authenticationAuditEntry.d.ts +49 -0
- package/dist/types/entities/authenticationRateEntry.d.ts +17 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/models/IEntityStorageAuthenticationAuditServiceConfig.d.ts +9 -0
- package/dist/types/models/IEntityStorageAuthenticationAuditServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/IEntityStorageAuthenticationRateServiceConfig.d.ts +10 -0
- package/dist/types/models/IEntityStorageAuthenticationRateServiceConstructorOptions.d.ts +25 -0
- package/dist/types/models/ITenantOverrideProcessorConfig.d.ts +19 -0
- package/dist/types/models/ITenantOverrideProcessorConstructorOptions.d.ts +20 -0
- package/dist/types/processors/tenantOverrideProcessor.d.ts +48 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +54 -0
- package/dist/types/schema.d.ts +4 -0
- package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +72 -0
- package/dist/types/services/entityStorageAuthenticationRateService.d.ts +60 -0
- package/docs/changelog.md +1633 -0
- package/docs/examples.md +137 -0
- package/docs/open-api/spec.json +911 -0
- package/docs/reference/classes/AuthenticationAuditEntry.md +101 -0
- package/docs/reference/classes/AuthenticationRateEntry.md +37 -0
- package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +241 -0
- package/docs/reference/classes/EntityStorageAuthenticationRateService.md +227 -0
- package/docs/reference/classes/TenantOverrideProcessor.md +129 -0
- package/docs/reference/functions/authenticationAuditCreate.md +37 -0
- package/docs/reference/functions/authenticationAuditGet.md +31 -0
- package/docs/reference/functions/authenticationAuditQuery.md +31 -0
- package/docs/reference/functions/authenticationAuditRemove.md +31 -0
- package/docs/reference/functions/authenticationAuditUpdate.md +31 -0
- package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +25 -0
- package/docs/reference/functions/initSchema.md +9 -0
- package/docs/reference/index.md +33 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConfig.md +11 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConfig.md +17 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationRateServiceConstructorOptions.md +53 -0
- package/docs/reference/interfaces/ITenantOverrideProcessorConfig.md +39 -0
- package/docs/reference/interfaces/ITenantOverrideProcessorConstructorOptions.md +39 -0
- package/docs/reference/variables/restEntryPoints.md +5 -0
- package/docs/reference/variables/tagsAuthenticationAudit.md +5 -0
- package/locales/en.json +22 -0
- package/package.json +63 -6
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Class: AuthenticationAuditEntry
|
|
2
|
+
|
|
3
|
+
Class defining the storage for authentication audit entries.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new AuthenticationAuditEntry**(): `AuthenticationAuditEntry`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`AuthenticationAuditEntry`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### id {#id}
|
|
18
|
+
|
|
19
|
+
> **id**: `string`
|
|
20
|
+
|
|
21
|
+
The unique identifier for the audit entry.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### dateCreated {#datecreated}
|
|
26
|
+
|
|
27
|
+
> **dateCreated**: `string`
|
|
28
|
+
|
|
29
|
+
The timestamp of the audit entry in ISO 8601 format.
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### event {#event}
|
|
34
|
+
|
|
35
|
+
> **event**: `string`
|
|
36
|
+
|
|
37
|
+
The audit event that occurred.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### actorId? {#actorid}
|
|
42
|
+
|
|
43
|
+
> `optional` **actorId?**: `string`
|
|
44
|
+
|
|
45
|
+
The actor identifier, could be e-mail, username, or other unique identifier.
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### nodeId? {#nodeid}
|
|
50
|
+
|
|
51
|
+
> `optional` **nodeId?**: `string`
|
|
52
|
+
|
|
53
|
+
The node identifier associated with the audit entry, if applicable.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### organizationId? {#organizationid}
|
|
58
|
+
|
|
59
|
+
> `optional` **organizationId?**: `string`
|
|
60
|
+
|
|
61
|
+
The organization identifier associated with the audit entry, if applicable.
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### tenantId? {#tenantid}
|
|
66
|
+
|
|
67
|
+
> `optional` **tenantId?**: `string`
|
|
68
|
+
|
|
69
|
+
The tenant identifier associated with the audit entry, if applicable.
|
|
70
|
+
|
|
71
|
+
***
|
|
72
|
+
|
|
73
|
+
### ipAddressHashes? {#ipaddresshashes}
|
|
74
|
+
|
|
75
|
+
> `optional` **ipAddressHashes?**: `string`[]
|
|
76
|
+
|
|
77
|
+
The hashed IP addresses of the client.
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### userAgent? {#useragent}
|
|
82
|
+
|
|
83
|
+
> `optional` **userAgent?**: `string`
|
|
84
|
+
|
|
85
|
+
The user agent string of the client.
|
|
86
|
+
|
|
87
|
+
***
|
|
88
|
+
|
|
89
|
+
### correlationId? {#correlationid}
|
|
90
|
+
|
|
91
|
+
> `optional` **correlationId?**: `string`
|
|
92
|
+
|
|
93
|
+
The correlation ID for request tracing.
|
|
94
|
+
|
|
95
|
+
***
|
|
96
|
+
|
|
97
|
+
### data? {#data}
|
|
98
|
+
|
|
99
|
+
> `optional` **data?**: `unknown`
|
|
100
|
+
|
|
101
|
+
Additional data related to the audit entry, such as IP address, user agent, etc.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Class: AuthenticationRateEntry
|
|
2
|
+
|
|
3
|
+
Class defining the storage for authentication rate entries.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new AuthenticationRateEntry**(): `AuthenticationRateEntry`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`AuthenticationRateEntry`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### id {#id}
|
|
18
|
+
|
|
19
|
+
> **id**: `string`
|
|
20
|
+
|
|
21
|
+
The id for the rate entry.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### timestamps {#timestamps}
|
|
26
|
+
|
|
27
|
+
> **timestamps**: `string`[]
|
|
28
|
+
|
|
29
|
+
Array of ISO date strings representing timestamps of failed attempts.
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### dateModified {#datemodified}
|
|
34
|
+
|
|
35
|
+
> **dateModified**: `string`
|
|
36
|
+
|
|
37
|
+
Last modification time in ISO date format.
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Class: EntityStorageAuthenticationAuditService
|
|
2
|
+
|
|
3
|
+
Implementation of the authentication audit component using entity storage.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IAuthenticationAuditComponent`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new EntityStorageAuthenticationAuditService**(`options?`): `EntityStorageAuthenticationAuditService`
|
|
14
|
+
|
|
15
|
+
Create a new instance of EntityStorageAuthenticationAuditService.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`IEntityStorageAuthenticationAuditServiceConstructorOptions`](../interfaces/IEntityStorageAuthenticationAuditServiceConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
The dependencies for the identity connector.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`EntityStorageAuthenticationAuditService`
|
|
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
|
+
### className() {#classname}
|
|
40
|
+
|
|
41
|
+
> **className**(): `string`
|
|
42
|
+
|
|
43
|
+
Returns the class name of the component.
|
|
44
|
+
|
|
45
|
+
#### Returns
|
|
46
|
+
|
|
47
|
+
`string`
|
|
48
|
+
|
|
49
|
+
The class name of the component.
|
|
50
|
+
|
|
51
|
+
#### Implementation of
|
|
52
|
+
|
|
53
|
+
`IAuthenticationAuditComponent.className`
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### create() {#create}
|
|
58
|
+
|
|
59
|
+
> **create**(`entry`): `Promise`\<`string`\>
|
|
60
|
+
|
|
61
|
+
Create a new audit entry.
|
|
62
|
+
|
|
63
|
+
#### Parameters
|
|
64
|
+
|
|
65
|
+
##### entry
|
|
66
|
+
|
|
67
|
+
`Omit`\<`IAuthenticationAuditEntry`, `"id"` \| `"dateCreated"`\>
|
|
68
|
+
|
|
69
|
+
The audit entry to be logged.
|
|
70
|
+
|
|
71
|
+
#### Returns
|
|
72
|
+
|
|
73
|
+
`Promise`\<`string`\>
|
|
74
|
+
|
|
75
|
+
The unique identifier of the created audit entry.
|
|
76
|
+
|
|
77
|
+
#### Implementation of
|
|
78
|
+
|
|
79
|
+
`IAuthenticationAuditComponent.create`
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### get() {#get}
|
|
84
|
+
|
|
85
|
+
> **get**(`id`): `Promise`\<`IAuthenticationAuditEntry`\>
|
|
86
|
+
|
|
87
|
+
Get an audit entry by id.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
##### id
|
|
92
|
+
|
|
93
|
+
`string`
|
|
94
|
+
|
|
95
|
+
The unique identifier of the audit entry.
|
|
96
|
+
|
|
97
|
+
#### Returns
|
|
98
|
+
|
|
99
|
+
`Promise`\<`IAuthenticationAuditEntry`\>
|
|
100
|
+
|
|
101
|
+
The audit entry.
|
|
102
|
+
|
|
103
|
+
#### Implementation of
|
|
104
|
+
|
|
105
|
+
`IAuthenticationAuditComponent.get`
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### update() {#update}
|
|
110
|
+
|
|
111
|
+
> **update**(`id`, `entry`): `Promise`\<`void`\>
|
|
112
|
+
|
|
113
|
+
Update an audit entry.
|
|
114
|
+
|
|
115
|
+
#### Parameters
|
|
116
|
+
|
|
117
|
+
##### id
|
|
118
|
+
|
|
119
|
+
`string`
|
|
120
|
+
|
|
121
|
+
The unique identifier of the audit entry to update.
|
|
122
|
+
|
|
123
|
+
##### entry
|
|
124
|
+
|
|
125
|
+
`Partial`\<`Omit`\<`IAuthenticationAuditEntry`, `"id"` \| `"dateCreated"`\>\>
|
|
126
|
+
|
|
127
|
+
The fields to update on the audit entry.
|
|
128
|
+
|
|
129
|
+
#### Returns
|
|
130
|
+
|
|
131
|
+
`Promise`\<`void`\>
|
|
132
|
+
|
|
133
|
+
A promise that resolves when the audit entry has been updated.
|
|
134
|
+
|
|
135
|
+
#### Implementation of
|
|
136
|
+
|
|
137
|
+
`IAuthenticationAuditComponent.update`
|
|
138
|
+
|
|
139
|
+
***
|
|
140
|
+
|
|
141
|
+
### remove() {#remove}
|
|
142
|
+
|
|
143
|
+
> **remove**(`id`): `Promise`\<`void`\>
|
|
144
|
+
|
|
145
|
+
Remove an audit entry.
|
|
146
|
+
|
|
147
|
+
#### Parameters
|
|
148
|
+
|
|
149
|
+
##### id
|
|
150
|
+
|
|
151
|
+
`string`
|
|
152
|
+
|
|
153
|
+
The unique identifier of the audit entry to remove.
|
|
154
|
+
|
|
155
|
+
#### Returns
|
|
156
|
+
|
|
157
|
+
`Promise`\<`void`\>
|
|
158
|
+
|
|
159
|
+
A promise that resolves when the audit entry has been removed.
|
|
160
|
+
|
|
161
|
+
#### Implementation of
|
|
162
|
+
|
|
163
|
+
`IAuthenticationAuditComponent.remove`
|
|
164
|
+
|
|
165
|
+
***
|
|
166
|
+
|
|
167
|
+
### query() {#query}
|
|
168
|
+
|
|
169
|
+
> **query**(`options?`, `cursor?`, `limit?`): `Promise`\<\{ `entries`: `IAuthenticationAuditEntry`[]; `cursor?`: `string`; \}\>
|
|
170
|
+
|
|
171
|
+
Query the audit entries.
|
|
172
|
+
|
|
173
|
+
#### Parameters
|
|
174
|
+
|
|
175
|
+
##### options?
|
|
176
|
+
|
|
177
|
+
The query options.
|
|
178
|
+
|
|
179
|
+
###### actorId?
|
|
180
|
+
|
|
181
|
+
`string`
|
|
182
|
+
|
|
183
|
+
The actor identifier to filter the audit entries, optional.
|
|
184
|
+
|
|
185
|
+
###### organizationId?
|
|
186
|
+
|
|
187
|
+
`string`
|
|
188
|
+
|
|
189
|
+
The organization identifier to filter the audit entries, optional.
|
|
190
|
+
|
|
191
|
+
###### tenantId?
|
|
192
|
+
|
|
193
|
+
`string`
|
|
194
|
+
|
|
195
|
+
The tenant identifier to filter the audit entries, optional.
|
|
196
|
+
|
|
197
|
+
###### nodeId?
|
|
198
|
+
|
|
199
|
+
`string`
|
|
200
|
+
|
|
201
|
+
The node identifier to filter the audit entries, optional.
|
|
202
|
+
|
|
203
|
+
###### event?
|
|
204
|
+
|
|
205
|
+
`string`
|
|
206
|
+
|
|
207
|
+
The audit event to filter the audit entries, optional.
|
|
208
|
+
|
|
209
|
+
###### startDate?
|
|
210
|
+
|
|
211
|
+
`string`
|
|
212
|
+
|
|
213
|
+
The start date to filter the audit entries, optional.
|
|
214
|
+
|
|
215
|
+
###### endDate?
|
|
216
|
+
|
|
217
|
+
`string`
|
|
218
|
+
|
|
219
|
+
The end date to filter the audit entries, optional.
|
|
220
|
+
|
|
221
|
+
##### cursor?
|
|
222
|
+
|
|
223
|
+
`string`
|
|
224
|
+
|
|
225
|
+
The cursor for pagination.
|
|
226
|
+
|
|
227
|
+
##### limit?
|
|
228
|
+
|
|
229
|
+
`number`
|
|
230
|
+
|
|
231
|
+
The maximum number of entries to return.
|
|
232
|
+
|
|
233
|
+
#### Returns
|
|
234
|
+
|
|
235
|
+
`Promise`\<\{ `entries`: `IAuthenticationAuditEntry`[]; `cursor?`: `string`; \}\>
|
|
236
|
+
|
|
237
|
+
The audit entries.
|
|
238
|
+
|
|
239
|
+
#### Implementation of
|
|
240
|
+
|
|
241
|
+
`IAuthenticationAuditComponent.query`
|
|
@@ -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
|
+
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`
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Class: TenantOverrideProcessor
|
|
2
|
+
|
|
3
|
+
Processes the overrideTenant query parameter for routes that allow tenant override.
|
|
4
|
+
Requires the caller to hold the escalated privilege role. Runs after AuthHeaderProcessor so
|
|
5
|
+
authentication is always resolved in the caller's own partition first.
|
|
6
|
+
|
|
7
|
+
## Implements
|
|
8
|
+
|
|
9
|
+
- `IBaseRouteProcessor`
|
|
10
|
+
|
|
11
|
+
## Constructors
|
|
12
|
+
|
|
13
|
+
### Constructor
|
|
14
|
+
|
|
15
|
+
> **new TenantOverrideProcessor**(`options?`): `TenantOverrideProcessor`
|
|
16
|
+
|
|
17
|
+
Create a new instance of TenantOverrideProcessor.
|
|
18
|
+
|
|
19
|
+
#### Parameters
|
|
20
|
+
|
|
21
|
+
##### options?
|
|
22
|
+
|
|
23
|
+
[`ITenantOverrideProcessorConstructorOptions`](../interfaces/ITenantOverrideProcessorConstructorOptions.md)
|
|
24
|
+
|
|
25
|
+
Options for the processor.
|
|
26
|
+
|
|
27
|
+
#### Returns
|
|
28
|
+
|
|
29
|
+
`TenantOverrideProcessor`
|
|
30
|
+
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
### OVERRIDE\_TENANT\_PARAM {#override_tenant_param}
|
|
34
|
+
|
|
35
|
+
> `readonly` `static` **OVERRIDE\_TENANT\_PARAM**: `string` = `"override-tenant"`
|
|
36
|
+
|
|
37
|
+
The query parameter name used to supply the override tenant ID.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### DEFAULT\_AUTHORIZATION\_MODEL\_ID {#default_authorization_model_id}
|
|
42
|
+
|
|
43
|
+
> `readonly` `static` **DEFAULT\_AUTHORIZATION\_MODEL\_ID**: `string` = `"system"`
|
|
44
|
+
|
|
45
|
+
The model identifier that is reserved for system-only use.
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### DEFAULT\_ESCALATED\_PRIVILEGE\_ROLE {#default_escalated_privilege_role}
|
|
50
|
+
|
|
51
|
+
> `readonly` `static` **DEFAULT\_ESCALATED\_PRIVILEGE\_ROLE**: `string` = `"global-admin"`
|
|
52
|
+
|
|
53
|
+
The role string required to perform a tenant override.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### CLASS\_NAME {#class_name}
|
|
58
|
+
|
|
59
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
60
|
+
|
|
61
|
+
Runtime name for the class.
|
|
62
|
+
|
|
63
|
+
## Methods
|
|
64
|
+
|
|
65
|
+
### className() {#classname}
|
|
66
|
+
|
|
67
|
+
> **className**(): `string`
|
|
68
|
+
|
|
69
|
+
Returns the class name of the component.
|
|
70
|
+
|
|
71
|
+
#### Returns
|
|
72
|
+
|
|
73
|
+
`string`
|
|
74
|
+
|
|
75
|
+
The class name of the component.
|
|
76
|
+
|
|
77
|
+
#### Implementation of
|
|
78
|
+
|
|
79
|
+
`IBaseRouteProcessor.className`
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### pre() {#pre}
|
|
84
|
+
|
|
85
|
+
> **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
|
|
86
|
+
|
|
87
|
+
Pre process the REST request for the specified route.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
##### request
|
|
92
|
+
|
|
93
|
+
`IHttpServerRequest`
|
|
94
|
+
|
|
95
|
+
The incoming request.
|
|
96
|
+
|
|
97
|
+
##### response
|
|
98
|
+
|
|
99
|
+
`IHttpResponse`
|
|
100
|
+
|
|
101
|
+
The outgoing response.
|
|
102
|
+
|
|
103
|
+
##### route
|
|
104
|
+
|
|
105
|
+
`IBaseRoute` \| `undefined`
|
|
106
|
+
|
|
107
|
+
The route to process.
|
|
108
|
+
|
|
109
|
+
##### contextIds
|
|
110
|
+
|
|
111
|
+
`IContextIds`
|
|
112
|
+
|
|
113
|
+
The context IDs of the request.
|
|
114
|
+
|
|
115
|
+
##### processorState
|
|
116
|
+
|
|
117
|
+
\{\[`id`: `string`\]: `unknown`; \}
|
|
118
|
+
|
|
119
|
+
The state handed through the processors.
|
|
120
|
+
|
|
121
|
+
#### Returns
|
|
122
|
+
|
|
123
|
+
`Promise`\<`void`\>
|
|
124
|
+
|
|
125
|
+
A promise that resolves when the tenant override has been applied or skipped.
|
|
126
|
+
|
|
127
|
+
#### Implementation of
|
|
128
|
+
|
|
129
|
+
`IBaseRouteProcessor.pre`
|