@twin.org/api-auth-entity-storage-service 0.0.1 → 0.0.2-next.10
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/dist/cjs/index.cjs +208 -15
- package/dist/esm/index.mjs +209 -18
- package/dist/types/index.d.ts +3 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConfig.d.ts +10 -0
- package/dist/types/models/IEntityStorageAuthenticationAdminServiceConstructorOptions.d.ts +15 -0
- package/dist/types/models/IEntityStorageAuthenticationServiceConstructorOptions.d.ts +5 -0
- package/dist/types/processors/authHeaderProcessor.d.ts +2 -6
- package/dist/types/routes/entityStorageAuthenticationRoutes.d.ts +9 -1
- package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +38 -0
- package/dist/types/services/entityStorageAuthenticationService.d.ts +10 -6
- package/docs/changelog.md +166 -0
- package/docs/reference/classes/AuthHeaderProcessor.md +3 -11
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +141 -0
- package/docs/reference/classes/EntityStorageAuthenticationService.md +41 -11
- package/docs/reference/functions/authenticationUpdatePassword.md +31 -0
- package/docs/reference/index.md +4 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +17 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +25 -0
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +14 -0
- package/locales/en.json +9 -0
- package/package.json +12 -12
|
@@ -4,10 +4,6 @@ import type { IAuthHeaderProcessorConstructorOptions } from "../models/IAuthHead
|
|
|
4
4
|
* Handle a JWT token in the authorization header or cookies and validate it to populate request context identity.
|
|
5
5
|
*/
|
|
6
6
|
export declare class AuthHeaderProcessor implements IBaseRouteProcessor {
|
|
7
|
-
/**
|
|
8
|
-
* The namespace supported by the processor.
|
|
9
|
-
*/
|
|
10
|
-
static readonly NAMESPACE: string;
|
|
11
7
|
/**
|
|
12
8
|
* Runtime name for the class.
|
|
13
9
|
*/
|
|
@@ -20,10 +16,10 @@ export declare class AuthHeaderProcessor implements IBaseRouteProcessor {
|
|
|
20
16
|
/**
|
|
21
17
|
* The service needs to be started when the application is initialized.
|
|
22
18
|
* @param nodeIdentity The identity of the node.
|
|
23
|
-
* @param
|
|
19
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
24
20
|
* @returns Nothing.
|
|
25
21
|
*/
|
|
26
|
-
start(nodeIdentity: string,
|
|
22
|
+
start(nodeIdentity: string, nodeLoggingComponentType?: string): Promise<void>;
|
|
27
23
|
/**
|
|
28
24
|
* Pre process the REST request for the specified route.
|
|
29
25
|
* @param request The incoming request.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ILoginRequest, ILoginResponse, ILogoutRequest, IRefreshTokenRequest, IRefreshTokenResponse } from "@twin.org/api-auth-entity-storage-models";
|
|
1
|
+
import type { ILoginRequest, ILoginResponse, ILogoutRequest, IRefreshTokenRequest, IRefreshTokenResponse, IUpdatePasswordRequest } from "@twin.org/api-auth-entity-storage-models";
|
|
2
2
|
import type { IHttpRequestContext, INoContentResponse, IRestRoute, IRestRouteResponseOptions, ITag } from "@twin.org/api-models";
|
|
3
3
|
/**
|
|
4
4
|
* The tag to associate with the routes.
|
|
@@ -35,3 +35,11 @@ export declare function authenticationLogout(httpRequestContext: IHttpRequestCon
|
|
|
35
35
|
* @returns The response object with additional http response properties.
|
|
36
36
|
*/
|
|
37
37
|
export declare function authenticationRefreshToken(httpRequestContext: IHttpRequestContext, componentName: string, request: IRefreshTokenRequest): Promise<IRefreshTokenResponse & IRestRouteResponseOptions>;
|
|
38
|
+
/**
|
|
39
|
+
* Update the user's password.
|
|
40
|
+
* @param httpRequestContext The request context for the API.
|
|
41
|
+
* @param componentName The name of the component to use in the routes.
|
|
42
|
+
* @param request The request.
|
|
43
|
+
* @returns The response object with additional http response properties.
|
|
44
|
+
*/
|
|
45
|
+
export declare function authenticationUpdatePassword(httpRequestContext: IHttpRequestContext, componentName: string, request: IUpdatePasswordRequest): Promise<INoContentResponse>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IAuthenticationAdminComponent } from "@twin.org/api-auth-entity-storage-models";
|
|
2
|
+
import type { IEntityStorageAuthenticationAdminServiceConstructorOptions } from "../models/IEntityStorageAuthenticationAdminServiceConstructorOptions";
|
|
3
|
+
/**
|
|
4
|
+
* Implementation of the authentication component using entity storage.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EntityStorageAuthenticationAdminService implements IAuthenticationAdminComponent {
|
|
7
|
+
/**
|
|
8
|
+
* Runtime name for the class.
|
|
9
|
+
*/
|
|
10
|
+
readonly CLASS_NAME: string;
|
|
11
|
+
/**
|
|
12
|
+
* Create a new instance of EntityStorageAuthentication.
|
|
13
|
+
* @param options The dependencies for the identity connector.
|
|
14
|
+
*/
|
|
15
|
+
constructor(options?: IEntityStorageAuthenticationAdminServiceConstructorOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Create a login for the user.
|
|
18
|
+
* @param email The email address for the user.
|
|
19
|
+
* @param password The password for the user.
|
|
20
|
+
* @param identity The DID to associate with the account.
|
|
21
|
+
* @returns Nothing.
|
|
22
|
+
*/
|
|
23
|
+
create(email: string, password: string, identity: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Remove the current user.
|
|
26
|
+
* @param email The email address of the user to remove.
|
|
27
|
+
* @returns Nothing.
|
|
28
|
+
*/
|
|
29
|
+
remove(email: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Update the user's password.
|
|
32
|
+
* @param email The email address of the user to update.
|
|
33
|
+
* @param newPassword The new password for the user.
|
|
34
|
+
* @param currentPassword The current password, optional, if supplied will check against existing.
|
|
35
|
+
* @returns Nothing.
|
|
36
|
+
*/
|
|
37
|
+
updatePassword(email: string, newPassword: string, currentPassword?: string): Promise<void>;
|
|
38
|
+
}
|
|
@@ -4,10 +4,6 @@ import type { IEntityStorageAuthenticationServiceConstructorOptions } from "../m
|
|
|
4
4
|
* Implementation of the authentication component using entity storage.
|
|
5
5
|
*/
|
|
6
6
|
export declare class EntityStorageAuthenticationService implements IAuthenticationComponent {
|
|
7
|
-
/**
|
|
8
|
-
* The namespace supported by the authentication service.
|
|
9
|
-
*/
|
|
10
|
-
static readonly NAMESPACE: string;
|
|
11
7
|
/**
|
|
12
8
|
* Runtime name for the class.
|
|
13
9
|
*/
|
|
@@ -20,10 +16,10 @@ export declare class EntityStorageAuthenticationService implements IAuthenticati
|
|
|
20
16
|
/**
|
|
21
17
|
* The service needs to be started when the application is initialized.
|
|
22
18
|
* @param nodeIdentity The identity of the node.
|
|
23
|
-
* @param
|
|
19
|
+
* @param nodeLoggingComponentType The node logging component type.
|
|
24
20
|
* @returns Nothing.
|
|
25
21
|
*/
|
|
26
|
-
start(nodeIdentity: string,
|
|
22
|
+
start(nodeIdentity: string, nodeLoggingComponentType?: string): Promise<void>;
|
|
27
23
|
/**
|
|
28
24
|
* Perform a login for the user.
|
|
29
25
|
* @param email The email address for the user.
|
|
@@ -49,4 +45,12 @@ export declare class EntityStorageAuthenticationService implements IAuthenticati
|
|
|
49
45
|
token: string;
|
|
50
46
|
expiry: number;
|
|
51
47
|
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Update the user's password.
|
|
50
|
+
* @param email The email address of the user to update.
|
|
51
|
+
* @param currentPassword The current password for the user.
|
|
52
|
+
* @param newPassword The new password for the user.
|
|
53
|
+
* @returns Nothing.
|
|
54
|
+
*/
|
|
55
|
+
updatePassword(email: string, currentPassword: string, newPassword: string): Promise<void>;
|
|
52
56
|
}
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,171 @@
|
|
|
1
1
|
# @twin.org/api-auth-entity-storage-service - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.2-next.10](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.9...api-auth-entity-storage-service-v0.0.2-next.10) (2025-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* use new extractBearer method ([3e0cc54](https://github.com/twinfoundation/api/commit/3e0cc5462c06f59a6b744386eeff8326e5abbc95))
|
|
9
|
+
* use new extractBearerToken method ([df654e9](https://github.com/twinfoundation/api/commit/df654e9caee5bd62f0be36f7be9902c8fab6ead6))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Dependencies
|
|
13
|
+
|
|
14
|
+
* The following workspace dependencies were updated
|
|
15
|
+
* dependencies
|
|
16
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
17
|
+
* @twin.org/api-core bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
18
|
+
* @twin.org/api-models bumped from 0.0.2-next.9 to 0.0.2-next.10
|
|
19
|
+
|
|
20
|
+
## [0.0.2-next.9](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.8...api-auth-entity-storage-service-v0.0.2-next.9) (2025-08-29)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* eslint migration to flat config ([0dd5820](https://github.com/twinfoundation/api/commit/0dd5820e3af97350fd08b8d226f4a6c1a9246805))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Dependencies
|
|
29
|
+
|
|
30
|
+
* The following workspace dependencies were updated
|
|
31
|
+
* dependencies
|
|
32
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
33
|
+
* @twin.org/api-core bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
34
|
+
* @twin.org/api-models bumped from 0.0.2-next.8 to 0.0.2-next.9
|
|
35
|
+
|
|
36
|
+
## [0.0.2-next.8](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.7...api-auth-entity-storage-service-v0.0.2-next.8) (2025-08-21)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Miscellaneous Chores
|
|
40
|
+
|
|
41
|
+
* **api-auth-entity-storage-service:** Synchronize repo versions
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
* The following workspace dependencies were updated
|
|
47
|
+
* dependencies
|
|
48
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
49
|
+
* @twin.org/api-core bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
50
|
+
* @twin.org/api-models bumped from 0.0.2-next.7 to 0.0.2-next.8
|
|
51
|
+
|
|
52
|
+
## [0.0.2-next.7](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.6...api-auth-entity-storage-service-v0.0.2-next.7) (2025-08-20)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
### Miscellaneous Chores
|
|
56
|
+
|
|
57
|
+
* **api-auth-entity-storage-service:** Synchronize repo versions
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Dependencies
|
|
61
|
+
|
|
62
|
+
* The following workspace dependencies were updated
|
|
63
|
+
* dependencies
|
|
64
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
65
|
+
* @twin.org/api-core bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
66
|
+
* @twin.org/api-models bumped from 0.0.2-next.6 to 0.0.2-next.7
|
|
67
|
+
|
|
68
|
+
## [0.0.2-next.6](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.5...api-auth-entity-storage-service-v0.0.2-next.6) (2025-08-19)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Features
|
|
72
|
+
|
|
73
|
+
* update framework core ([d8eebf2](https://github.com/twinfoundation/api/commit/d8eebf267fa2a0abaa84e58590496e9d20490cfa))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Dependencies
|
|
77
|
+
|
|
78
|
+
* The following workspace dependencies were updated
|
|
79
|
+
* dependencies
|
|
80
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
81
|
+
* @twin.org/api-core bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
82
|
+
* @twin.org/api-models bumped from 0.0.2-next.5 to 0.0.2-next.6
|
|
83
|
+
|
|
84
|
+
## [0.0.2-next.5](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.4...api-auth-entity-storage-service-v0.0.2-next.5) (2025-07-25)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Features
|
|
88
|
+
|
|
89
|
+
* add json-ld mime type processor and auth admin component ([8861791](https://github.com/twinfoundation/api/commit/88617916e23bfbca023dbae1976fe421983a02ff))
|
|
90
|
+
* remove unused namespace ([08478f2](https://github.com/twinfoundation/api/commit/08478f27efda9beb0271fdb22f6972e918361965))
|
|
91
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
92
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
### Dependencies
|
|
96
|
+
|
|
97
|
+
* The following workspace dependencies were updated
|
|
98
|
+
* dependencies
|
|
99
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
100
|
+
* @twin.org/api-core bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
101
|
+
* @twin.org/api-models bumped from 0.0.2-next.4 to 0.0.2-next.5
|
|
102
|
+
|
|
103
|
+
## [0.0.2-next.4](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.3...api-auth-entity-storage-service-v0.0.2-next.4) (2025-07-25)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
### Miscellaneous Chores
|
|
107
|
+
|
|
108
|
+
* **api-auth-entity-storage-service:** Synchronize repo versions
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Dependencies
|
|
112
|
+
|
|
113
|
+
* The following workspace dependencies were updated
|
|
114
|
+
* dependencies
|
|
115
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
116
|
+
* @twin.org/api-core bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
117
|
+
* @twin.org/api-models bumped from 0.0.2-next.3 to 0.0.2-next.4
|
|
118
|
+
|
|
119
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.2...api-auth-entity-storage-service-v0.0.2-next.3) (2025-07-24)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
### Features
|
|
123
|
+
|
|
124
|
+
* remove unused namespace ([08478f2](https://github.com/twinfoundation/api/commit/08478f27efda9beb0271fdb22f6972e918361965))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Dependencies
|
|
128
|
+
|
|
129
|
+
* The following workspace dependencies were updated
|
|
130
|
+
* dependencies
|
|
131
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
132
|
+
* @twin.org/api-core bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
133
|
+
* @twin.org/api-models bumped from 0.0.2-next.2 to 0.0.2-next.3
|
|
134
|
+
|
|
135
|
+
## [0.0.2-next.2](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.1...api-auth-entity-storage-service-v0.0.2-next.2) (2025-07-17)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Miscellaneous Chores
|
|
139
|
+
|
|
140
|
+
* **api-auth-entity-storage-service:** Synchronize repo versions
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Dependencies
|
|
144
|
+
|
|
145
|
+
* The following workspace dependencies were updated
|
|
146
|
+
* dependencies
|
|
147
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
148
|
+
* @twin.org/api-core bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
149
|
+
* @twin.org/api-models bumped from 0.0.2-next.1 to 0.0.2-next.2
|
|
150
|
+
|
|
151
|
+
## [0.0.2-next.1](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.2-next.0...api-auth-entity-storage-service-v0.0.2-next.1) (2025-07-08)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Features
|
|
155
|
+
|
|
156
|
+
* add json-ld mime type processor and auth admin component ([8861791](https://github.com/twinfoundation/api/commit/88617916e23bfbca023dbae1976fe421983a02ff))
|
|
157
|
+
* update dependencies ([1171dc4](https://github.com/twinfoundation/api/commit/1171dc416a9481737f6a640e3cf30145768f37e9))
|
|
158
|
+
* use shared store mechanism ([#19](https://github.com/twinfoundation/api/issues/19)) ([32116df](https://github.com/twinfoundation/api/commit/32116df3b4380a30137f5056f242a5c99afa2df9))
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### Dependencies
|
|
162
|
+
|
|
163
|
+
* The following workspace dependencies were updated
|
|
164
|
+
* dependencies
|
|
165
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
166
|
+
* @twin.org/api-core bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
167
|
+
* @twin.org/api-models bumped from 0.0.2-next.0 to 0.0.2-next.1
|
|
168
|
+
|
|
3
169
|
## 0.0.1 (2025-07-03)
|
|
4
170
|
|
|
5
171
|
|
|
@@ -28,14 +28,6 @@ Options for the processor.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### NAMESPACE
|
|
32
|
-
|
|
33
|
-
> `readonly` `static` **NAMESPACE**: `string` = `"auth-header"`
|
|
34
|
-
|
|
35
|
-
The namespace supported by the processor.
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
31
|
### CLASS\_NAME
|
|
40
32
|
|
|
41
33
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -50,7 +42,7 @@ Runtime name for the class.
|
|
|
50
42
|
|
|
51
43
|
### start()
|
|
52
44
|
|
|
53
|
-
> **start**(`nodeIdentity`, `
|
|
45
|
+
> **start**(`nodeIdentity`, `nodeLoggingComponentType?`): `Promise`\<`void`\>
|
|
54
46
|
|
|
55
47
|
The service needs to be started when the application is initialized.
|
|
56
48
|
|
|
@@ -62,11 +54,11 @@ The service needs to be started when the application is initialized.
|
|
|
62
54
|
|
|
63
55
|
The identity of the node.
|
|
64
56
|
|
|
65
|
-
#####
|
|
57
|
+
##### nodeLoggingComponentType?
|
|
66
58
|
|
|
67
59
|
`string`
|
|
68
60
|
|
|
69
|
-
The node logging
|
|
61
|
+
The node logging component type.
|
|
70
62
|
|
|
71
63
|
#### Returns
|
|
72
64
|
|
|
@@ -0,0 +1,141 @@
|
|
|
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
|
|
32
|
+
|
|
33
|
+
> `readonly` **CLASS\_NAME**: `string`
|
|
34
|
+
|
|
35
|
+
Runtime name for the class.
|
|
36
|
+
|
|
37
|
+
#### Implementation of
|
|
38
|
+
|
|
39
|
+
`IAuthenticationAdminComponent.CLASS_NAME`
|
|
40
|
+
|
|
41
|
+
## Methods
|
|
42
|
+
|
|
43
|
+
### create()
|
|
44
|
+
|
|
45
|
+
> **create**(`email`, `password`, `identity`): `Promise`\<`void`\>
|
|
46
|
+
|
|
47
|
+
Create a login for the user.
|
|
48
|
+
|
|
49
|
+
#### Parameters
|
|
50
|
+
|
|
51
|
+
##### email
|
|
52
|
+
|
|
53
|
+
`string`
|
|
54
|
+
|
|
55
|
+
The email address for the user.
|
|
56
|
+
|
|
57
|
+
##### password
|
|
58
|
+
|
|
59
|
+
`string`
|
|
60
|
+
|
|
61
|
+
The password for the user.
|
|
62
|
+
|
|
63
|
+
##### identity
|
|
64
|
+
|
|
65
|
+
`string`
|
|
66
|
+
|
|
67
|
+
The DID to associate with the account.
|
|
68
|
+
|
|
69
|
+
#### Returns
|
|
70
|
+
|
|
71
|
+
`Promise`\<`void`\>
|
|
72
|
+
|
|
73
|
+
Nothing.
|
|
74
|
+
|
|
75
|
+
#### Implementation of
|
|
76
|
+
|
|
77
|
+
`IAuthenticationAdminComponent.create`
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### remove()
|
|
82
|
+
|
|
83
|
+
> **remove**(`email`): `Promise`\<`void`\>
|
|
84
|
+
|
|
85
|
+
Remove the current user.
|
|
86
|
+
|
|
87
|
+
#### Parameters
|
|
88
|
+
|
|
89
|
+
##### email
|
|
90
|
+
|
|
91
|
+
`string`
|
|
92
|
+
|
|
93
|
+
The email address of the user to remove.
|
|
94
|
+
|
|
95
|
+
#### Returns
|
|
96
|
+
|
|
97
|
+
`Promise`\<`void`\>
|
|
98
|
+
|
|
99
|
+
Nothing.
|
|
100
|
+
|
|
101
|
+
#### Implementation of
|
|
102
|
+
|
|
103
|
+
`IAuthenticationAdminComponent.remove`
|
|
104
|
+
|
|
105
|
+
***
|
|
106
|
+
|
|
107
|
+
### updatePassword()
|
|
108
|
+
|
|
109
|
+
> **updatePassword**(`email`, `newPassword`, `currentPassword?`): `Promise`\<`void`\>
|
|
110
|
+
|
|
111
|
+
Update the user's password.
|
|
112
|
+
|
|
113
|
+
#### Parameters
|
|
114
|
+
|
|
115
|
+
##### email
|
|
116
|
+
|
|
117
|
+
`string`
|
|
118
|
+
|
|
119
|
+
The email address of the user to update.
|
|
120
|
+
|
|
121
|
+
##### newPassword
|
|
122
|
+
|
|
123
|
+
`string`
|
|
124
|
+
|
|
125
|
+
The new password for the user.
|
|
126
|
+
|
|
127
|
+
##### currentPassword?
|
|
128
|
+
|
|
129
|
+
`string`
|
|
130
|
+
|
|
131
|
+
The current password, optional, if supplied will check against existing.
|
|
132
|
+
|
|
133
|
+
#### Returns
|
|
134
|
+
|
|
135
|
+
`Promise`\<`void`\>
|
|
136
|
+
|
|
137
|
+
Nothing.
|
|
138
|
+
|
|
139
|
+
#### Implementation of
|
|
140
|
+
|
|
141
|
+
`IAuthenticationAdminComponent.updatePassword`
|
|
@@ -28,14 +28,6 @@ The dependencies for the identity connector.
|
|
|
28
28
|
|
|
29
29
|
## Properties
|
|
30
30
|
|
|
31
|
-
### NAMESPACE
|
|
32
|
-
|
|
33
|
-
> `readonly` `static` **NAMESPACE**: `string` = `"authentication-entity-storage"`
|
|
34
|
-
|
|
35
|
-
The namespace supported by the authentication service.
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
31
|
### CLASS\_NAME
|
|
40
32
|
|
|
41
33
|
> `readonly` **CLASS\_NAME**: `string`
|
|
@@ -50,7 +42,7 @@ Runtime name for the class.
|
|
|
50
42
|
|
|
51
43
|
### start()
|
|
52
44
|
|
|
53
|
-
> **start**(`nodeIdentity`, `
|
|
45
|
+
> **start**(`nodeIdentity`, `nodeLoggingComponentType?`): `Promise`\<`void`\>
|
|
54
46
|
|
|
55
47
|
The service needs to be started when the application is initialized.
|
|
56
48
|
|
|
@@ -62,11 +54,11 @@ The service needs to be started when the application is initialized.
|
|
|
62
54
|
|
|
63
55
|
The identity of the node.
|
|
64
56
|
|
|
65
|
-
#####
|
|
57
|
+
##### nodeLoggingComponentType?
|
|
66
58
|
|
|
67
59
|
`string`
|
|
68
60
|
|
|
69
|
-
The node logging
|
|
61
|
+
The node logging component type.
|
|
70
62
|
|
|
71
63
|
#### Returns
|
|
72
64
|
|
|
@@ -161,3 +153,41 @@ The refreshed token, if it uses a mechanism with public access.
|
|
|
161
153
|
#### Implementation of
|
|
162
154
|
|
|
163
155
|
`IAuthenticationComponent.refresh`
|
|
156
|
+
|
|
157
|
+
***
|
|
158
|
+
|
|
159
|
+
### updatePassword()
|
|
160
|
+
|
|
161
|
+
> **updatePassword**(`email`, `currentPassword`, `newPassword`): `Promise`\<`void`\>
|
|
162
|
+
|
|
163
|
+
Update the user's password.
|
|
164
|
+
|
|
165
|
+
#### Parameters
|
|
166
|
+
|
|
167
|
+
##### email
|
|
168
|
+
|
|
169
|
+
`string`
|
|
170
|
+
|
|
171
|
+
The email address of the user to update.
|
|
172
|
+
|
|
173
|
+
##### currentPassword
|
|
174
|
+
|
|
175
|
+
`string`
|
|
176
|
+
|
|
177
|
+
The current password for the user.
|
|
178
|
+
|
|
179
|
+
##### newPassword
|
|
180
|
+
|
|
181
|
+
`string`
|
|
182
|
+
|
|
183
|
+
The new password for the user.
|
|
184
|
+
|
|
185
|
+
#### Returns
|
|
186
|
+
|
|
187
|
+
`Promise`\<`void`\>
|
|
188
|
+
|
|
189
|
+
Nothing.
|
|
190
|
+
|
|
191
|
+
#### Implementation of
|
|
192
|
+
|
|
193
|
+
`IAuthenticationComponent.updatePassword`
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationUpdatePassword()
|
|
2
|
+
|
|
3
|
+
> **authenticationUpdatePassword**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
|
|
4
|
+
|
|
5
|
+
Update the user's password.
|
|
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
|
+
`IUpdatePasswordRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`INoContentResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
package/docs/reference/index.md
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
- [AuthenticationUser](classes/AuthenticationUser.md)
|
|
6
6
|
- [AuthHeaderProcessor](classes/AuthHeaderProcessor.md)
|
|
7
|
+
- [EntityStorageAuthenticationAdminService](classes/EntityStorageAuthenticationAdminService.md)
|
|
7
8
|
- [EntityStorageAuthenticationService](classes/EntityStorageAuthenticationService.md)
|
|
8
9
|
- [PasswordHelper](classes/PasswordHelper.md)
|
|
9
10
|
- [TokenHelper](classes/TokenHelper.md)
|
|
@@ -12,6 +13,8 @@
|
|
|
12
13
|
|
|
13
14
|
- [IAuthHeaderProcessorConfig](interfaces/IAuthHeaderProcessorConfig.md)
|
|
14
15
|
- [IAuthHeaderProcessorConstructorOptions](interfaces/IAuthHeaderProcessorConstructorOptions.md)
|
|
16
|
+
- [IEntityStorageAuthenticationAdminServiceConfig](interfaces/IEntityStorageAuthenticationAdminServiceConfig.md)
|
|
17
|
+
- [IEntityStorageAuthenticationAdminServiceConstructorOptions](interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md)
|
|
15
18
|
- [IEntityStorageAuthenticationServiceConfig](interfaces/IEntityStorageAuthenticationServiceConfig.md)
|
|
16
19
|
- [IEntityStorageAuthenticationServiceConstructorOptions](interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md)
|
|
17
20
|
|
|
@@ -26,4 +29,5 @@
|
|
|
26
29
|
- [authenticationLogin](functions/authenticationLogin.md)
|
|
27
30
|
- [authenticationLogout](functions/authenticationLogout.md)
|
|
28
31
|
- [authenticationRefreshToken](functions/authenticationRefreshToken.md)
|
|
32
|
+
- [authenticationUpdatePassword](functions/authenticationUpdatePassword.md)
|
|
29
33
|
- [initSchema](functions/initSchema.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Interface: IEntityStorageAuthenticationAdminServiceConfig
|
|
2
|
+
|
|
3
|
+
Configuration for the entity storage authentication admin service.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### minPasswordLength?
|
|
8
|
+
|
|
9
|
+
> `optional` **minPasswordLength**: `number`
|
|
10
|
+
|
|
11
|
+
The minimum password length.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
8
|
|
17
|
+
```
|
package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Interface: IEntityStorageAuthenticationAdminServiceConstructorOptions
|
|
2
|
+
|
|
3
|
+
Options for the EntityStorageAuthenticationAdminService constructor.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
### userEntityStorageType?
|
|
8
|
+
|
|
9
|
+
> `optional` **userEntityStorageType**: `string`
|
|
10
|
+
|
|
11
|
+
The entity storage for the users.
|
|
12
|
+
|
|
13
|
+
#### Default
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
authentication-user
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
***
|
|
20
|
+
|
|
21
|
+
### config?
|
|
22
|
+
|
|
23
|
+
> `optional` **config**: [`IEntityStorageAuthenticationAdminServiceConfig`](IEntityStorageAuthenticationAdminServiceConfig.md)
|
|
24
|
+
|
|
25
|
+
The configuration for the authentication.
|
|
@@ -32,6 +32,20 @@ vault
|
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
35
|
+
### authenticationAdminServiceType?
|
|
36
|
+
|
|
37
|
+
> `optional` **authenticationAdminServiceType**: `string`
|
|
38
|
+
|
|
39
|
+
The admin service.
|
|
40
|
+
|
|
41
|
+
#### Default
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
authentication-admin
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
35
49
|
### config?
|
|
36
50
|
|
|
37
51
|
> `optional` **config**: [`IEntityStorageAuthenticationServiceConfig`](IEntityStorageAuthenticationServiceConfig.md)
|
package/locales/en.json
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
"userNotFound": "The user with the specified e-mail could not be found",
|
|
7
7
|
"passwordMismatch": "The password does not match the user's password"
|
|
8
8
|
},
|
|
9
|
+
"entityStorageAuthenticationAdminService": {
|
|
10
|
+
"userExists": "The user with the specified e-mail already exists",
|
|
11
|
+
"createFailed": "Creating the user failed",
|
|
12
|
+
"removeFailed": "Removing the user failed",
|
|
13
|
+
"updatePasswordFailed": "Updating the user's password failed",
|
|
14
|
+
"passwordTooShort": "The password is too short, it must be at least {minLength} characters long",
|
|
15
|
+
"userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\"",
|
|
16
|
+
"currentPasswordMismatch": "The current password is incorrect"
|
|
17
|
+
},
|
|
9
18
|
"entityStorageAuthenticationProcessor": {
|
|
10
19
|
"initializeFailed": "The JSON Web token authentication processor could not be initialized"
|
|
11
20
|
},
|