@twin.org/api-auth-entity-storage-service 0.0.3-next.2 → 0.0.3-next.21
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/README.md +2 -2
- 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 +23 -9
- 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 +12 -12
- 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 +21 -10
- package/dist/es/services/entityStorageAuthenticationService.js.map +1 -1
- package/dist/es/utils/tokenHelper.js +25 -18
- 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 +2 -3
- package/dist/types/utils/tokenHelper.d.ts +5 -2
- package/docs/changelog.md +338 -1
- package/docs/examples.md +88 -1
- package/docs/reference/classes/AuthenticationUser.md +8 -0
- package/docs/reference/classes/EntityStorageAuthenticationAdminService.md +73 -13
- package/docs/reference/classes/EntityStorageAuthenticationService.md +3 -9
- package/docs/reference/classes/TokenHelper.md +20 -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/interfaces/IAuthHeaderProcessorConfig.md +0 -12
- package/docs/reference/interfaces/IAuthHeaderProcessorConstructorOptions.md +0 -6
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConfig.md +0 -6
- package/docs/reference/interfaces/IEntityStorageAuthenticationAdminServiceConstructorOptions.md +0 -6
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConfig.md +0 -12
- package/docs/reference/interfaces/IEntityStorageAuthenticationServiceConstructorOptions.md +0 -18
- package/docs/reference/variables/tagsAuthenticationAdmin.md +5 -0
- package/locales/en.json +7 -2
- package/package.json +5 -5
- 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
package/docs/examples.md
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Auth Entity Storage Service Examples
|
|
2
|
+
|
|
3
|
+
These snippets show how to wire authentication services into your component container and apply token processing in request pipelines.
|
|
4
|
+
|
|
5
|
+
## EntityStorageAuthenticationAdminService
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { EntityStorageAuthenticationAdminService } from '@twin.org/api-auth-entity-storage-service';
|
|
9
|
+
|
|
10
|
+
const adminService = new EntityStorageAuthenticationAdminService();
|
|
11
|
+
|
|
12
|
+
console.log(adminService.className()); // EntityStorageAuthenticationAdminService
|
|
13
|
+
|
|
14
|
+
await adminService.create({
|
|
15
|
+
email: 'owner@example.org',
|
|
16
|
+
password: 'StartPassword123',
|
|
17
|
+
userIdentity: 'did:example:owner',
|
|
18
|
+
organizationIdentity: 'did:example:org',
|
|
19
|
+
scope: ['admin']
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
await adminService.update({
|
|
23
|
+
email: 'owner@example.org',
|
|
24
|
+
scope: ['admin', 'security']
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
await adminService.updatePassword('owner@example.org', 'StartPassword124', 'StartPassword123');
|
|
28
|
+
|
|
29
|
+
const fromIdentity = await adminService.getByIdentity('did:example:owner');
|
|
30
|
+
console.log(fromIdentity.scope.length); // 2
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import { EntityStorageAuthenticationAdminService } from '@twin.org/api-auth-entity-storage-service';
|
|
35
|
+
|
|
36
|
+
const adminService = new EntityStorageAuthenticationAdminService();
|
|
37
|
+
const user = await adminService.get('owner@example.org');
|
|
38
|
+
await adminService.remove(user.email);
|
|
39
|
+
|
|
40
|
+
console.log(user.email); // owner@example.org
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## EntityStorageAuthenticationService
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { EntityStorageAuthenticationService } from '@twin.org/api-auth-entity-storage-service';
|
|
47
|
+
|
|
48
|
+
const authService = new EntityStorageAuthenticationService();
|
|
49
|
+
|
|
50
|
+
await authService.start('default');
|
|
51
|
+
console.log(authService.className()); // EntityStorageAuthenticationService
|
|
52
|
+
|
|
53
|
+
const loginResult = await authService.login('alice@example.org', 'correct-horse-battery-staple');
|
|
54
|
+
|
|
55
|
+
const refreshResult = await authService.refresh(loginResult.token);
|
|
56
|
+
|
|
57
|
+
await authService.updatePassword('correct-horse-battery-staple', 'correct-horse-battery-staple-2');
|
|
58
|
+
|
|
59
|
+
await authService.logout(refreshResult.token);
|
|
60
|
+
console.log(refreshResult.expiry > 0); // true
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## AuthHeaderProcessor
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
import { AuthHeaderProcessor } from '@twin.org/api-auth-entity-storage-service';
|
|
67
|
+
|
|
68
|
+
const processor = new AuthHeaderProcessor();
|
|
69
|
+
|
|
70
|
+
await processor.start('default');
|
|
71
|
+
console.log(processor.className()); // AuthHeaderProcessor
|
|
72
|
+
|
|
73
|
+
const request = {
|
|
74
|
+
method: 'get',
|
|
75
|
+
url: '/info',
|
|
76
|
+
headers: {
|
|
77
|
+
authorization: 'Bearer token-value'
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const response = {};
|
|
82
|
+
const contextIds = {};
|
|
83
|
+
const processorState: { [id: string]: unknown } = {};
|
|
84
|
+
|
|
85
|
+
await processor.pre(request, response, { skipAuth: false }, contextIds, processorState);
|
|
86
|
+
|
|
87
|
+
await processor.post(request, response, { skipAuth: false }, contextIds, processorState);
|
|
88
|
+
```
|
|
@@ -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
|
|
|
@@ -140,7 +140,7 @@ Nothing.
|
|
|
140
140
|
|
|
141
141
|
### refresh()
|
|
142
142
|
|
|
143
|
-
> **refresh**(`token?`): `Promise`\<\{ `token
|
|
143
|
+
> **refresh**(`token?`): `Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
144
144
|
|
|
145
145
|
Refresh the token.
|
|
146
146
|
|
|
@@ -154,7 +154,7 @@ The token to refresh, if it uses a mechanism with public access.
|
|
|
154
154
|
|
|
155
155
|
#### Returns
|
|
156
156
|
|
|
157
|
-
`Promise`\<\{ `token
|
|
157
|
+
`Promise`\<\{ `token?`: `string`; `expiry`: `number`; \}\>
|
|
158
158
|
|
|
159
159
|
The refreshed token, if it uses a mechanism with public access.
|
|
160
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`, `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
|
|
|
@@ -54,12 +54,24 @@ The organization for the token.
|
|
|
54
54
|
|
|
55
55
|
`string` | `undefined`
|
|
56
56
|
|
|
57
|
+
##### tenantId
|
|
58
|
+
|
|
59
|
+
The tenant id for the token.
|
|
60
|
+
|
|
61
|
+
`string` | `undefined`
|
|
62
|
+
|
|
57
63
|
##### ttlMinutes
|
|
58
64
|
|
|
59
65
|
`number`
|
|
60
66
|
|
|
61
67
|
The time to live for the token in minutes.
|
|
62
68
|
|
|
69
|
+
##### scope?
|
|
70
|
+
|
|
71
|
+
`string`
|
|
72
|
+
|
|
73
|
+
The scopes for the token.
|
|
74
|
+
|
|
63
75
|
#### Returns
|
|
64
76
|
|
|
65
77
|
`Promise`\<\{ `token`: `string`; `expiry`: `number`; \}\>
|
|
@@ -70,7 +82,7 @@ The new token and its expiry date.
|
|
|
70
82
|
|
|
71
83
|
### verify()
|
|
72
84
|
|
|
73
|
-
> `static` **verify**(`vaultConnector`, `signingKeyName`, `token`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
|
|
85
|
+
> `static` **verify**(`vaultConnector`, `signingKeyName`, `token`, `requiredScopes?`): `Promise`\<\{ `header`: `JWTHeaderParameters`; `payload`: `JWTPayload`; \}\>
|
|
74
86
|
|
|
75
87
|
Verify the token.
|
|
76
88
|
|
|
@@ -94,6 +106,12 @@ The token to verify.
|
|
|
94
106
|
|
|
95
107
|
`string` | `undefined`
|
|
96
108
|
|
|
109
|
+
##### requiredScopes?
|
|
110
|
+
|
|
111
|
+
`string`[]
|
|
112
|
+
|
|
113
|
+
The required scopes.
|
|
114
|
+
|
|
97
115
|
#### Returns
|
|
98
116
|
|
|
99
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)
|
|
@@ -10,12 +10,6 @@ Configuration for the authentication header processor
|
|
|
10
10
|
|
|
11
11
|
The name of the key to retrieve from the vault for signing JWT.
|
|
12
12
|
|
|
13
|
-
#### Default
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
auth-signing
|
|
17
|
-
```
|
|
18
|
-
|
|
19
13
|
***
|
|
20
14
|
|
|
21
15
|
### cookieName?
|
|
@@ -23,9 +17,3 @@ auth-signing
|
|
|
23
17
|
> `optional` **cookieName**: `string`
|
|
24
18
|
|
|
25
19
|
The name of the cookie to use for the token.
|
|
26
|
-
|
|
27
|
-
#### Default
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
access_token
|
|
31
|
-
```
|
|
@@ -10,12 +10,6 @@ Configuration for the entity storage authentication service.
|
|
|
10
10
|
|
|
11
11
|
The name of the key to retrieve from the vault for signing JWT.
|
|
12
12
|
|
|
13
|
-
#### Default
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
auth-signing
|
|
17
|
-
```
|
|
18
|
-
|
|
19
13
|
***
|
|
20
14
|
|
|
21
15
|
### defaultTtlMinutes?
|
|
@@ -23,9 +17,3 @@ auth-signing
|
|
|
23
17
|
> `optional` **defaultTtlMinutes**: `number`
|
|
24
18
|
|
|
25
19
|
The default time to live for the JWT.
|
|
26
|
-
|
|
27
|
-
#### Default
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
1440
|
|
31
|
-
```
|
|
@@ -10,12 +10,6 @@ Options for the EntityStorageAuthenticationService constructor.
|
|
|
10
10
|
|
|
11
11
|
The entity storage for the users.
|
|
12
12
|
|
|
13
|
-
#### Default
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
authentication-user
|
|
17
|
-
```
|
|
18
|
-
|
|
19
13
|
***
|
|
20
14
|
|
|
21
15
|
### vaultConnectorType?
|
|
@@ -24,12 +18,6 @@ authentication-user
|
|
|
24
18
|
|
|
25
19
|
The vault for the private keys.
|
|
26
20
|
|
|
27
|
-
#### Default
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
vault
|
|
31
|
-
```
|
|
32
|
-
|
|
33
21
|
***
|
|
34
22
|
|
|
35
23
|
### authenticationAdminServiceType?
|
|
@@ -38,12 +26,6 @@ vault
|
|
|
38
26
|
|
|
39
27
|
The admin service.
|
|
40
28
|
|
|
41
|
-
#### Default
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
authentication-admin
|
|
45
|
-
```
|
|
46
|
-
|
|
47
29
|
***
|
|
48
30
|
|
|
49
31
|
### config?
|