@3sixty/api-auth-entity-storage-service 0.0.0-stage → 0.20.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/entities/authenticationUser.js +69 -0
- package/dist/es/entities/authenticationUser.js.map +1 -0
- package/dist/es/index.js +29 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IAuthHeaderProcessorConfig.js +4 -0
- package/dist/es/models/IAuthHeaderProcessorConfig.js.map +1 -0
- package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js +2 -0
- package/dist/es/models/IAuthHeaderProcessorConstructorOptions.js.map +1 -0
- package/dist/es/models/IAuthTokenContext.js +4 -0
- package/dist/es/models/IAuthTokenContext.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js +4 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.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/IEntityStorageAuthenticationServiceConfig.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConfig.js.map +1 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js +2 -0
- package/dist/es/models/IEntityStorageAuthenticationServiceConstructorOptions.js.map +1 -0
- package/dist/es/processors/authHeaderProcessor.js +277 -0
- package/dist/es/processors/authHeaderProcessor.js.map +1 -0
- package/dist/es/restEntryPoints.js +27 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js +367 -0
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js +343 -0
- package/dist/es/routes/entityStorageAuthenticationAuditRoutes.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationRoutes.js +247 -0
- package/dist/es/routes/entityStorageAuthenticationRoutes.js.map +1 -0
- package/dist/es/schema.js +15 -0
- package/dist/es/schema.js.map +1 -0
- package/dist/es/services/entityStorageAuthenticationAdminService.js +323 -0
- package/dist/es/services/entityStorageAuthenticationAdminService.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/es/services/entityStorageAuthenticationService.js +326 -0
- package/dist/es/services/entityStorageAuthenticationService.js.map +1 -0
- package/dist/es/utils/passwordHelper.js +58 -0
- package/dist/es/utils/passwordHelper.js.map +1 -0
- package/dist/es/utils/tokenHelper.js +142 -0
- package/dist/es/utils/tokenHelper.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/entities/authenticationUser.d.ts +33 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/models/IAuthHeaderProcessorConfig.d.ts +39 -0
- package/dist/types/models/IAuthHeaderProcessorConstructorOptions.d.ts +25 -0
- package/dist/types/models/IAuthTokenContext.d.ts +34 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +14 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +20 -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/IEntityStorageAuthenticationServiceConfig.d.ts +36 -0
- package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +35 -0
- package/dist/types/processors/authHeaderProcessor.d.ts +57 -0
- package/dist/types/restEntryPoints.d.ts +5 -0
- package/dist/types/routes/entityStorageAuthenticationAdminRoutes.d.ts +62 -0
- package/dist/types/routes/entityStorageAuthenticationAuditRoutes.d.ts +54 -0
- package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +45 -0
- package/dist/types/schema.d.ts +4 -0
- package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +65 -0
- package/dist/types/services/entityStorageAuthenticationAuditService.d.ts +72 -0
- package/dist/types/services/entityStorageAuthenticationRateService.d.ts +60 -0
- package/dist/types/services/entityStorageAuthenticationService.d.ts +65 -0
- package/dist/types/utils/passwordHelper.d.ts +24 -0
- package/dist/types/utils/tokenHelper.d.ts +60 -0
- package/docs/changelog.md +0 -0
- package/docs/examples.md +178 -0
- package/docs/open-api/spec.json +2122 -0
- package/docs/reference/classes/AuthHeaderProcessor.md +193 -0
- package/docs/reference/classes/AuthenticationAuditEntry.md +101 -0
- package/docs/reference/classes/AuthenticationRateEntry.md +37 -0
- package/docs/reference/classes/AuthenticationUser.md +69 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +229 -0
- package/docs/reference/classes/EntityStorageAuthenticationAuditService.md +241 -0
- package/docs/reference/classes/EntityStorageAuthenticationRateService.md +227 -0
- package/docs/reference/classes/EntityStorageAuthenticationService.md +221 -0
- package/docs/reference/classes/PasswordHelper.md +74 -0
- package/docs/reference/classes/TokenHelper.md +205 -0
- package/docs/reference/functions/authenticationAdminCreateUser.md +37 -0
- package/docs/reference/functions/authenticationAdminGetUser.md +31 -0
- package/docs/reference/functions/authenticationAdminGetUserByIdentity.md +31 -0
- package/docs/reference/functions/authenticationAdminRemoveUser.md +31 -0
- package/docs/reference/functions/authenticationAdminUpdateUser.md +31 -0
- package/docs/reference/functions/authenticationAdminUpdateUserPassword.md +31 -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/authenticationLogin.md +31 -0
- package/docs/reference/functions/authenticationLogout.md +31 -0
- package/docs/reference/functions/authenticationRefreshToken.md +31 -0
- package/docs/reference/functions/authenticationUpdatePassword.md +31 -0
- package/docs/reference/functions/generateRestRoutesAuthentication.md +25 -0
- package/docs/reference/functions/generateRestRoutesAuthenticationAdmin.md +25 -0
- package/docs/reference/functions/generateRestRoutesAuthenticationAudit.md +25 -0
- package/docs/reference/functions/initSchema.md +9 -0
- package/docs/reference/index.md +57 -0
- package/docs/reference/interfaces/IAuthHeaderProcessorConfig.md +86 -0
- package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +53 -0
- package/docs/reference/interfaces/IAuthTokenContext.md +60 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +25 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +39 -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/IEntityStorageAuthenticationServiceConfig.md +87 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +81 -0
- package/docs/reference/variables/restEntryPoints.md +5 -0
- package/docs/reference/variables/tagsAuthentication.md +5 -0
- package/docs/reference/variables/tagsAuthenticationAdmin.md +5 -0
- package/docs/reference/variables/tagsAuthenticationAudit.md +5 -0
- package/locales/en.json +52 -0
- package/package.json +64 -5
|
@@ -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,221 @@
|
|
|
1
|
+
# Class: EntityStorageAuthenticationService
|
|
2
|
+
|
|
3
|
+
Implementation of the authentication component using entity storage.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IAuthenticationComponent`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new EntityStorageAuthenticationService**(`options?`): `EntityStorageAuthenticationService`
|
|
14
|
+
|
|
15
|
+
Create a new instance of EntityStorageAuthentication.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`IEntityStorageAuthenticationServiceConstructorOptions`](../interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
The dependencies for the identity connector.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`EntityStorageAuthenticationService`
|
|
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
|
+
`IAuthenticationComponent.className`
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### start() {#start}
|
|
58
|
+
|
|
59
|
+
> **start**(`nodeLoggingComponentType?`): `Promise`\<`void`\>
|
|
60
|
+
|
|
61
|
+
The service needs to be started when the application is initialized.
|
|
62
|
+
|
|
63
|
+
#### Parameters
|
|
64
|
+
|
|
65
|
+
##### nodeLoggingComponentType?
|
|
66
|
+
|
|
67
|
+
`string`
|
|
68
|
+
|
|
69
|
+
The node logging component type.
|
|
70
|
+
|
|
71
|
+
#### Returns
|
|
72
|
+
|
|
73
|
+
`Promise`\<`void`\>
|
|
74
|
+
|
|
75
|
+
A promise that resolves when rate-limit actions have been registered and the node identity cached.
|
|
76
|
+
|
|
77
|
+
#### Implementation of
|
|
78
|
+
|
|
79
|
+
`IAuthenticationComponent.start`
|
|
80
|
+
|
|
81
|
+
***
|
|
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
|
+
A promise that resolves when all rate-limit actions have been unregistered.
|
|
102
|
+
|
|
103
|
+
#### Implementation of
|
|
104
|
+
|
|
105
|
+
`IAuthenticationComponent.stop`
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### login() {#login}
|
|
110
|
+
|
|
111
|
+
> **login**(`email`, `password`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
112
|
+
|
|
113
|
+
Perform a login for the user.
|
|
114
|
+
|
|
115
|
+
#### Parameters
|
|
116
|
+
|
|
117
|
+
##### email
|
|
118
|
+
|
|
119
|
+
`string`
|
|
120
|
+
|
|
121
|
+
The email address for the user.
|
|
122
|
+
|
|
123
|
+
##### password
|
|
124
|
+
|
|
125
|
+
`string`
|
|
126
|
+
|
|
127
|
+
The password for the user.
|
|
128
|
+
|
|
129
|
+
#### Returns
|
|
130
|
+
|
|
131
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
132
|
+
|
|
133
|
+
The authentication token for the user, if it uses a mechanism with public access.
|
|
134
|
+
|
|
135
|
+
#### Implementation of
|
|
136
|
+
|
|
137
|
+
`IAuthenticationComponent.login`
|
|
138
|
+
|
|
139
|
+
***
|
|
140
|
+
|
|
141
|
+
### logout() {#logout}
|
|
142
|
+
|
|
143
|
+
> **logout**(`token?`): `Promise`\<`void`\>
|
|
144
|
+
|
|
145
|
+
Logout the current user.
|
|
146
|
+
|
|
147
|
+
#### Parameters
|
|
148
|
+
|
|
149
|
+
##### token?
|
|
150
|
+
|
|
151
|
+
`string`
|
|
152
|
+
|
|
153
|
+
The token to logout, if it uses a mechanism with public access.
|
|
154
|
+
|
|
155
|
+
#### Returns
|
|
156
|
+
|
|
157
|
+
`Promise`\<`void`\>
|
|
158
|
+
|
|
159
|
+
A promise that resolves when the logout audit entry has been recorded.
|
|
160
|
+
|
|
161
|
+
#### Implementation of
|
|
162
|
+
|
|
163
|
+
`IAuthenticationComponent.logout`
|
|
164
|
+
|
|
165
|
+
***
|
|
166
|
+
|
|
167
|
+
### refresh() {#refresh}
|
|
168
|
+
|
|
169
|
+
> **refresh**(`token?`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
170
|
+
|
|
171
|
+
Refresh the token.
|
|
172
|
+
|
|
173
|
+
#### Parameters
|
|
174
|
+
|
|
175
|
+
##### token?
|
|
176
|
+
|
|
177
|
+
`string`
|
|
178
|
+
|
|
179
|
+
The token to refresh, if it uses a mechanism with public access.
|
|
180
|
+
|
|
181
|
+
#### Returns
|
|
182
|
+
|
|
183
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
184
|
+
|
|
185
|
+
The refreshed token, if it uses a mechanism with public access.
|
|
186
|
+
|
|
187
|
+
#### Implementation of
|
|
188
|
+
|
|
189
|
+
`IAuthenticationComponent.refresh`
|
|
190
|
+
|
|
191
|
+
***
|
|
192
|
+
|
|
193
|
+
### updatePassword() {#updatepassword}
|
|
194
|
+
|
|
195
|
+
> **updatePassword**(`currentPassword`, `newPassword`): `Promise`\<`void`\>
|
|
196
|
+
|
|
197
|
+
Update the user's password.
|
|
198
|
+
|
|
199
|
+
#### Parameters
|
|
200
|
+
|
|
201
|
+
##### currentPassword
|
|
202
|
+
|
|
203
|
+
`string`
|
|
204
|
+
|
|
205
|
+
The current password for the user.
|
|
206
|
+
|
|
207
|
+
##### newPassword
|
|
208
|
+
|
|
209
|
+
`string`
|
|
210
|
+
|
|
211
|
+
The new password for the user.
|
|
212
|
+
|
|
213
|
+
#### Returns
|
|
214
|
+
|
|
215
|
+
`Promise`\<`void`\>
|
|
216
|
+
|
|
217
|
+
A promise that resolves when the password has been updated and the rate limit cleared.
|
|
218
|
+
|
|
219
|
+
#### Implementation of
|
|
220
|
+
|
|
221
|
+
`IAuthenticationComponent.updatePassword`
|