@twin.org/api-auth-entity-storage-service 0.0.3-next.17 → 0.0.3-next.19
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/es/entities/authenticationUser.js +9 -1
- package/dist/es/entities/authenticationUser.js.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/processors/authHeaderProcessor.js +1 -1
- package/dist/es/processors/authHeaderProcessor.js.map +1 -1
- package/dist/es/restEntryPoints.js +7 -0
- package/dist/es/restEntryPoints.js.map +1 -1
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js +362 -0
- package/dist/es/routes/entityStorageAuthenticationAdminRoutes.js.map +1 -0
- package/dist/es/routes/entityStorageAuthenticationRoutes.js +4 -8
- package/dist/es/routes/entityStorageAuthenticationRoutes.js.map +1 -1
- package/dist/es/services/entityStorageAuthenticationAdminService.js +110 -41
- package/dist/es/services/entityStorageAuthenticationAdminService.js.map +1 -1
- package/dist/es/services/entityStorageAuthenticationService.js +16 -10
- package/dist/es/services/entityStorageAuthenticationService.js.map +1 -1
- package/dist/es/utils/tokenHelper.js +16 -3
- package/dist/es/utils/tokenHelper.js.map +1 -1
- package/dist/types/entities/authenticationUser.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/routes/entityStorageAuthenticationAdminRoutes.d.ts +61 -0
- package/dist/types/services/entityStorageAuthenticationAdminService.d.ts +21 -6
- package/dist/types/services/entityStorageAuthenticationService.d.ts +1 -2
- package/dist/types/utils/tokenHelper.d.ts +4 -2
- package/docs/changelog.md +32 -0
- package/docs/reference/classes/AuthenticationUser.md +8 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +73 -13
- package/docs/reference/classes/EntityStorageAuthenticationService.md +1 -7
- package/docs/reference/classes/TokenHelper.md +14 -2
- package/docs/reference/functions/authenticationAdminCreateUser.md +31 -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/generateRestRoutesAuthenticationAdmin.md +25 -0
- package/docs/reference/index.md +8 -1
- package/docs/reference/variables/tagsAuthenticationAdmin.md +5 -0
- package/locales/en.json +4 -2
- package/package.json +4 -4
- package/dist/es/utils/passwordHelper.js +0 -29
- package/dist/es/utils/passwordHelper.js.map +0 -1
- package/dist/types/utils/passwordHelper.d.ts +0 -16
- package/docs/reference/classes/PasswordHelper.md +0 -49
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { IAdminUserCreateRequest, IAdminUserGetByIdentityRequest, IAdminUserGetRequest, IAdminUserGetResponse, IAdminUserRemoveRequest, IAdminUserUpdatePasswordRequest, IAdminUserUpdateRequest } from "@twin.org/api-auth-entity-storage-models";
|
|
2
|
+
import type { ICreatedResponse, IHttpRequestContext, INoContentResponse, IRestRoute, ITag } from "@twin.org/api-models";
|
|
3
|
+
/**
|
|
4
|
+
* The tag to associate with the routes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const tagsAuthenticationAdmin: ITag[];
|
|
7
|
+
/**
|
|
8
|
+
* The REST routes for authentication admin.
|
|
9
|
+
* @param baseRouteName Prefix to prepend to the paths.
|
|
10
|
+
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
11
|
+
* @returns The generated routes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateRestRoutesAuthenticationAdmin(baseRouteName: string, componentName: string): IRestRoute[];
|
|
14
|
+
/**
|
|
15
|
+
* Create a new user.
|
|
16
|
+
* @param httpRequestContext The request context for the API.
|
|
17
|
+
* @param componentName The name of the component to use in the routes.
|
|
18
|
+
* @param request The request.
|
|
19
|
+
* @returns The response object with additional http response properties.
|
|
20
|
+
*/
|
|
21
|
+
export declare function authenticationAdminCreateUser(httpRequestContext: IHttpRequestContext, componentName: string, request: IAdminUserCreateRequest): Promise<ICreatedResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Update an existing user.
|
|
24
|
+
* @param httpRequestContext The request context for the API.
|
|
25
|
+
* @param componentName The name of the component to use in the routes.
|
|
26
|
+
* @param request The request.
|
|
27
|
+
* @returns The response object with additional http response properties.
|
|
28
|
+
*/
|
|
29
|
+
export declare function authenticationAdminUpdateUser(httpRequestContext: IHttpRequestContext, componentName: string, request: IAdminUserUpdateRequest): Promise<INoContentResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Update an existing user password.
|
|
32
|
+
* @param httpRequestContext The request context for the API.
|
|
33
|
+
* @param componentName The name of the component to use in the routes.
|
|
34
|
+
* @param request The request.
|
|
35
|
+
* @returns The response object with additional http response properties.
|
|
36
|
+
*/
|
|
37
|
+
export declare function authenticationAdminUpdateUserPassword(httpRequestContext: IHttpRequestContext, componentName: string, request: IAdminUserUpdatePasswordRequest): Promise<INoContentResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* Get an existing user.
|
|
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 authenticationAdminGetUser(httpRequestContext: IHttpRequestContext, componentName: string, request: IAdminUserGetRequest): Promise<IAdminUserGetResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Get an existing user by identity.
|
|
48
|
+
* @param httpRequestContext The request context for the API.
|
|
49
|
+
* @param componentName The name of the component to use in the routes.
|
|
50
|
+
* @param request The request.
|
|
51
|
+
* @returns The response object with additional http response properties.
|
|
52
|
+
*/
|
|
53
|
+
export declare function authenticationAdminGetUserByIdentity(httpRequestContext: IHttpRequestContext, componentName: string, request: IAdminUserGetByIdentityRequest): Promise<IAdminUserGetResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Remove an existing user.
|
|
56
|
+
* @param httpRequestContext The request context for the API.
|
|
57
|
+
* @param componentName The name of the component to use in the routes.
|
|
58
|
+
* @param request The request.
|
|
59
|
+
* @returns The response object with additional http response properties.
|
|
60
|
+
*/
|
|
61
|
+
export declare function authenticationAdminRemoveUser(httpRequestContext: IHttpRequestContext, componentName: string, request: IAdminUserRemoveRequest): Promise<INoContentResponse>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAuthenticationAdminComponent } from "@twin.org/api-auth-entity-storage-models";
|
|
1
|
+
import type { IAuthenticationAdminComponent, IAuthenticationUser } from "@twin.org/api-auth-entity-storage-models";
|
|
2
2
|
import type { IEntityStorageAuthenticationAdminServiceConstructorOptions } from "../models/IEntityStorageAuthenticationAdminServiceConstructorOptions.js";
|
|
3
3
|
/**
|
|
4
4
|
* Implementation of the authentication component using entity storage.
|
|
@@ -20,13 +20,28 @@ export declare class EntityStorageAuthenticationAdminService implements IAuthent
|
|
|
20
20
|
className(): string;
|
|
21
21
|
/**
|
|
22
22
|
* Create a login for the user.
|
|
23
|
-
* @param
|
|
24
|
-
* @param password The password for the user.
|
|
25
|
-
* @param userIdentity The DID to associate with the account.
|
|
26
|
-
* @param organizationIdentity The organization of the user.
|
|
23
|
+
* @param user The user to create.
|
|
27
24
|
* @returns Nothing.
|
|
28
25
|
*/
|
|
29
|
-
create(
|
|
26
|
+
create(user: Omit<IAuthenticationUser, "salt">): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Update a login for the user.
|
|
29
|
+
* @param user The user to update.
|
|
30
|
+
* @returns Nothing.
|
|
31
|
+
*/
|
|
32
|
+
update(user: Partial<Omit<IAuthenticationUser, "password" | "salt">>): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a user by email.
|
|
35
|
+
* @param email The email address of the user to get.
|
|
36
|
+
* @returns The user details.
|
|
37
|
+
*/
|
|
38
|
+
get(email: string): Promise<Omit<IAuthenticationUser, "password" | "salt">>;
|
|
39
|
+
/**
|
|
40
|
+
* Get a user by identity.
|
|
41
|
+
* @param identity The identity of the user to get.
|
|
42
|
+
* @returns The user details.
|
|
43
|
+
*/
|
|
44
|
+
getByIdentity(identity: string): Promise<Omit<IAuthenticationUser, "password" | "salt">>;
|
|
30
45
|
/**
|
|
31
46
|
* Remove the current user.
|
|
32
47
|
* @param email The email address of the user to remove.
|
|
@@ -51,10 +51,9 @@ export declare class EntityStorageAuthenticationService implements IAuthenticati
|
|
|
51
51
|
}>;
|
|
52
52
|
/**
|
|
53
53
|
* Update the user's password.
|
|
54
|
-
* @param email The email address of the user to update.
|
|
55
54
|
* @param currentPassword The current password for the user.
|
|
56
55
|
* @param newPassword The new password for the user.
|
|
57
56
|
* @returns Nothing.
|
|
58
57
|
*/
|
|
59
|
-
updatePassword(
|
|
58
|
+
updatePassword(currentPassword: string, newPassword: string): Promise<void>;
|
|
60
59
|
}
|
|
@@ -16,9 +16,10 @@ export declare class TokenHelper {
|
|
|
16
16
|
* @param organizationIdentity The organization for the token.
|
|
17
17
|
* @param tenantId The tenant id for the token.
|
|
18
18
|
* @param ttlMinutes The time to live for the token in minutes.
|
|
19
|
+
* @param scope The scopes for the token.
|
|
19
20
|
* @returns The new token and its expiry date.
|
|
20
21
|
*/
|
|
21
|
-
static createToken(vaultConnector: IVaultConnector, signingKeyName: string, userIdentity: string, organizationIdentity: string | undefined, tenantId: string | undefined, ttlMinutes: number): Promise<{
|
|
22
|
+
static createToken(vaultConnector: IVaultConnector, signingKeyName: string, userIdentity: string, organizationIdentity: string | undefined, tenantId: string | undefined, ttlMinutes: number, scope?: string): Promise<{
|
|
22
23
|
token: string;
|
|
23
24
|
expiry: number;
|
|
24
25
|
}>;
|
|
@@ -27,10 +28,11 @@ export declare class TokenHelper {
|
|
|
27
28
|
* @param vaultConnector The vault connector.
|
|
28
29
|
* @param signingKeyName The signing key name.
|
|
29
30
|
* @param token The token to verify.
|
|
31
|
+
* @param requiredScopes The required scopes.
|
|
30
32
|
* @returns The verified details.
|
|
31
33
|
* @throws UnauthorizedError if the token is missing, invalid or expired.
|
|
32
34
|
*/
|
|
33
|
-
static verify(vaultConnector: IVaultConnector, signingKeyName: string, token: string | undefined): Promise<{
|
|
35
|
+
static verify(vaultConnector: IVaultConnector, signingKeyName: string, token: string | undefined, requiredScopes?: string[]): Promise<{
|
|
34
36
|
header: IJwtHeader;
|
|
35
37
|
payload: IJwtPayload;
|
|
36
38
|
}>;
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @twin.org/api-auth-entity-storage-service - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.19](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.3-next.18...api-auth-entity-storage-service-v0.0.3-next.19) (2026-02-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* user admin service ([#77](https://github.com/twinfoundation/api/issues/77)) ([c8491df](https://github.com/twinfoundation/api/commit/c8491df7b07c1f45560c8a78c6adc806d0ececbb))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
16
|
+
* @twin.org/api-core bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
17
|
+
* @twin.org/api-models bumped from 0.0.3-next.18 to 0.0.3-next.19
|
|
18
|
+
|
|
19
|
+
## [0.0.3-next.18](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.3-next.17...api-auth-entity-storage-service-v0.0.3-next.18) (2026-02-04)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* tenant api and scopes ([#75](https://github.com/twinfoundation/api/issues/75)) ([c663141](https://github.com/twinfoundation/api/commit/c663141091e8974d769f8f9904ecdab009ebd083))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Dependencies
|
|
28
|
+
|
|
29
|
+
* The following workspace dependencies were updated
|
|
30
|
+
* dependencies
|
|
31
|
+
* @twin.org/api-auth-entity-storage-models bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
32
|
+
* @twin.org/api-core bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
33
|
+
* @twin.org/api-models bumped from 0.0.3-next.17 to 0.0.3-next.18
|
|
34
|
+
|
|
3
35
|
## [0.0.3-next.17](https://github.com/twinfoundation/api/compare/api-auth-entity-storage-service-v0.0.3-next.16...api-auth-entity-storage-service-v0.0.3-next.17) (2026-01-26)
|
|
4
36
|
|
|
5
37
|
|
|
@@ -56,45 +56,105 @@ The class name of the component.
|
|
|
56
56
|
|
|
57
57
|
### create()
|
|
58
58
|
|
|
59
|
-
> **create**(`
|
|
59
|
+
> **create**(`user`): `Promise`\<`void`\>
|
|
60
60
|
|
|
61
61
|
Create a login for the user.
|
|
62
62
|
|
|
63
63
|
#### Parameters
|
|
64
64
|
|
|
65
|
+
##### user
|
|
66
|
+
|
|
67
|
+
`Omit`\<`IAuthenticationUser`, `"salt"`\>
|
|
68
|
+
|
|
69
|
+
The user to create.
|
|
70
|
+
|
|
71
|
+
#### Returns
|
|
72
|
+
|
|
73
|
+
`Promise`\<`void`\>
|
|
74
|
+
|
|
75
|
+
Nothing.
|
|
76
|
+
|
|
77
|
+
#### Implementation of
|
|
78
|
+
|
|
79
|
+
`IAuthenticationAdminComponent.create`
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### update()
|
|
84
|
+
|
|
85
|
+
> **update**(`user`): `Promise`\<`void`\>
|
|
86
|
+
|
|
87
|
+
Update a login for the user.
|
|
88
|
+
|
|
89
|
+
#### Parameters
|
|
90
|
+
|
|
91
|
+
##### user
|
|
92
|
+
|
|
93
|
+
`Partial`\<`Omit`\<`IAuthenticationUser`, `"password"` \| `"salt"`\>\>
|
|
94
|
+
|
|
95
|
+
The user to update.
|
|
96
|
+
|
|
97
|
+
#### Returns
|
|
98
|
+
|
|
99
|
+
`Promise`\<`void`\>
|
|
100
|
+
|
|
101
|
+
Nothing.
|
|
102
|
+
|
|
103
|
+
#### Implementation of
|
|
104
|
+
|
|
105
|
+
`IAuthenticationAdminComponent.update`
|
|
106
|
+
|
|
107
|
+
***
|
|
108
|
+
|
|
109
|
+
### get()
|
|
110
|
+
|
|
111
|
+
> **get**(`email`): `Promise`\<`Omit`\<`IAuthenticationUser`, `"salt"` \| `"password"`\>\>
|
|
112
|
+
|
|
113
|
+
Get a user by email.
|
|
114
|
+
|
|
115
|
+
#### Parameters
|
|
116
|
+
|
|
65
117
|
##### email
|
|
66
118
|
|
|
67
119
|
`string`
|
|
68
120
|
|
|
69
|
-
The email address
|
|
121
|
+
The email address of the user to get.
|
|
70
122
|
|
|
71
|
-
|
|
123
|
+
#### Returns
|
|
72
124
|
|
|
73
|
-
`
|
|
125
|
+
`Promise`\<`Omit`\<`IAuthenticationUser`, `"salt"` \| `"password"`\>\>
|
|
74
126
|
|
|
75
|
-
The
|
|
127
|
+
The user details.
|
|
76
128
|
|
|
77
|
-
|
|
129
|
+
#### Implementation of
|
|
78
130
|
|
|
79
|
-
`
|
|
131
|
+
`IAuthenticationAdminComponent.get`
|
|
132
|
+
|
|
133
|
+
***
|
|
134
|
+
|
|
135
|
+
### getByIdentity()
|
|
80
136
|
|
|
81
|
-
|
|
137
|
+
> **getByIdentity**(`identity`): `Promise`\<`Omit`\<`IAuthenticationUser`, `"salt"` \| `"password"`\>\>
|
|
82
138
|
|
|
83
|
-
|
|
139
|
+
Get a user by identity.
|
|
140
|
+
|
|
141
|
+
#### Parameters
|
|
142
|
+
|
|
143
|
+
##### identity
|
|
84
144
|
|
|
85
145
|
`string`
|
|
86
146
|
|
|
87
|
-
The
|
|
147
|
+
The identity of the user to get.
|
|
88
148
|
|
|
89
149
|
#### Returns
|
|
90
150
|
|
|
91
|
-
`Promise`\<`
|
|
151
|
+
`Promise`\<`Omit`\<`IAuthenticationUser`, `"salt"` \| `"password"`\>\>
|
|
92
152
|
|
|
93
|
-
|
|
153
|
+
The user details.
|
|
94
154
|
|
|
95
155
|
#### Implementation of
|
|
96
156
|
|
|
97
|
-
`IAuthenticationAdminComponent.
|
|
157
|
+
`IAuthenticationAdminComponent.getByIdentity`
|
|
98
158
|
|
|
99
159
|
***
|
|
100
160
|
|
|
@@ -166,18 +166,12 @@ The refreshed token, if it uses a mechanism with public access.
|
|
|
166
166
|
|
|
167
167
|
### updatePassword()
|
|
168
168
|
|
|
169
|
-
> **updatePassword**(`
|
|
169
|
+
> **updatePassword**(`currentPassword`, `newPassword`): `Promise`\<`void`\>
|
|
170
170
|
|
|
171
171
|
Update the user's password.
|
|
172
172
|
|
|
173
173
|
#### Parameters
|
|
174
174
|
|
|
175
|
-
##### email
|
|
176
|
-
|
|
177
|
-
`string`
|
|
178
|
-
|
|
179
|
-
The email address of the user to update.
|
|
180
|
-
|
|
181
175
|
##### currentPassword
|
|
182
176
|
|
|
183
177
|
`string`
|
|
@@ -24,7 +24,7 @@ Runtime name for the class.
|
|
|
24
24
|
|
|
25
25
|
### createToken()
|
|
26
26
|
|
|
27
|
-
> `static` **createToken**(`vaultConnector`, `signingKeyName`, `userIdentity`, `organizationIdentity`, `tenantId`, `ttlMinutes`): `Promise`\<\{ `token`: `string`; `expiry`: `number`; \}\>
|
|
27
|
+
> `static` **createToken**(`vaultConnector`, `signingKeyName`, `userIdentity`, `organizationIdentity`, `tenantId`, `ttlMinutes`, `scope?`): `Promise`\<\{ `token`: `string`; `expiry`: `number`; \}\>
|
|
28
28
|
|
|
29
29
|
Create a new token.
|
|
30
30
|
|
|
@@ -66,6 +66,12 @@ The tenant id for the token.
|
|
|
66
66
|
|
|
67
67
|
The time to live for the token in minutes.
|
|
68
68
|
|
|
69
|
+
##### scope?
|
|
70
|
+
|
|
71
|
+
`string`
|
|
72
|
+
|
|
73
|
+
The scopes for the token.
|
|
74
|
+
|
|
69
75
|
#### Returns
|
|
70
76
|
|
|
71
77
|
`Promise`\<\{ `token`: `string`; `expiry`: `number`; \}\>
|
|
@@ -76,7 +82,7 @@ The new token and its expiry date.
|
|
|
76
82
|
|
|
77
83
|
### verify()
|
|
78
84
|
|
|
79
|
-
> `static` **verify**(`vaultConnector`, `signingKeyName`, `token`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
|
|
85
|
+
> `static` **verify**(`vaultConnector`, `signingKeyName`, `token`, `requiredScopes?`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
|
|
80
86
|
|
|
81
87
|
Verify the token.
|
|
82
88
|
|
|
@@ -100,6 +106,12 @@ The token to verify.
|
|
|
100
106
|
|
|
101
107
|
`string` | `undefined`
|
|
102
108
|
|
|
109
|
+
##### requiredScopes?
|
|
110
|
+
|
|
111
|
+
`string`[]
|
|
112
|
+
|
|
113
|
+
The required scopes.
|
|
114
|
+
|
|
103
115
|
#### Returns
|
|
104
116
|
|
|
105
117
|
`Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationAdminCreateUser()
|
|
2
|
+
|
|
3
|
+
> **authenticationAdminCreateUser**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`ICreatedResponse`\>
|
|
4
|
+
|
|
5
|
+
Create a new user.
|
|
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
|
+
`IAdminUserCreateRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`ICreatedResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationAdminGetUser()
|
|
2
|
+
|
|
3
|
+
> **authenticationAdminGetUser**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAdminUserGetResponse`\>
|
|
4
|
+
|
|
5
|
+
Get an existing user.
|
|
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
|
+
`IAdminUserGetRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`IAdminUserGetResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationAdminGetUserByIdentity()
|
|
2
|
+
|
|
3
|
+
> **authenticationAdminGetUserByIdentity**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`IAdminUserGetResponse`\>
|
|
4
|
+
|
|
5
|
+
Get an existing user by identity.
|
|
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
|
+
`IAdminUserGetByIdentityRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`IAdminUserGetResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationAdminRemoveUser()
|
|
2
|
+
|
|
3
|
+
> **authenticationAdminRemoveUser**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
|
|
4
|
+
|
|
5
|
+
Remove an existing user.
|
|
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
|
+
`IAdminUserRemoveRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`INoContentResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationAdminUpdateUser()
|
|
2
|
+
|
|
3
|
+
> **authenticationAdminUpdateUser**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
|
|
4
|
+
|
|
5
|
+
Update an existing user.
|
|
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
|
+
`IAdminUserUpdateRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`INoContentResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: authenticationAdminUpdateUserPassword()
|
|
2
|
+
|
|
3
|
+
> **authenticationAdminUpdateUserPassword**(`httpRequestContext`, `componentName`, `request`): `Promise`\<`INoContentResponse`\>
|
|
4
|
+
|
|
5
|
+
Update an existing user 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
|
+
`IAdminUserUpdatePasswordRequest`
|
|
24
|
+
|
|
25
|
+
The request.
|
|
26
|
+
|
|
27
|
+
## Returns
|
|
28
|
+
|
|
29
|
+
`Promise`\<`INoContentResponse`\>
|
|
30
|
+
|
|
31
|
+
The response object with additional http response properties.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: generateRestRoutesAuthenticationAdmin()
|
|
2
|
+
|
|
3
|
+
> **generateRestRoutesAuthenticationAdmin**(`baseRouteName`, `componentName`): `IRestRoute`\<`any`, `any`\>[]
|
|
4
|
+
|
|
5
|
+
The REST routes for authentication admin.
|
|
6
|
+
|
|
7
|
+
## Parameters
|
|
8
|
+
|
|
9
|
+
### baseRouteName
|
|
10
|
+
|
|
11
|
+
`string`
|
|
12
|
+
|
|
13
|
+
Prefix to prepend to the paths.
|
|
14
|
+
|
|
15
|
+
### componentName
|
|
16
|
+
|
|
17
|
+
`string`
|
|
18
|
+
|
|
19
|
+
The name of the component to use in the routes stored in the ComponentFactory.
|
|
20
|
+
|
|
21
|
+
## Returns
|
|
22
|
+
|
|
23
|
+
`IRestRoute`\<`any`, `any`\>[]
|
|
24
|
+
|
|
25
|
+
The generated routes.
|
package/docs/reference/index.md
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
- [AuthHeaderProcessor](classes/AuthHeaderProcessor.md)
|
|
7
7
|
- [EntityStorageAuthenticationAdminService](classes/EntityStorageAuthenticationAdminService.md)
|
|
8
8
|
- [EntityStorageAuthenticationService](classes/EntityStorageAuthenticationService.md)
|
|
9
|
-
- [PasswordHelper](classes/PasswordHelper.md)
|
|
10
9
|
- [TokenHelper](classes/TokenHelper.md)
|
|
11
10
|
|
|
12
11
|
## Interfaces
|
|
@@ -21,10 +20,18 @@
|
|
|
21
20
|
## Variables
|
|
22
21
|
|
|
23
22
|
- [restEntryPoints](variables/restEntryPoints.md)
|
|
23
|
+
- [tagsAuthenticationAdmin](variables/tagsAuthenticationAdmin.md)
|
|
24
24
|
- [tagsAuthentication](variables/tagsAuthentication.md)
|
|
25
25
|
|
|
26
26
|
## Functions
|
|
27
27
|
|
|
28
|
+
- [generateRestRoutesAuthenticationAdmin](functions/generateRestRoutesAuthenticationAdmin.md)
|
|
29
|
+
- [authenticationAdminCreateUser](functions/authenticationAdminCreateUser.md)
|
|
30
|
+
- [authenticationAdminUpdateUser](functions/authenticationAdminUpdateUser.md)
|
|
31
|
+
- [authenticationAdminUpdateUserPassword](functions/authenticationAdminUpdateUserPassword.md)
|
|
32
|
+
- [authenticationAdminGetUser](functions/authenticationAdminGetUser.md)
|
|
33
|
+
- [authenticationAdminGetUserByIdentity](functions/authenticationAdminGetUserByIdentity.md)
|
|
34
|
+
- [authenticationAdminRemoveUser](functions/authenticationAdminRemoveUser.md)
|
|
28
35
|
- [generateRestRoutesAuthentication](functions/generateRestRoutesAuthentication.md)
|
|
29
36
|
- [authenticationLogin](functions/authenticationLogin.md)
|
|
30
37
|
- [authenticationLogout](functions/authenticationLogout.md)
|
package/locales/en.json
CHANGED
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
"entityStorageAuthenticationAdminService": {
|
|
9
9
|
"userExists": "The user with the specified e-mail already exists",
|
|
10
10
|
"createUserFailed": "Creating the user failed",
|
|
11
|
+
"getUserFailed": "Getting the user failed",
|
|
12
|
+
"updateUserFailed": "Updating the user failed",
|
|
11
13
|
"removeUserFailed": "Removing the user failed",
|
|
12
14
|
"updatePasswordFailed": "Updating the user's password failed",
|
|
13
|
-
"passwordTooShort": "The password is too short, it must be at least {minLength} characters long",
|
|
14
15
|
"userNotFound": "The user with the specified e-mail could not be found \"{notFoundId}\"",
|
|
15
16
|
"currentPasswordMismatch": "The current password is incorrect"
|
|
16
17
|
},
|
|
@@ -18,7 +19,8 @@
|
|
|
18
19
|
"missing": "The JSON Web token could not be found in the authorization header",
|
|
19
20
|
"payloadMissingSubject": "The JSON Web token payload does not contain a subject",
|
|
20
21
|
"payloadMissingOrganization": "The JSON Web token payload does not contain an organization",
|
|
21
|
-
"expired": "The JSON Web token has expired"
|
|
22
|
+
"expired": "The JSON Web token has expired",
|
|
23
|
+
"insufficientScopes": "The JSON Web token does not have the required scopes to access this resource"
|
|
22
24
|
},
|
|
23
25
|
"authHeaderProcessor": {
|
|
24
26
|
"tenantIdMismatch": "The tenant ID in the token does not match the tenant ID in the context"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/api-auth-entity-storage-service",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.19",
|
|
4
4
|
"description": "Auth Entity Storage contract implementation and REST endpoint definitions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/api-auth-entity-storage-models": "0.0.3-next.
|
|
18
|
-
"@twin.org/api-core": "0.0.3-next.
|
|
19
|
-
"@twin.org/api-models": "0.0.3-next.
|
|
17
|
+
"@twin.org/api-auth-entity-storage-models": "0.0.3-next.19",
|
|
18
|
+
"@twin.org/api-core": "0.0.3-next.19",
|
|
19
|
+
"@twin.org/api-models": "0.0.3-next.19",
|
|
20
20
|
"@twin.org/context": "next",
|
|
21
21
|
"@twin.org/core": "next",
|
|
22
22
|
"@twin.org/crypto": "next",
|