@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,193 @@
|
|
|
1
|
+
# Class: AuthHeaderProcessor
|
|
2
|
+
|
|
3
|
+
Handle a JWT token in the authorization header or cookies and validate it to populate request context identity.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IBaseRouteProcessor`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new AuthHeaderProcessor**(`options?`): `AuthHeaderProcessor`
|
|
14
|
+
|
|
15
|
+
Create a new instance of AuthHeaderProcessor.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`IAuthHeaderProcessorConstructorOptions`](../interfaces/IAuthHeaderProcessorConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
Options for the processor.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`AuthHeaderProcessor`
|
|
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
|
+
`IBaseRouteProcessor.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 the node identity and organization ID have been cached.
|
|
76
|
+
|
|
77
|
+
#### Implementation of
|
|
78
|
+
|
|
79
|
+
`IBaseRouteProcessor.start`
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### stop() {#stop}
|
|
84
|
+
|
|
85
|
+
> **stop**(): `Promise`\<`void`\>
|
|
86
|
+
|
|
87
|
+
Stop the processor and release the token cache.
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`Promise`\<`void`\>
|
|
92
|
+
|
|
93
|
+
A promise that resolves when the processor has stopped.
|
|
94
|
+
|
|
95
|
+
#### Implementation of
|
|
96
|
+
|
|
97
|
+
`IBaseRouteProcessor.stop`
|
|
98
|
+
|
|
99
|
+
***
|
|
100
|
+
|
|
101
|
+
### pre() {#pre}
|
|
102
|
+
|
|
103
|
+
> **pre**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
|
|
104
|
+
|
|
105
|
+
Pre process the REST request for the specified route.
|
|
106
|
+
|
|
107
|
+
#### Parameters
|
|
108
|
+
|
|
109
|
+
##### request
|
|
110
|
+
|
|
111
|
+
`IHttpServerRequest`
|
|
112
|
+
|
|
113
|
+
The incoming request.
|
|
114
|
+
|
|
115
|
+
##### response
|
|
116
|
+
|
|
117
|
+
`IHttpResponse`
|
|
118
|
+
|
|
119
|
+
The outgoing response.
|
|
120
|
+
|
|
121
|
+
##### route
|
|
122
|
+
|
|
123
|
+
`IBaseRoute` \| `undefined`
|
|
124
|
+
|
|
125
|
+
The route to process.
|
|
126
|
+
|
|
127
|
+
##### contextIds
|
|
128
|
+
|
|
129
|
+
`IContextIds`
|
|
130
|
+
|
|
131
|
+
The context IDs of the request.
|
|
132
|
+
|
|
133
|
+
##### processorState
|
|
134
|
+
|
|
135
|
+
The state handed through the processors.
|
|
136
|
+
|
|
137
|
+
#### Returns
|
|
138
|
+
|
|
139
|
+
`Promise`\<`void`\>
|
|
140
|
+
|
|
141
|
+
A promise that resolves when the JWT has been verified and the context populated, or an error response set.
|
|
142
|
+
|
|
143
|
+
#### Implementation of
|
|
144
|
+
|
|
145
|
+
`IBaseRouteProcessor.pre`
|
|
146
|
+
|
|
147
|
+
***
|
|
148
|
+
|
|
149
|
+
### post() {#post}
|
|
150
|
+
|
|
151
|
+
> **post**(`request`, `response`, `route`, `contextIds`, `processorState`): `Promise`\<`void`\>
|
|
152
|
+
|
|
153
|
+
Post process the REST request for the specified route.
|
|
154
|
+
|
|
155
|
+
#### Parameters
|
|
156
|
+
|
|
157
|
+
##### request
|
|
158
|
+
|
|
159
|
+
`IHttpServerRequest`
|
|
160
|
+
|
|
161
|
+
The incoming request.
|
|
162
|
+
|
|
163
|
+
##### response
|
|
164
|
+
|
|
165
|
+
`IHttpResponse`
|
|
166
|
+
|
|
167
|
+
The outgoing response.
|
|
168
|
+
|
|
169
|
+
##### route
|
|
170
|
+
|
|
171
|
+
`IBaseRoute` \| `undefined`
|
|
172
|
+
|
|
173
|
+
The route to process.
|
|
174
|
+
|
|
175
|
+
##### contextIds
|
|
176
|
+
|
|
177
|
+
`IContextIds`
|
|
178
|
+
|
|
179
|
+
The context IDs of the request.
|
|
180
|
+
|
|
181
|
+
##### processorState
|
|
182
|
+
|
|
183
|
+
The state handed through the processors.
|
|
184
|
+
|
|
185
|
+
#### Returns
|
|
186
|
+
|
|
187
|
+
`Promise`\<`void`\>
|
|
188
|
+
|
|
189
|
+
A promise that resolves when the Set-Cookie header has been applied to the response if required.
|
|
190
|
+
|
|
191
|
+
#### Implementation of
|
|
192
|
+
|
|
193
|
+
`IBaseRouteProcessor.post`
|
|
@@ -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,69 @@
|
|
|
1
|
+
# Class: AuthenticationUser
|
|
2
|
+
|
|
3
|
+
Class defining the storage for user login credentials.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new AuthenticationUser**(): `AuthenticationUser`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`AuthenticationUser`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### email {#email}
|
|
18
|
+
|
|
19
|
+
> **email**: `string`
|
|
20
|
+
|
|
21
|
+
The user e-mail address.
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### password {#password}
|
|
26
|
+
|
|
27
|
+
> **password**: `string`
|
|
28
|
+
|
|
29
|
+
The encrypted password for the user.
|
|
30
|
+
|
|
31
|
+
***
|
|
32
|
+
|
|
33
|
+
### salt {#salt}
|
|
34
|
+
|
|
35
|
+
> **salt**: `string`
|
|
36
|
+
|
|
37
|
+
The salt for the password.
|
|
38
|
+
|
|
39
|
+
***
|
|
40
|
+
|
|
41
|
+
### identity {#identity}
|
|
42
|
+
|
|
43
|
+
> **identity**: `string`
|
|
44
|
+
|
|
45
|
+
The user identity.
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### organization {#organization}
|
|
50
|
+
|
|
51
|
+
> **organization**: `string`
|
|
52
|
+
|
|
53
|
+
The users organization.
|
|
54
|
+
|
|
55
|
+
***
|
|
56
|
+
|
|
57
|
+
### scope {#scope}
|
|
58
|
+
|
|
59
|
+
> **scope**: `string`
|
|
60
|
+
|
|
61
|
+
The scope assigned to the user, comma separated.
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### passwordVersion? {#passwordversion}
|
|
66
|
+
|
|
67
|
+
> `optional` **passwordVersion?**: `number`
|
|
68
|
+
|
|
69
|
+
The password version counter, incremented on every password change to invalidate existing tokens.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Class: EntityStorageAuthenticationAdminService
|
|
2
|
+
|
|
3
|
+
Implementation of the authentication component using entity storage.
|
|
4
|
+
|
|
5
|
+
## Implements
|
|
6
|
+
|
|
7
|
+
- `IAuthenticationAdminComponent`
|
|
8
|
+
|
|
9
|
+
## Constructors
|
|
10
|
+
|
|
11
|
+
### Constructor
|
|
12
|
+
|
|
13
|
+
> **new EntityStorageAuthenticationAdminService**(`options?`): `EntityStorageAuthenticationAdminService`
|
|
14
|
+
|
|
15
|
+
Create a new instance of EntityStorageAuthentication.
|
|
16
|
+
|
|
17
|
+
#### Parameters
|
|
18
|
+
|
|
19
|
+
##### options?
|
|
20
|
+
|
|
21
|
+
[`IEntityStorageAuthenticationAdminServiceConstructorOptions`](../interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md)
|
|
22
|
+
|
|
23
|
+
The dependencies for the identity connector.
|
|
24
|
+
|
|
25
|
+
#### Returns
|
|
26
|
+
|
|
27
|
+
`EntityStorageAuthenticationAdminService`
|
|
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
|
+
***
|
|
38
|
+
|
|
39
|
+
### DEFAULT\_ESCALATED\_PRIVILEGE\_SCOPE {#default_escalated_privilege_scope}
|
|
40
|
+
|
|
41
|
+
> `readonly` `static` **DEFAULT\_ESCALATED\_PRIVILEGE\_SCOPE**: `string` = `"global-admin"`
|
|
42
|
+
|
|
43
|
+
The scope value that grants permission to assign privileged roles.
|
|
44
|
+
|
|
45
|
+
## Methods
|
|
46
|
+
|
|
47
|
+
### className() {#classname}
|
|
48
|
+
|
|
49
|
+
> **className**(): `string`
|
|
50
|
+
|
|
51
|
+
Returns the class name of the component.
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`string`
|
|
56
|
+
|
|
57
|
+
The class name of the component.
|
|
58
|
+
|
|
59
|
+
#### Implementation of
|
|
60
|
+
|
|
61
|
+
`IAuthenticationAdminComponent.className`
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
### create() {#create}
|
|
66
|
+
|
|
67
|
+
> **create**(`user`): `Promise`\<`void`\>
|
|
68
|
+
|
|
69
|
+
Create a login for the user.
|
|
70
|
+
|
|
71
|
+
#### Parameters
|
|
72
|
+
|
|
73
|
+
##### user
|
|
74
|
+
|
|
75
|
+
`IAuthenticationUser` & `object`
|
|
76
|
+
|
|
77
|
+
The user to create.
|
|
78
|
+
|
|
79
|
+
#### Returns
|
|
80
|
+
|
|
81
|
+
`Promise`\<`void`\>
|
|
82
|
+
|
|
83
|
+
A promise that resolves when the user account has been created and the audit entry recorded.
|
|
84
|
+
|
|
85
|
+
#### Implementation of
|
|
86
|
+
|
|
87
|
+
`IAuthenticationAdminComponent.create`
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### update() {#update}
|
|
92
|
+
|
|
93
|
+
> **update**(`user`): `Promise`\<`void`\>
|
|
94
|
+
|
|
95
|
+
Update a login for the user.
|
|
96
|
+
|
|
97
|
+
#### Parameters
|
|
98
|
+
|
|
99
|
+
##### user
|
|
100
|
+
|
|
101
|
+
`Partial`\<`IAuthenticationUser`\>
|
|
102
|
+
|
|
103
|
+
The user to update.
|
|
104
|
+
|
|
105
|
+
#### Returns
|
|
106
|
+
|
|
107
|
+
`Promise`\<`void`\>
|
|
108
|
+
|
|
109
|
+
A promise that resolves when the user account has been updated and the audit entry recorded.
|
|
110
|
+
|
|
111
|
+
#### Implementation of
|
|
112
|
+
|
|
113
|
+
`IAuthenticationAdminComponent.update`
|
|
114
|
+
|
|
115
|
+
***
|
|
116
|
+
|
|
117
|
+
### get() {#get}
|
|
118
|
+
|
|
119
|
+
> **get**(`email`): `Promise`\<`IAuthenticationUser`\>
|
|
120
|
+
|
|
121
|
+
Get a user by email.
|
|
122
|
+
|
|
123
|
+
#### Parameters
|
|
124
|
+
|
|
125
|
+
##### email
|
|
126
|
+
|
|
127
|
+
`string`
|
|
128
|
+
|
|
129
|
+
The email address of the user to get.
|
|
130
|
+
|
|
131
|
+
#### Returns
|
|
132
|
+
|
|
133
|
+
`Promise`\<`IAuthenticationUser`\>
|
|
134
|
+
|
|
135
|
+
The user details.
|
|
136
|
+
|
|
137
|
+
#### Implementation of
|
|
138
|
+
|
|
139
|
+
`IAuthenticationAdminComponent.get`
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### getByIdentity() {#getbyidentity}
|
|
144
|
+
|
|
145
|
+
> **getByIdentity**(`identity`): `Promise`\<`IAuthenticationUser`\>
|
|
146
|
+
|
|
147
|
+
Get a user by identity.
|
|
148
|
+
|
|
149
|
+
#### Parameters
|
|
150
|
+
|
|
151
|
+
##### identity
|
|
152
|
+
|
|
153
|
+
`string`
|
|
154
|
+
|
|
155
|
+
The identity of the user to get.
|
|
156
|
+
|
|
157
|
+
#### Returns
|
|
158
|
+
|
|
159
|
+
`Promise`\<`IAuthenticationUser`\>
|
|
160
|
+
|
|
161
|
+
The user details.
|
|
162
|
+
|
|
163
|
+
#### Implementation of
|
|
164
|
+
|
|
165
|
+
`IAuthenticationAdminComponent.getByIdentity`
|
|
166
|
+
|
|
167
|
+
***
|
|
168
|
+
|
|
169
|
+
### remove() {#remove}
|
|
170
|
+
|
|
171
|
+
> **remove**(`email`): `Promise`\<`void`\>
|
|
172
|
+
|
|
173
|
+
Remove the current user.
|
|
174
|
+
|
|
175
|
+
#### Parameters
|
|
176
|
+
|
|
177
|
+
##### email
|
|
178
|
+
|
|
179
|
+
`string`
|
|
180
|
+
|
|
181
|
+
The email address of the user to remove.
|
|
182
|
+
|
|
183
|
+
#### Returns
|
|
184
|
+
|
|
185
|
+
`Promise`\<`void`\>
|
|
186
|
+
|
|
187
|
+
A promise that resolves when the user account has been removed and the audit entry recorded.
|
|
188
|
+
|
|
189
|
+
#### Implementation of
|
|
190
|
+
|
|
191
|
+
`IAuthenticationAdminComponent.remove`
|
|
192
|
+
|
|
193
|
+
***
|
|
194
|
+
|
|
195
|
+
### updatePassword() {#updatepassword}
|
|
196
|
+
|
|
197
|
+
> **updatePassword**(`email`, `newPassword`, `currentPassword?`): `Promise`\<`void`\>
|
|
198
|
+
|
|
199
|
+
Update the user's password.
|
|
200
|
+
|
|
201
|
+
#### Parameters
|
|
202
|
+
|
|
203
|
+
##### email
|
|
204
|
+
|
|
205
|
+
`string`
|
|
206
|
+
|
|
207
|
+
The email address of the user to update.
|
|
208
|
+
|
|
209
|
+
##### newPassword
|
|
210
|
+
|
|
211
|
+
`string`
|
|
212
|
+
|
|
213
|
+
The new password for the user.
|
|
214
|
+
|
|
215
|
+
##### currentPassword?
|
|
216
|
+
|
|
217
|
+
`string`
|
|
218
|
+
|
|
219
|
+
The current password, optional, if supplied will check against existing.
|
|
220
|
+
|
|
221
|
+
#### Returns
|
|
222
|
+
|
|
223
|
+
`Promise`\<`void`\>
|
|
224
|
+
|
|
225
|
+
A promise that resolves when the password has been updated.
|
|
226
|
+
|
|
227
|
+
#### Implementation of
|
|
228
|
+
|
|
229
|
+
`IAuthenticationAdminComponent.updatePassword`
|