@twin.org/identity-service 0.0.2-next.9 → 0.0.3-next.1
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/identityProfileRoutes.js +389 -0
- package/dist/es/identityProfileRoutes.js.map +1 -0
- package/dist/es/identityProfileService.js +165 -0
- package/dist/es/identityProfileService.js.map +1 -0
- package/dist/es/identityResolverRoutes.js +87 -0
- package/dist/es/identityResolverRoutes.js.map +1 -0
- package/dist/es/identityResolverService.js +98 -0
- package/dist/es/identityResolverService.js.map +1 -0
- package/dist/es/identityRoutes.js +946 -0
- package/dist/es/identityRoutes.js.map +1 -0
- package/dist/es/identityService.js +391 -0
- package/dist/es/identityService.js.map +1 -0
- package/dist/es/index.js +15 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IIdentityProfileServiceConstructorOptions.js +2 -0
- package/dist/es/models/IIdentityProfileServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IIdentityResolverServiceConfig.js +4 -0
- package/dist/es/models/IIdentityResolverServiceConfig.js.map +1 -0
- package/dist/es/models/IIdentityResolverServiceConstructorOptions.js +2 -0
- package/dist/es/models/IIdentityResolverServiceConstructorOptions.js.map +1 -0
- package/dist/es/models/IIdentityServiceConfig.js +4 -0
- package/dist/es/models/IIdentityServiceConfig.js.map +1 -0
- package/dist/es/models/IIdentityServiceConstructorOptions.js +2 -0
- package/dist/es/models/IIdentityServiceConstructorOptions.js.map +1 -0
- package/dist/es/restEntryPoints.js +24 -0
- package/dist/es/restEntryPoints.js.map +1 -0
- package/dist/types/identityProfileService.d.ts +6 -1
- package/dist/types/identityResolverService.d.ts +6 -1
- package/dist/types/identityService.d.ts +6 -1
- package/dist/types/index.d.ts +12 -12
- package/dist/types/models/IIdentityResolverServiceConstructorOptions.d.ts +1 -1
- package/dist/types/models/IIdentityServiceConstructorOptions.d.ts +1 -1
- package/docs/changelog.md +50 -0
- package/docs/open-api/spec.json +161 -1335
- package/docs/reference/classes/IdentityProfileService.md +18 -0
- package/docs/reference/classes/IdentityResolverService.md +18 -0
- package/docs/reference/classes/IdentityService.md +22 -4
- package/package.json +7 -8
- package/dist/cjs/index.cjs +0 -2071
- package/dist/esm/index.mjs +0 -2039
package/dist/esm/index.mjs
DELETED
|
@@ -1,2039 +0,0 @@
|
|
|
1
|
-
import { HttpParameterHelper } from '@twin.org/api-models';
|
|
2
|
-
import { Guards, ComponentFactory, Coerce, BaseError, GeneralError, Is, NotFoundError, Urn } from '@twin.org/core';
|
|
3
|
-
import { MimeTypes, HeaderTypes, HttpStatusCode, Jwt } from '@twin.org/web';
|
|
4
|
-
import { IdentityProfileConnectorFactory, IdentityResolverConnectorFactory, DocumentHelper, IdentityConnectorFactory } from '@twin.org/identity-models';
|
|
5
|
-
import { DidContexts, DidVerificationMethodType, ProofTypes } from '@twin.org/standards-w3c-did';
|
|
6
|
-
|
|
7
|
-
// Copyright 2024 IOTA Stiftung.
|
|
8
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
9
|
-
/**
|
|
10
|
-
* The source used when communicating about these routes.
|
|
11
|
-
*/
|
|
12
|
-
const ROUTES_SOURCE$2 = "identityProfileRoutes";
|
|
13
|
-
/**
|
|
14
|
-
* The tag to associate with the routes.
|
|
15
|
-
*/
|
|
16
|
-
const tagsIdentityProfile = [
|
|
17
|
-
{
|
|
18
|
-
name: "Identity Profile",
|
|
19
|
-
description: "Service to provide all features related to digital identity profiles."
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
/**
|
|
23
|
-
* The REST routes for identity.
|
|
24
|
-
* @param baseRouteName Prefix to prepend to the paths.
|
|
25
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
26
|
-
* @returns The generated routes.
|
|
27
|
-
*/
|
|
28
|
-
function generateRestRoutesIdentityProfile(baseRouteName, componentName) {
|
|
29
|
-
const identityProfileCreateRoute = {
|
|
30
|
-
operationId: "identityProfileCreate",
|
|
31
|
-
summary: "Create an identity profile",
|
|
32
|
-
tag: tagsIdentityProfile[0].name,
|
|
33
|
-
method: "POST",
|
|
34
|
-
path: `${baseRouteName}/`,
|
|
35
|
-
handler: async (httpRequestContext, request) => identityProfileCreate(httpRequestContext, componentName, request),
|
|
36
|
-
requestType: {
|
|
37
|
-
type: "IIdentityProfileCreateRequest",
|
|
38
|
-
examples: [
|
|
39
|
-
{
|
|
40
|
-
id: "identityProfileCreateRequestExample",
|
|
41
|
-
request: {
|
|
42
|
-
body: {
|
|
43
|
-
publicProfile: {
|
|
44
|
-
"@context": "https://schema.org",
|
|
45
|
-
"@type": "Person",
|
|
46
|
-
jobTitle: "Professor",
|
|
47
|
-
name: "Jane Doe"
|
|
48
|
-
},
|
|
49
|
-
privateProfile: {
|
|
50
|
-
"@context": "https://schema.org",
|
|
51
|
-
"@type": "Person",
|
|
52
|
-
telephone: "(425) 123-4567",
|
|
53
|
-
url: "http://www.janedoe.com"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
responseType: [
|
|
61
|
-
{
|
|
62
|
-
type: "INoContentResponse"
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
type: "IConflictResponse"
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
const identityProfileGetRoute = {
|
|
70
|
-
operationId: "identityProfileGet",
|
|
71
|
-
summary: "Get the identity profile properties",
|
|
72
|
-
tag: tagsIdentityProfile[0].name,
|
|
73
|
-
method: "GET",
|
|
74
|
-
path: `${baseRouteName}/`,
|
|
75
|
-
handler: async (httpRequestContext, request) => identityGet(httpRequestContext, componentName, request),
|
|
76
|
-
requestType: {
|
|
77
|
-
type: "IIdentityProfileGetRequest",
|
|
78
|
-
examples: [
|
|
79
|
-
{
|
|
80
|
-
id: "identityGetProfileRequestExample",
|
|
81
|
-
request: {
|
|
82
|
-
query: {
|
|
83
|
-
publicPropertyNames: "name,jobTitle"
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
responseType: [
|
|
90
|
-
{
|
|
91
|
-
type: "IIdentityProfileGetResponse",
|
|
92
|
-
examples: [
|
|
93
|
-
{
|
|
94
|
-
id: "identityGetResponseExample",
|
|
95
|
-
response: {
|
|
96
|
-
body: {
|
|
97
|
-
identity: "did:iota:tst:0xc57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
|
|
98
|
-
publicProfile: {
|
|
99
|
-
"@context": "https://schema.org",
|
|
100
|
-
"@type": "Person",
|
|
101
|
-
jobTitle: "Professor",
|
|
102
|
-
name: "Jane Doe"
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
type: "INotFoundResponse"
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
};
|
|
114
|
-
const identityProfileGetPublicRoute = {
|
|
115
|
-
operationId: "identityProfileGetPublic",
|
|
116
|
-
summary: "Get the identity profile public properties",
|
|
117
|
-
tag: tagsIdentityProfile[0].name,
|
|
118
|
-
method: "GET",
|
|
119
|
-
path: `${baseRouteName}/:identity/public`,
|
|
120
|
-
handler: async (httpRequestContext, request) => identityGetPublic(httpRequestContext, componentName, request),
|
|
121
|
-
requestType: {
|
|
122
|
-
type: "IIdentityProfileGetPublicRequest",
|
|
123
|
-
examples: [
|
|
124
|
-
{
|
|
125
|
-
id: "identityGetPublicProfileRequestExample",
|
|
126
|
-
request: {
|
|
127
|
-
pathParams: {
|
|
128
|
-
identity: "did:iota:tst:0xc57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70"
|
|
129
|
-
},
|
|
130
|
-
query: {
|
|
131
|
-
propertyNames: "role,email,name"
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
},
|
|
137
|
-
responseType: [
|
|
138
|
-
{
|
|
139
|
-
type: "IIdentityProfileGetPublicResponse",
|
|
140
|
-
mimeType: MimeTypes.JsonLd,
|
|
141
|
-
examples: [
|
|
142
|
-
{
|
|
143
|
-
id: "identityGetPublicResponseExample",
|
|
144
|
-
response: {
|
|
145
|
-
headers: {
|
|
146
|
-
[HeaderTypes.ContentType]: MimeTypes.JsonLd
|
|
147
|
-
},
|
|
148
|
-
body: {
|
|
149
|
-
"@context": "https://schema.org",
|
|
150
|
-
"@type": "Person",
|
|
151
|
-
jobTitle: "Professor",
|
|
152
|
-
name: "Jane Doe"
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
]
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
type: "INotFoundResponse"
|
|
160
|
-
}
|
|
161
|
-
],
|
|
162
|
-
skipAuth: true
|
|
163
|
-
};
|
|
164
|
-
const identityProfileUpdateRoute = {
|
|
165
|
-
operationId: "identityProfileUpdate",
|
|
166
|
-
summary: "Update an identity profile properties",
|
|
167
|
-
tag: tagsIdentityProfile[0].name,
|
|
168
|
-
method: "PUT",
|
|
169
|
-
path: `${baseRouteName}/`,
|
|
170
|
-
handler: async (httpRequestContext, request) => identityProfileUpdate(httpRequestContext, componentName, request),
|
|
171
|
-
requestType: {
|
|
172
|
-
type: "IIdentityProfileUpdateRequest",
|
|
173
|
-
examples: [
|
|
174
|
-
{
|
|
175
|
-
id: "identityProfileUpdateRequestExample",
|
|
176
|
-
request: {
|
|
177
|
-
body: {
|
|
178
|
-
publicProfile: {
|
|
179
|
-
"@context": "https://schema.org",
|
|
180
|
-
"@type": "Person",
|
|
181
|
-
jobTitle: "Professor",
|
|
182
|
-
name: "Jane Doe"
|
|
183
|
-
},
|
|
184
|
-
privateProfile: {
|
|
185
|
-
"@context": "https://schema.org",
|
|
186
|
-
"@type": "Person",
|
|
187
|
-
telephone: "(425) 123-4567",
|
|
188
|
-
url: "http://www.janedoe.com"
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
]
|
|
194
|
-
},
|
|
195
|
-
responseType: [
|
|
196
|
-
{
|
|
197
|
-
type: "INoContentResponse"
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
type: "INotFoundResponse"
|
|
201
|
-
}
|
|
202
|
-
]
|
|
203
|
-
};
|
|
204
|
-
const identityProfileRemoveRoute = {
|
|
205
|
-
operationId: "identityProfileRemove",
|
|
206
|
-
summary: "Remove an identity profile",
|
|
207
|
-
tag: tagsIdentityProfile[0].name,
|
|
208
|
-
method: "DELETE",
|
|
209
|
-
path: `${baseRouteName}/`,
|
|
210
|
-
handler: async (httpRequestContext, request) => identityProfileRemove(httpRequestContext, componentName),
|
|
211
|
-
responseType: [
|
|
212
|
-
{
|
|
213
|
-
type: "INoContentResponse"
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
type: "INotFoundResponse"
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
};
|
|
220
|
-
const identityProfileListRoute = {
|
|
221
|
-
operationId: "identitiesProfileList",
|
|
222
|
-
summary: "Get the list of profile data for identities",
|
|
223
|
-
tag: tagsIdentityProfile[0].name,
|
|
224
|
-
method: "GET",
|
|
225
|
-
path: `${baseRouteName}/query/`,
|
|
226
|
-
handler: async (httpRequestContext, request) => identitiesList(httpRequestContext, componentName, request),
|
|
227
|
-
requestType: {
|
|
228
|
-
type: "IIdentityProfileListRequest",
|
|
229
|
-
examples: [
|
|
230
|
-
{
|
|
231
|
-
id: "identityProfileListRequestExample",
|
|
232
|
-
request: {
|
|
233
|
-
query: {}
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
id: "identityProfileListRequestFilteredExample",
|
|
238
|
-
request: {
|
|
239
|
-
query: {
|
|
240
|
-
publicFilters: "jobTitle:Professor"
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
]
|
|
245
|
-
},
|
|
246
|
-
responseType: [
|
|
247
|
-
{
|
|
248
|
-
type: "IIdentityProfileListResponse",
|
|
249
|
-
examples: [
|
|
250
|
-
{
|
|
251
|
-
id: "identitiesProfileListResponseExample",
|
|
252
|
-
response: {
|
|
253
|
-
body: {
|
|
254
|
-
items: [
|
|
255
|
-
{
|
|
256
|
-
identity: "did:iota:tst:0xc57d94b088f4c6d2cb32ded014813d0c786aa00134c8ee22f84b1e2545602a70",
|
|
257
|
-
publicProfile: {
|
|
258
|
-
"@context": "https://schema.org",
|
|
259
|
-
"@type": "Person",
|
|
260
|
-
jobTitle: "Professor",
|
|
261
|
-
name: "Jane Doe"
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
],
|
|
265
|
-
cursor: "1"
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
]
|
|
270
|
-
}
|
|
271
|
-
]
|
|
272
|
-
};
|
|
273
|
-
return [
|
|
274
|
-
identityProfileCreateRoute,
|
|
275
|
-
identityProfileGetRoute,
|
|
276
|
-
identityProfileGetPublicRoute,
|
|
277
|
-
identityProfileUpdateRoute,
|
|
278
|
-
identityProfileRemoveRoute,
|
|
279
|
-
identityProfileListRoute
|
|
280
|
-
];
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Create an identity profile.
|
|
284
|
-
* @param httpRequestContext The request context for the API.
|
|
285
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
286
|
-
* @param request The request.
|
|
287
|
-
* @returns The response object with additional http response properties.
|
|
288
|
-
*/
|
|
289
|
-
async function identityProfileCreate(httpRequestContext, componentName, request) {
|
|
290
|
-
Guards.object(ROUTES_SOURCE$2, "request", request);
|
|
291
|
-
Guards.object(ROUTES_SOURCE$2, "request.body", request.body);
|
|
292
|
-
const component = ComponentFactory.get(componentName);
|
|
293
|
-
await component.create(request.body.publicProfile, request.body.privateProfile, httpRequestContext.userIdentity);
|
|
294
|
-
return {
|
|
295
|
-
statusCode: HttpStatusCode.noContent
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Get the identity profile.
|
|
300
|
-
* @param httpRequestContext The request context for the API.
|
|
301
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
302
|
-
* @param request The request.
|
|
303
|
-
* @returns The response object with additional http response properties.
|
|
304
|
-
*/
|
|
305
|
-
async function identityGet(httpRequestContext, componentName, request) {
|
|
306
|
-
Guards.object(ROUTES_SOURCE$2, "request", request);
|
|
307
|
-
const component = ComponentFactory.get(componentName);
|
|
308
|
-
const result = await component.get(HttpParameterHelper.arrayFromString(request?.query?.publicPropertyNames), HttpParameterHelper.arrayFromString(request?.query?.privatePropertyNames), httpRequestContext.userIdentity);
|
|
309
|
-
return {
|
|
310
|
-
body: result
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Get the identity public profile.
|
|
315
|
-
* @param httpRequestContext The request context for the API.
|
|
316
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
317
|
-
* @param request The request.
|
|
318
|
-
* @returns The response object with additional http response properties.
|
|
319
|
-
*/
|
|
320
|
-
async function identityGetPublic(httpRequestContext, componentName, request) {
|
|
321
|
-
Guards.object(ROUTES_SOURCE$2, "request", request);
|
|
322
|
-
Guards.stringValue(ROUTES_SOURCE$2, "request.pathParams.identity", request.pathParams?.identity);
|
|
323
|
-
const component = ComponentFactory.get(componentName);
|
|
324
|
-
const result = await component.getPublic(request?.pathParams.identity, HttpParameterHelper.arrayFromString(request?.query?.propertyNames));
|
|
325
|
-
return {
|
|
326
|
-
headers: {
|
|
327
|
-
[HeaderTypes.ContentType]: MimeTypes.JsonLd
|
|
328
|
-
},
|
|
329
|
-
body: result
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Update an identity profile.
|
|
334
|
-
* @param httpRequestContext The request context for the API.
|
|
335
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
336
|
-
* @param request The request.
|
|
337
|
-
* @returns The response object with additional http response properties.
|
|
338
|
-
*/
|
|
339
|
-
async function identityProfileUpdate(httpRequestContext, componentName, request) {
|
|
340
|
-
Guards.object(ROUTES_SOURCE$2, "request", request);
|
|
341
|
-
Guards.object(ROUTES_SOURCE$2, "request.body", request.body);
|
|
342
|
-
const component = ComponentFactory.get(componentName);
|
|
343
|
-
await component.update(request.body.publicProfile, request.body.privateProfile, httpRequestContext.userIdentity);
|
|
344
|
-
return {
|
|
345
|
-
statusCode: HttpStatusCode.noContent
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
/**
|
|
349
|
-
* Remove an identity profile.
|
|
350
|
-
* @param httpRequestContext The request context for the API.
|
|
351
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
352
|
-
* @param request The request.
|
|
353
|
-
* @returns The response object with additional http response properties.
|
|
354
|
-
*/
|
|
355
|
-
async function identityProfileRemove(httpRequestContext, componentName, request) {
|
|
356
|
-
const component = ComponentFactory.get(componentName);
|
|
357
|
-
await component.remove(httpRequestContext.userIdentity);
|
|
358
|
-
return {
|
|
359
|
-
statusCode: HttpStatusCode.noContent
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Get the list of organizations.
|
|
364
|
-
* @param httpRequestContext The request context for the API.
|
|
365
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
366
|
-
* @param request The request.
|
|
367
|
-
* @returns The response object with additional http response properties.
|
|
368
|
-
*/
|
|
369
|
-
async function identitiesList(httpRequestContext, componentName, request) {
|
|
370
|
-
const component = ComponentFactory.get(componentName);
|
|
371
|
-
const publicFilterPairs = HttpParameterHelper.arrayFromString(request?.query?.publicFilters);
|
|
372
|
-
const publicFilters = publicFilterPairs?.map(pair => {
|
|
373
|
-
const parts = pair.split(":");
|
|
374
|
-
return {
|
|
375
|
-
propertyName: parts[0],
|
|
376
|
-
propertyValue: parts[1]
|
|
377
|
-
};
|
|
378
|
-
});
|
|
379
|
-
return {
|
|
380
|
-
body: await component.list(publicFilters, HttpParameterHelper.arrayFromString(request?.query?.publicPropertyNames), request?.query?.cursor, Coerce.integer(request.query?.limit))
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
// Copyright 2024 IOTA Stiftung.
|
|
385
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
386
|
-
/**
|
|
387
|
-
* Class which implements the identity profile contract.
|
|
388
|
-
*/
|
|
389
|
-
class IdentityProfileService {
|
|
390
|
-
/**
|
|
391
|
-
* Runtime name for the class.
|
|
392
|
-
*/
|
|
393
|
-
static CLASS_NAME = "IdentityProfileService";
|
|
394
|
-
/**
|
|
395
|
-
* The identity profile connector.
|
|
396
|
-
* @internal
|
|
397
|
-
*/
|
|
398
|
-
_identityProfileConnector;
|
|
399
|
-
/**
|
|
400
|
-
* Create a new instance of IdentityProfileService.
|
|
401
|
-
* @param options The dependencies for the identity profile service.
|
|
402
|
-
*/
|
|
403
|
-
constructor(options) {
|
|
404
|
-
this._identityProfileConnector = IdentityProfileConnectorFactory.get(options?.profileEntityConnectorType ?? "identity-profile");
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Create the profile properties for an identity.
|
|
408
|
-
* @param publicProfile The public profile data as JSON-LD.
|
|
409
|
-
* @param privateProfile The private profile data as JSON-LD.
|
|
410
|
-
* @param identity The identity to perform the profile operation on.
|
|
411
|
-
* @returns Nothing.
|
|
412
|
-
*/
|
|
413
|
-
async create(publicProfile, privateProfile, identity) {
|
|
414
|
-
Guards.stringValue(IdentityProfileService.CLASS_NAME, "identity", identity);
|
|
415
|
-
try {
|
|
416
|
-
await this._identityProfileConnector.create(identity, publicProfile, privateProfile);
|
|
417
|
-
}
|
|
418
|
-
catch (error) {
|
|
419
|
-
if (BaseError.someErrorClass(error, IdentityProfileService.CLASS_NAME)) {
|
|
420
|
-
throw error;
|
|
421
|
-
}
|
|
422
|
-
throw new GeneralError(IdentityProfileService.CLASS_NAME, "createFailed", { identity }, error);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Get the profile properties for an identity.
|
|
427
|
-
* @param publicPropertyNames The public properties to get for the profile, defaults to all.
|
|
428
|
-
* @param privatePropertyNames The private properties to get for the profile, defaults to all.
|
|
429
|
-
* @param identity The identity to perform the profile operation on.
|
|
430
|
-
* @returns The items identity and the properties.
|
|
431
|
-
*/
|
|
432
|
-
async get(publicPropertyNames, privatePropertyNames, identity) {
|
|
433
|
-
Guards.stringValue(IdentityProfileService.CLASS_NAME, "identity", identity);
|
|
434
|
-
try {
|
|
435
|
-
const result = await this._identityProfileConnector.get(identity, publicPropertyNames, privatePropertyNames);
|
|
436
|
-
if (Is.undefined(result)) {
|
|
437
|
-
throw new NotFoundError(IdentityProfileService.CLASS_NAME, "notFound", identity);
|
|
438
|
-
}
|
|
439
|
-
return {
|
|
440
|
-
identity,
|
|
441
|
-
publicProfile: result.publicProfile,
|
|
442
|
-
privateProfile: result.privateProfile
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
catch (error) {
|
|
446
|
-
if (BaseError.someErrorClass(error, IdentityProfileService.CLASS_NAME)) {
|
|
447
|
-
throw error;
|
|
448
|
-
}
|
|
449
|
-
throw new GeneralError(IdentityProfileService.CLASS_NAME, "getFailed", undefined, error);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* Get the public profile properties for an identity.
|
|
454
|
-
* @param identity The identity to perform the profile operation on.
|
|
455
|
-
* @param propertyNames The properties to get for the item, defaults to all.
|
|
456
|
-
* @returns The items properties.
|
|
457
|
-
*/
|
|
458
|
-
async getPublic(identity, propertyNames) {
|
|
459
|
-
Guards.stringValue(IdentityProfileService.CLASS_NAME, "identity", identity);
|
|
460
|
-
try {
|
|
461
|
-
const result = await this._identityProfileConnector.get(identity, propertyNames);
|
|
462
|
-
if (Is.undefined(result)) {
|
|
463
|
-
throw new NotFoundError(IdentityProfileService.CLASS_NAME, "notFound", identity);
|
|
464
|
-
}
|
|
465
|
-
return result.publicProfile;
|
|
466
|
-
}
|
|
467
|
-
catch (error) {
|
|
468
|
-
if (BaseError.someErrorClass(error, IdentityProfileService.CLASS_NAME)) {
|
|
469
|
-
throw error;
|
|
470
|
-
}
|
|
471
|
-
throw new GeneralError(IdentityProfileService.CLASS_NAME, "getPublicFailed", undefined, error);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Update the profile properties of an identity.
|
|
476
|
-
* @param publicProfile The public profile data as JSON-LD.
|
|
477
|
-
* @param privateProfile The private profile data as JSON-LD.
|
|
478
|
-
* @param identity The identity to perform the profile operation on.
|
|
479
|
-
* @returns Nothing.
|
|
480
|
-
*/
|
|
481
|
-
async update(publicProfile, privateProfile, identity) {
|
|
482
|
-
Guards.stringValue(IdentityProfileService.CLASS_NAME, "identity", identity);
|
|
483
|
-
try {
|
|
484
|
-
const result = await this._identityProfileConnector.get(identity);
|
|
485
|
-
if (Is.undefined(result)) {
|
|
486
|
-
throw new NotFoundError(IdentityProfileService.CLASS_NAME, "notFound", identity);
|
|
487
|
-
}
|
|
488
|
-
await this._identityProfileConnector.update(identity, publicProfile, privateProfile);
|
|
489
|
-
}
|
|
490
|
-
catch (error) {
|
|
491
|
-
if (BaseError.someErrorClass(error, IdentityProfileService.CLASS_NAME)) {
|
|
492
|
-
throw error;
|
|
493
|
-
}
|
|
494
|
-
throw new GeneralError(IdentityProfileService.CLASS_NAME, "updateFailed", { identity }, error);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* Delete the profile for an identity.
|
|
499
|
-
* @param identity The identity to perform the profile operation on.
|
|
500
|
-
* @returns Nothing.
|
|
501
|
-
*/
|
|
502
|
-
async remove(identity) {
|
|
503
|
-
Guards.stringValue(IdentityProfileService.CLASS_NAME, "identity", identity);
|
|
504
|
-
try {
|
|
505
|
-
const result = await this._identityProfileConnector.get(identity);
|
|
506
|
-
if (Is.undefined(result)) {
|
|
507
|
-
throw new NotFoundError(IdentityProfileService.CLASS_NAME, "notFound", identity);
|
|
508
|
-
}
|
|
509
|
-
await this._identityProfileConnector.remove(identity);
|
|
510
|
-
}
|
|
511
|
-
catch (error) {
|
|
512
|
-
if (BaseError.someErrorClass(error, IdentityProfileService.CLASS_NAME)) {
|
|
513
|
-
throw error;
|
|
514
|
-
}
|
|
515
|
-
throw new GeneralError(IdentityProfileService.CLASS_NAME, "removeFailed", { identity }, error);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
/**
|
|
519
|
-
* Get a list of the requested types.
|
|
520
|
-
* @param publicFilters The filters to apply to the identities public profiles.
|
|
521
|
-
* @param publicPropertyNames The public properties to get for the profile, defaults to all.
|
|
522
|
-
* @param cursor The cursor for paged requests.
|
|
523
|
-
* @param limit The maximum number of items in a page.
|
|
524
|
-
* @returns The list of items and cursor for paging.
|
|
525
|
-
*/
|
|
526
|
-
async list(publicFilters, publicPropertyNames, cursor, limit) {
|
|
527
|
-
try {
|
|
528
|
-
// We don't want to return private profile for this type of query
|
|
529
|
-
// as it would expose the values to the REST api
|
|
530
|
-
return this._identityProfileConnector.list(publicFilters, undefined, publicPropertyNames, undefined, cursor, limit);
|
|
531
|
-
}
|
|
532
|
-
catch (error) {
|
|
533
|
-
throw new GeneralError(IdentityProfileService.CLASS_NAME, "listFailed", undefined, error);
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* The source used when communicating about these routes.
|
|
540
|
-
*/
|
|
541
|
-
const ROUTES_SOURCE$1 = "identityResolverRoutes";
|
|
542
|
-
/**
|
|
543
|
-
* The tag to associate with the routes.
|
|
544
|
-
*/
|
|
545
|
-
const tagsIdentityResolver = [
|
|
546
|
-
{
|
|
547
|
-
name: "Identity",
|
|
548
|
-
description: "Service to provide all features related to digital identity."
|
|
549
|
-
}
|
|
550
|
-
];
|
|
551
|
-
/**
|
|
552
|
-
* The REST routes for identity.
|
|
553
|
-
* @param baseRouteName Prefix to prepend to the paths.
|
|
554
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
555
|
-
* @returns The generated routes.
|
|
556
|
-
*/
|
|
557
|
-
function generateRestRoutesIdentityResolver(baseRouteName, componentName) {
|
|
558
|
-
const identityResolveRoute = {
|
|
559
|
-
operationId: "identityResolve",
|
|
560
|
-
summary: "Resolve an identity",
|
|
561
|
-
tag: tagsIdentityResolver[0].name,
|
|
562
|
-
method: "GET",
|
|
563
|
-
path: `${baseRouteName}/:identity`,
|
|
564
|
-
handler: async (httpRequestContext, request) => identityResolve(httpRequestContext, componentName, request),
|
|
565
|
-
requestType: {
|
|
566
|
-
type: "IIdentityResolveRequest",
|
|
567
|
-
examples: [
|
|
568
|
-
{
|
|
569
|
-
id: "identityResolveRequestExample",
|
|
570
|
-
request: {
|
|
571
|
-
pathParams: {
|
|
572
|
-
identity: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a"
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
]
|
|
577
|
-
},
|
|
578
|
-
responseType: [
|
|
579
|
-
{
|
|
580
|
-
type: "IIdentityResolveResponse",
|
|
581
|
-
examples: [
|
|
582
|
-
{
|
|
583
|
-
id: "identityResolveResponseExample",
|
|
584
|
-
response: {
|
|
585
|
-
body: {
|
|
586
|
-
"@context": DidContexts.Context,
|
|
587
|
-
id: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a",
|
|
588
|
-
service: [
|
|
589
|
-
{
|
|
590
|
-
id: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a#revocation",
|
|
591
|
-
type: "RevocationBitmap2022",
|
|
592
|
-
serviceEndpoint: "data:application/octet-stream;base64,eJyzMmAAAwABr"
|
|
593
|
-
}
|
|
594
|
-
]
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
]
|
|
599
|
-
}
|
|
600
|
-
],
|
|
601
|
-
skipAuth: true
|
|
602
|
-
};
|
|
603
|
-
return [identityResolveRoute];
|
|
604
|
-
}
|
|
605
|
-
/**
|
|
606
|
-
* Resolve an identity.
|
|
607
|
-
* @param httpRequestContext The request context for the API.
|
|
608
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
609
|
-
* @param request The request.
|
|
610
|
-
* @returns The response object with additional http response properties.
|
|
611
|
-
*/
|
|
612
|
-
async function identityResolve(httpRequestContext, componentName, request) {
|
|
613
|
-
Guards.object(ROUTES_SOURCE$1, "request", request);
|
|
614
|
-
Guards.object(ROUTES_SOURCE$1, "request.pathParams", request.pathParams);
|
|
615
|
-
Guards.stringValue(ROUTES_SOURCE$1, "request.pathParams.identity", request.pathParams.identity);
|
|
616
|
-
const component = ComponentFactory.get(componentName);
|
|
617
|
-
const result = await component.identityResolve(request.pathParams.identity);
|
|
618
|
-
return {
|
|
619
|
-
body: result
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
// Copyright 2024 IOTA Stiftung.
|
|
624
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
625
|
-
/**
|
|
626
|
-
* Class which implements the identity resolver contract.
|
|
627
|
-
*/
|
|
628
|
-
class IdentityResolverService {
|
|
629
|
-
/**
|
|
630
|
-
* Runtime name for the class.
|
|
631
|
-
*/
|
|
632
|
-
static CLASS_NAME = "IdentityResolverService";
|
|
633
|
-
/**
|
|
634
|
-
* The default namespace for the connector to use.
|
|
635
|
-
* @internal
|
|
636
|
-
*/
|
|
637
|
-
_defaultNamespace;
|
|
638
|
-
/**
|
|
639
|
-
* Fallback connector type to use if the namespace connector is not available.
|
|
640
|
-
* @internal
|
|
641
|
-
*/
|
|
642
|
-
_fallbackResolverConnectorType;
|
|
643
|
-
/**
|
|
644
|
-
* Create a new instance of IdentityResolverService.
|
|
645
|
-
* @param options The options for the service.
|
|
646
|
-
*/
|
|
647
|
-
constructor(options) {
|
|
648
|
-
const names = IdentityResolverConnectorFactory.names();
|
|
649
|
-
if (names.length === 0) {
|
|
650
|
-
throw new GeneralError(IdentityResolverService.CLASS_NAME, "noConnectors");
|
|
651
|
-
}
|
|
652
|
-
this._defaultNamespace = options?.config?.defaultNamespace ?? names[0];
|
|
653
|
-
this._fallbackResolverConnectorType = options?.fallbackResolverConnectorType ?? "universal";
|
|
654
|
-
}
|
|
655
|
-
/**
|
|
656
|
-
* Resolve an identity.
|
|
657
|
-
* @param identity The id of the document to resolve.
|
|
658
|
-
* @returns The resolved document.
|
|
659
|
-
*/
|
|
660
|
-
async identityResolve(identity) {
|
|
661
|
-
Urn.guard(IdentityResolverService.CLASS_NAME, "identity", identity);
|
|
662
|
-
try {
|
|
663
|
-
const identityResolverConnector = this.getConnectorByUri(identity);
|
|
664
|
-
const document = await identityResolverConnector.resolveDocument(identity);
|
|
665
|
-
return document;
|
|
666
|
-
}
|
|
667
|
-
catch (error) {
|
|
668
|
-
throw new GeneralError(IdentityResolverService.CLASS_NAME, "identityResolveFailed", {
|
|
669
|
-
identity
|
|
670
|
-
}, error);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* Get the connector from the namespace.
|
|
675
|
-
* @param namespace The namespace for the identity.
|
|
676
|
-
* @returns The connector.
|
|
677
|
-
* @internal
|
|
678
|
-
*/
|
|
679
|
-
getConnectorByNamespace(namespace) {
|
|
680
|
-
const namespaceMethod = namespace ?? this._defaultNamespace;
|
|
681
|
-
let connector = IdentityResolverConnectorFactory.getIfExists(namespaceMethod);
|
|
682
|
-
if (Is.empty(connector)) {
|
|
683
|
-
// Let's see if a fallback 'universal' connector is registered
|
|
684
|
-
connector = IdentityResolverConnectorFactory.getIfExists(this._fallbackResolverConnectorType);
|
|
685
|
-
if (Is.empty(connector)) {
|
|
686
|
-
throw new GeneralError(IdentityResolverService.CLASS_NAME, "connectorNotFound", {
|
|
687
|
-
namespace: namespaceMethod
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
return connector;
|
|
692
|
-
}
|
|
693
|
-
/**
|
|
694
|
-
* Get the connector from the uri.
|
|
695
|
-
* @param id The id of the identity in urn format.
|
|
696
|
-
* @returns The connector.
|
|
697
|
-
* @internal
|
|
698
|
-
*/
|
|
699
|
-
getConnectorByUri(id) {
|
|
700
|
-
const idUri = Urn.fromValidString(id);
|
|
701
|
-
if (idUri.namespaceIdentifier() !== "did") {
|
|
702
|
-
throw new GeneralError(IdentityResolverService.CLASS_NAME, "namespaceMismatch", {
|
|
703
|
-
namespace: "did",
|
|
704
|
-
id
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
|
-
return this.getConnectorByNamespace(idUri.namespaceMethod());
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
/**
|
|
712
|
-
* The source used when communicating about these routes.
|
|
713
|
-
*/
|
|
714
|
-
const ROUTES_SOURCE = "identityRoutes";
|
|
715
|
-
/**
|
|
716
|
-
* The tag to associate with the routes.
|
|
717
|
-
*/
|
|
718
|
-
const tagsIdentity = [
|
|
719
|
-
{
|
|
720
|
-
name: "Identity",
|
|
721
|
-
description: "Service to provide all features related to digital identity."
|
|
722
|
-
}
|
|
723
|
-
];
|
|
724
|
-
/**
|
|
725
|
-
* The REST routes for identity.
|
|
726
|
-
* @param baseRouteName Prefix to prepend to the paths.
|
|
727
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
728
|
-
* @returns The generated routes.
|
|
729
|
-
*/
|
|
730
|
-
function generateRestRoutesIdentity(baseRouteName, componentName) {
|
|
731
|
-
const identityCreateRoute = {
|
|
732
|
-
operationId: "identityCreate",
|
|
733
|
-
summary: "Create an identity",
|
|
734
|
-
tag: tagsIdentity[0].name,
|
|
735
|
-
method: "POST",
|
|
736
|
-
path: `${baseRouteName}/`,
|
|
737
|
-
handler: async (httpRequestContext, request) => identityCreate(httpRequestContext, componentName, request),
|
|
738
|
-
requestType: {
|
|
739
|
-
type: "IIdentityCreateRequest",
|
|
740
|
-
examples: [
|
|
741
|
-
{
|
|
742
|
-
id: "identityCreateRequestExample",
|
|
743
|
-
request: {}
|
|
744
|
-
}
|
|
745
|
-
]
|
|
746
|
-
},
|
|
747
|
-
responseType: [
|
|
748
|
-
{
|
|
749
|
-
type: "IIdentityCreateResponse",
|
|
750
|
-
examples: [
|
|
751
|
-
{
|
|
752
|
-
id: "identityCreateResponseExample",
|
|
753
|
-
response: {
|
|
754
|
-
body: {
|
|
755
|
-
"@context": DidContexts.Context,
|
|
756
|
-
id: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a",
|
|
757
|
-
service: [
|
|
758
|
-
{
|
|
759
|
-
id: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a#revocation",
|
|
760
|
-
type: "RevocationBitmap2022",
|
|
761
|
-
serviceEndpoint: "data:application/octet-stream;base64,eJyzMmAAAwABr"
|
|
762
|
-
}
|
|
763
|
-
]
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
]
|
|
768
|
-
}
|
|
769
|
-
]
|
|
770
|
-
};
|
|
771
|
-
const identityRemoveRoute = {
|
|
772
|
-
operationId: "identityRemove",
|
|
773
|
-
summary: "Remove an identity",
|
|
774
|
-
tag: tagsIdentity[0].name,
|
|
775
|
-
method: "DELETE",
|
|
776
|
-
path: `${baseRouteName}/:identity`,
|
|
777
|
-
handler: async (httpRequestContext, request) => identityRemove(httpRequestContext, componentName, request),
|
|
778
|
-
requestType: {
|
|
779
|
-
type: "IIdentityRemoveRequest",
|
|
780
|
-
examples: [
|
|
781
|
-
{
|
|
782
|
-
id: "identityRemoveRequestExample",
|
|
783
|
-
request: {
|
|
784
|
-
pathParams: {
|
|
785
|
-
identity: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a"
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
]
|
|
790
|
-
},
|
|
791
|
-
responseType: [
|
|
792
|
-
{
|
|
793
|
-
type: "INoContentResponse"
|
|
794
|
-
}
|
|
795
|
-
]
|
|
796
|
-
};
|
|
797
|
-
const identityVerificationMethodCreateRoute = {
|
|
798
|
-
operationId: "identityVerificationMethodCreate",
|
|
799
|
-
summary: "Create an identity verification method",
|
|
800
|
-
tag: tagsIdentity[0].name,
|
|
801
|
-
method: "POST",
|
|
802
|
-
path: `${baseRouteName}/:identity/verification-method`,
|
|
803
|
-
handler: async (httpRequestContext, request) => identityVerificationMethodCreate(httpRequestContext, componentName, request),
|
|
804
|
-
requestType: {
|
|
805
|
-
type: "IIdentityVerificationMethodCreateRequest",
|
|
806
|
-
examples: [
|
|
807
|
-
{
|
|
808
|
-
id: "identityVerificationMethodCreateRequestExample",
|
|
809
|
-
request: {
|
|
810
|
-
pathParams: {
|
|
811
|
-
identity: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a"
|
|
812
|
-
},
|
|
813
|
-
body: {
|
|
814
|
-
verificationMethodType: "assertionMethod",
|
|
815
|
-
verificationMethodId: "my-assertion"
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
]
|
|
820
|
-
},
|
|
821
|
-
responseType: [
|
|
822
|
-
{
|
|
823
|
-
type: "IIdentityVerificationMethodCreateResponse",
|
|
824
|
-
examples: [
|
|
825
|
-
{
|
|
826
|
-
id: "identityVerificationMethodCreateResponseExample",
|
|
827
|
-
response: {
|
|
828
|
-
body: {
|
|
829
|
-
id: "did:iota:tst:0x70ce5abe69e7c56dd69684dd6da65812b9758b03a0081331ca560b34d73d5ff0#my-assertion",
|
|
830
|
-
controller: "did:iota:tst:0x70ce5abe69e7c56dd69684dd6da65812b9758b03a0081331ca560b34d73d5ff0",
|
|
831
|
-
type: "JsonWebKey2020",
|
|
832
|
-
publicKeyJwk: {
|
|
833
|
-
kty: "OKP",
|
|
834
|
-
alg: "EdDSA",
|
|
835
|
-
kid: "f_fj3rGsZFSYvnS_xv5MgyIBlExq-lgDciu0YQ--S3s",
|
|
836
|
-
crv: "Ed25519",
|
|
837
|
-
x: "SFm32z7y9C17olpaTeocG25WV2CNTUl5MhM679Z4bok"
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
]
|
|
843
|
-
}
|
|
844
|
-
]
|
|
845
|
-
};
|
|
846
|
-
const identityVerificationMethodRemoveRoute = {
|
|
847
|
-
operationId: "identityVerificationMethodRemove",
|
|
848
|
-
summary: "Remove an identity verification method",
|
|
849
|
-
tag: tagsIdentity[0].name,
|
|
850
|
-
method: "DELETE",
|
|
851
|
-
path: `${baseRouteName}/:identity/verification-method/:verificationMethodId`,
|
|
852
|
-
handler: async (httpRequestContext, request) => identityVerificationMethodRemove(httpRequestContext, componentName, request),
|
|
853
|
-
requestType: {
|
|
854
|
-
type: "IIdentityVerificationMethodRemoveRequest",
|
|
855
|
-
examples: [
|
|
856
|
-
{
|
|
857
|
-
id: "identityVerificationMethodRemoveRequestExample",
|
|
858
|
-
request: {
|
|
859
|
-
pathParams: {
|
|
860
|
-
identity: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a",
|
|
861
|
-
verificationMethodId: "my-assertion"
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
]
|
|
866
|
-
},
|
|
867
|
-
responseType: [
|
|
868
|
-
{
|
|
869
|
-
type: "INoContentResponse",
|
|
870
|
-
examples: [
|
|
871
|
-
{
|
|
872
|
-
id: "identityVerificationMethodCreateResponseExample",
|
|
873
|
-
response: {
|
|
874
|
-
statusCode: HttpStatusCode.noContent
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
]
|
|
878
|
-
}
|
|
879
|
-
]
|
|
880
|
-
};
|
|
881
|
-
const identityServiceCreateRoute = {
|
|
882
|
-
operationId: "identityServiceCreate",
|
|
883
|
-
summary: "Create an identity service",
|
|
884
|
-
tag: tagsIdentity[0].name,
|
|
885
|
-
method: "POST",
|
|
886
|
-
path: `${baseRouteName}/:identity/service`,
|
|
887
|
-
handler: async (httpRequestContext, request) => identityServiceCreate(httpRequestContext, componentName, request),
|
|
888
|
-
requestType: {
|
|
889
|
-
type: "IIdentityServiceCreateRequest",
|
|
890
|
-
examples: [
|
|
891
|
-
{
|
|
892
|
-
id: "identityServiceCreateRequestExample",
|
|
893
|
-
request: {
|
|
894
|
-
pathParams: {
|
|
895
|
-
identity: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a"
|
|
896
|
-
},
|
|
897
|
-
body: {
|
|
898
|
-
serviceId: "did:example:123#linked-domain",
|
|
899
|
-
type: "LinkedDomains",
|
|
900
|
-
endpoint: "https://bar.example.com"
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
]
|
|
905
|
-
},
|
|
906
|
-
responseType: [
|
|
907
|
-
{
|
|
908
|
-
type: "IIdentityServiceCreateResponse",
|
|
909
|
-
examples: [
|
|
910
|
-
{
|
|
911
|
-
id: "identityServiceCreateResponseExample",
|
|
912
|
-
response: {
|
|
913
|
-
body: {
|
|
914
|
-
id: "did:example:123#linked-domain",
|
|
915
|
-
type: "LinkedDomains",
|
|
916
|
-
serviceEndpoint: "https://bar.example.com"
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
]
|
|
921
|
-
}
|
|
922
|
-
]
|
|
923
|
-
};
|
|
924
|
-
const identityServiceRemoveRoute = {
|
|
925
|
-
operationId: "identityServiceRemove",
|
|
926
|
-
summary: "Remove an identity service",
|
|
927
|
-
tag: tagsIdentity[0].name,
|
|
928
|
-
method: "DELETE",
|
|
929
|
-
path: `${baseRouteName}/:identity/service/:serviceId`,
|
|
930
|
-
handler: async (httpRequestContext, request) => identityServiceRemove(httpRequestContext, componentName, request),
|
|
931
|
-
requestType: {
|
|
932
|
-
type: "IIdentityServiceRemoveRequest",
|
|
933
|
-
examples: [
|
|
934
|
-
{
|
|
935
|
-
id: "identityServiceRemoveRequestExample",
|
|
936
|
-
request: {
|
|
937
|
-
pathParams: {
|
|
938
|
-
identity: "did:iota:tst:0xe3088ba9aa8c28e1d139708a14e8c0fdff11ee8223baac4aa5bcf3321e4bfc6a",
|
|
939
|
-
serviceId: "did:example:123#linked-domain"
|
|
940
|
-
}
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
]
|
|
944
|
-
},
|
|
945
|
-
responseType: [
|
|
946
|
-
{
|
|
947
|
-
type: "INoContentResponse",
|
|
948
|
-
examples: [
|
|
949
|
-
{
|
|
950
|
-
id: "identityServiceCreateResponseExample",
|
|
951
|
-
response: {
|
|
952
|
-
statusCode: HttpStatusCode.noContent
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
]
|
|
956
|
-
}
|
|
957
|
-
]
|
|
958
|
-
};
|
|
959
|
-
const identityVerifiableCredentialCreateRoute = {
|
|
960
|
-
operationId: "identityVerifiableCredentialCreate",
|
|
961
|
-
summary: "Create an identity verifiable credential",
|
|
962
|
-
tag: tagsIdentity[0].name,
|
|
963
|
-
method: "POST",
|
|
964
|
-
path: `${baseRouteName}/:identity/verifiable-credential`,
|
|
965
|
-
handler: async (httpRequestContext, request) => identityVerifiableCredentialCreate(httpRequestContext, componentName, request),
|
|
966
|
-
requestType: {
|
|
967
|
-
type: "IIdentityVerifiableCredentialCreateRequest",
|
|
968
|
-
examples: [
|
|
969
|
-
{
|
|
970
|
-
id: "identityVerifiableCredentialCreateRequestExample",
|
|
971
|
-
request: {
|
|
972
|
-
pathParams: {
|
|
973
|
-
identity: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a",
|
|
974
|
-
verificationMethodId: "my-assertion"
|
|
975
|
-
},
|
|
976
|
-
body: {
|
|
977
|
-
credentialId: "https://example.com/credentials/3732",
|
|
978
|
-
subject: {
|
|
979
|
-
"@context": "https://schema.org",
|
|
980
|
-
"@type": "Person",
|
|
981
|
-
id: "did:entity-storage:0x4757993355b921a8229bd780f30921b6a0216a72e6c3f37a09d13b8426a17def",
|
|
982
|
-
name: "Jane Doe"
|
|
983
|
-
},
|
|
984
|
-
revocationIndex: 5
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
]
|
|
989
|
-
},
|
|
990
|
-
responseType: [
|
|
991
|
-
{
|
|
992
|
-
type: "IIdentityVerifiableCredentialCreateResponse",
|
|
993
|
-
examples: [
|
|
994
|
-
{
|
|
995
|
-
id: "identityVerifiableCredentialCreateResponseExample",
|
|
996
|
-
response: {
|
|
997
|
-
body: {
|
|
998
|
-
verifiableCredential: {
|
|
999
|
-
"@context": ["https://www.w3.org/2018/credentials/v1", "https://schema.org"],
|
|
1000
|
-
id: "https://example.com/credentials/3732",
|
|
1001
|
-
type: ["VerifiableCredential", "Person"],
|
|
1002
|
-
credentialSubject: {
|
|
1003
|
-
id: "did:entity-storage:0x4757993355b921a8229bd780f30921b6a0216a72e6c3f37a09d13b8426a17def",
|
|
1004
|
-
name: "Jane Doe"
|
|
1005
|
-
},
|
|
1006
|
-
issuer: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a",
|
|
1007
|
-
issuanceDate: "2025-01-24T09:21:51.500Z",
|
|
1008
|
-
credentialStatus: {
|
|
1009
|
-
id: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a#revocation",
|
|
1010
|
-
type: "BitstringStatusList",
|
|
1011
|
-
revocationBitmapIndex: "5"
|
|
1012
|
-
}
|
|
1013
|
-
},
|
|
1014
|
-
jwt: "eyJraWQiOi...D1Z3AQ"
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
]
|
|
1019
|
-
}
|
|
1020
|
-
]
|
|
1021
|
-
};
|
|
1022
|
-
const identityVerifiableCredentialVerifyRoute = {
|
|
1023
|
-
operationId: "identityVerifiableCredentialVerify",
|
|
1024
|
-
summary: "Verify an identity verifiable credential",
|
|
1025
|
-
tag: tagsIdentity[0].name,
|
|
1026
|
-
method: "GET",
|
|
1027
|
-
path: `${baseRouteName}/verifiable-credential/verify`,
|
|
1028
|
-
handler: async (httpRequestContext, request) => identityVerifiableCredentialVerify(httpRequestContext, componentName, request),
|
|
1029
|
-
requestType: {
|
|
1030
|
-
type: "IIdentityVerifiableCredentialVerifyRequest",
|
|
1031
|
-
examples: [
|
|
1032
|
-
{
|
|
1033
|
-
id: "identityVerifiableCredentialVerifyRequestExample",
|
|
1034
|
-
request: {
|
|
1035
|
-
query: {
|
|
1036
|
-
jwt: "eyJraWQiOi...D1Z3AQ"
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
]
|
|
1041
|
-
},
|
|
1042
|
-
responseType: [
|
|
1043
|
-
{
|
|
1044
|
-
type: "IIdentityVerifiableCredentialVerifyResponse",
|
|
1045
|
-
examples: [
|
|
1046
|
-
{
|
|
1047
|
-
id: "identityVerifiableCredentialVerifyResponseExample",
|
|
1048
|
-
response: {
|
|
1049
|
-
body: {
|
|
1050
|
-
revoked: false,
|
|
1051
|
-
verifiableCredential: {
|
|
1052
|
-
"@context": ["https://www.w3.org/2018/credentials/v1", "https://schema.org"],
|
|
1053
|
-
id: "https://example.com/credentials/3732",
|
|
1054
|
-
type: ["VerifiableCredential", "Person"],
|
|
1055
|
-
credentialSubject: {
|
|
1056
|
-
id: "did:entity-storage:0x4757993355b921a8229bd780f30921b6a0216a72e6c3f37a09d13b8426a17def",
|
|
1057
|
-
name: "Jane Doe"
|
|
1058
|
-
},
|
|
1059
|
-
issuer: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a",
|
|
1060
|
-
issuanceDate: "2025-01-24T09:21:51.500Z",
|
|
1061
|
-
credentialStatus: {
|
|
1062
|
-
id: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a#revocation",
|
|
1063
|
-
type: "BitstringStatusList",
|
|
1064
|
-
revocationBitmapIndex: "5"
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
]
|
|
1071
|
-
}
|
|
1072
|
-
],
|
|
1073
|
-
skipAuth: true
|
|
1074
|
-
};
|
|
1075
|
-
const identityVerifiableCredentialRevokeRoute = {
|
|
1076
|
-
operationId: "identityVerifiableCredentialRevoke",
|
|
1077
|
-
summary: "Revoke an identity verifiable credential",
|
|
1078
|
-
tag: tagsIdentity[0].name,
|
|
1079
|
-
method: "GET",
|
|
1080
|
-
path: `${baseRouteName}/:identity/verifiable-credential/revoke/:revocationIndex`,
|
|
1081
|
-
handler: async (httpRequestContext, request) => identityVerifiableCredentialRevoke(httpRequestContext, componentName, request),
|
|
1082
|
-
requestType: {
|
|
1083
|
-
type: "IIdentityVerifiableCredentialRevokeRequest",
|
|
1084
|
-
examples: [
|
|
1085
|
-
{
|
|
1086
|
-
id: "identityVerifiableCredentialRevokeRequestExample",
|
|
1087
|
-
request: {
|
|
1088
|
-
pathParams: {
|
|
1089
|
-
identity: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a",
|
|
1090
|
-
revocationIndex: 5
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
]
|
|
1095
|
-
},
|
|
1096
|
-
responseType: [
|
|
1097
|
-
{
|
|
1098
|
-
type: "INoContentResponse",
|
|
1099
|
-
examples: [
|
|
1100
|
-
{
|
|
1101
|
-
id: "identityServiceRevokeResponseExample",
|
|
1102
|
-
response: {
|
|
1103
|
-
statusCode: HttpStatusCode.noContent
|
|
1104
|
-
}
|
|
1105
|
-
}
|
|
1106
|
-
]
|
|
1107
|
-
}
|
|
1108
|
-
]
|
|
1109
|
-
};
|
|
1110
|
-
const identityVerifiableCredentialUnrevokeRoute = {
|
|
1111
|
-
operationId: "identityVerifiableCredentialUnrevoke",
|
|
1112
|
-
summary: "Unrevoke an identity verifiable credential",
|
|
1113
|
-
tag: tagsIdentity[0].name,
|
|
1114
|
-
method: "GET",
|
|
1115
|
-
path: `${baseRouteName}/:identity/verifiable-credential/unrevoke/:revocationIndex`,
|
|
1116
|
-
handler: async (httpRequestContext, request) => identityVerifiableCredentialUnrevoke(httpRequestContext, componentName, request),
|
|
1117
|
-
requestType: {
|
|
1118
|
-
type: "IIdentityVerifiableCredentialUnrevokeRequest",
|
|
1119
|
-
examples: [
|
|
1120
|
-
{
|
|
1121
|
-
id: "identityVerifiableCredentialUnrevokeRequestExample",
|
|
1122
|
-
request: {
|
|
1123
|
-
pathParams: {
|
|
1124
|
-
identity: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a",
|
|
1125
|
-
revocationIndex: 5
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
]
|
|
1130
|
-
},
|
|
1131
|
-
responseType: [
|
|
1132
|
-
{
|
|
1133
|
-
type: "INoContentResponse",
|
|
1134
|
-
examples: [
|
|
1135
|
-
{
|
|
1136
|
-
id: "identityServiceUnrevokeResponseExample",
|
|
1137
|
-
response: {
|
|
1138
|
-
statusCode: HttpStatusCode.noContent
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
]
|
|
1142
|
-
}
|
|
1143
|
-
]
|
|
1144
|
-
};
|
|
1145
|
-
const identityVerifiablePresentationCreateRoute = {
|
|
1146
|
-
operationId: "identityVerifiablePresentationCreate",
|
|
1147
|
-
summary: "Create an identity verifiable presentation",
|
|
1148
|
-
tag: tagsIdentity[0].name,
|
|
1149
|
-
method: "POST",
|
|
1150
|
-
path: `${baseRouteName}/:identity/verifiable-presentation`,
|
|
1151
|
-
handler: async (httpRequestContext, request) => identityVerifiablePresentationCreate(httpRequestContext, componentName, request),
|
|
1152
|
-
requestType: {
|
|
1153
|
-
type: "IIdentityVerifiablePresentationCreateRequest",
|
|
1154
|
-
examples: [
|
|
1155
|
-
{
|
|
1156
|
-
id: "identityVerifiablePresentationCreateRequestExample",
|
|
1157
|
-
request: {
|
|
1158
|
-
pathParams: {
|
|
1159
|
-
identity: "did:entity-storage:0x879c31386f992cfa29b77fe31e37256d69f6a57653cee4eb60ad4c4613c5515a",
|
|
1160
|
-
verificationMethodId: "my-assertion"
|
|
1161
|
-
},
|
|
1162
|
-
body: {
|
|
1163
|
-
presentationId: "https://example.com/presentation/3732",
|
|
1164
|
-
verifiableCredentials: ["eyJraWQiOi...D1Z3AQ"]
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
]
|
|
1169
|
-
},
|
|
1170
|
-
responseType: [
|
|
1171
|
-
{
|
|
1172
|
-
type: "IIdentityVerifiablePresentationCreateResponse",
|
|
1173
|
-
examples: [
|
|
1174
|
-
{
|
|
1175
|
-
id: "IIdentityVerifiablePresentationCreateResponseExample",
|
|
1176
|
-
response: {
|
|
1177
|
-
body: {
|
|
1178
|
-
verifiablePresentation: {
|
|
1179
|
-
"@context": ["https://www.w3.org/2018/credentials/v1", "https://schema.org"],
|
|
1180
|
-
id: "presentationId",
|
|
1181
|
-
type: ["VerifiablePresentation", "Person"],
|
|
1182
|
-
verifiableCredential: ["eyJraWQiOi...D1Z3AQ"],
|
|
1183
|
-
holder: "did:entity-storage:0xcea318e06e89f3fb4048160770effd84d0cfa5801fee13dfa6f9413a00429cec"
|
|
1184
|
-
},
|
|
1185
|
-
jwt: "eyJraWQiOi...D1Z3AQ"
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
]
|
|
1190
|
-
}
|
|
1191
|
-
]
|
|
1192
|
-
};
|
|
1193
|
-
const identityVerifiablePresentationVerifyRoute = {
|
|
1194
|
-
operationId: "identityVerifiablePresentationVerify",
|
|
1195
|
-
summary: "Verify an identity verifiable presentation",
|
|
1196
|
-
tag: tagsIdentity[0].name,
|
|
1197
|
-
method: "GET",
|
|
1198
|
-
path: `${baseRouteName}/verifiable-presentation/verify`,
|
|
1199
|
-
handler: async (httpRequestContext, request) => identityVerifiablePresentationVerify(httpRequestContext, componentName, request),
|
|
1200
|
-
requestType: {
|
|
1201
|
-
type: "IIdentityVerifiablePresentationVerifyRequest",
|
|
1202
|
-
examples: [
|
|
1203
|
-
{
|
|
1204
|
-
id: "identityVerifiablePresentationVerifyRequestExample",
|
|
1205
|
-
request: {
|
|
1206
|
-
query: {
|
|
1207
|
-
jwt: "eyJraWQiOi...D1Z3AQ"
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
}
|
|
1211
|
-
]
|
|
1212
|
-
},
|
|
1213
|
-
responseType: [
|
|
1214
|
-
{
|
|
1215
|
-
type: "IIdentityVerifiablePresentationVerifyResponse",
|
|
1216
|
-
examples: [
|
|
1217
|
-
{
|
|
1218
|
-
id: "identityVerifiablePresentationVerifyResponseExample",
|
|
1219
|
-
response: {
|
|
1220
|
-
body: {
|
|
1221
|
-
revoked: false,
|
|
1222
|
-
verifiablePresentation: {
|
|
1223
|
-
"@context": ["https://www.w3.org/2018/credentials/v1", "https://schema.org"],
|
|
1224
|
-
id: "presentationId",
|
|
1225
|
-
type: ["VerifiablePresentation", "Person"],
|
|
1226
|
-
verifiableCredential: ["eyJraWQiOi...D1Z3AQ"],
|
|
1227
|
-
holder: "did:entity-storage:0xcea318e06e89f3fb4048160770effd84d0cfa5801fee13dfa6f9413a00429cec"
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
]
|
|
1233
|
-
}
|
|
1234
|
-
],
|
|
1235
|
-
skipAuth: true
|
|
1236
|
-
};
|
|
1237
|
-
const identityProofCreateRoute = {
|
|
1238
|
-
operationId: "identityProofCreate",
|
|
1239
|
-
summary: "Create an identity proof",
|
|
1240
|
-
tag: tagsIdentity[0].name,
|
|
1241
|
-
method: "POST",
|
|
1242
|
-
path: `${baseRouteName}/:identity/proof`,
|
|
1243
|
-
handler: async (httpRequestContext, request) => identityProofCreate(httpRequestContext, componentName, request),
|
|
1244
|
-
requestType: {
|
|
1245
|
-
type: "IIdentityProofCreateRequest",
|
|
1246
|
-
examples: [
|
|
1247
|
-
{
|
|
1248
|
-
id: "identityProofCreateRequestExample",
|
|
1249
|
-
request: {
|
|
1250
|
-
pathParams: {
|
|
1251
|
-
identity: "did:entity-storage:0xda2df3ebc91ee0d5229d6532ffd0f4426952a94f34988b0ca906694dfd366a6a",
|
|
1252
|
-
verificationMethodId: "my-verification-id"
|
|
1253
|
-
},
|
|
1254
|
-
body: {
|
|
1255
|
-
proofType: "DataIntegrityProof",
|
|
1256
|
-
document: {
|
|
1257
|
-
"@context": [
|
|
1258
|
-
"https://www.w3.org/2018/credentials/v1",
|
|
1259
|
-
"https://www.w3.org/2018/credentials/examples/v1"
|
|
1260
|
-
],
|
|
1261
|
-
id: "urn:uuid:58172aac-d8ba-11ed-83dd-0b3aef56cc33",
|
|
1262
|
-
type: ["VerifiableCredential", "AlumniCredential"],
|
|
1263
|
-
name: "Alumni Credential",
|
|
1264
|
-
description: "A minimum viable example of an Alumni Credential.",
|
|
1265
|
-
issuer: "https://vc.example/issuers/5678",
|
|
1266
|
-
validFrom: "2023-01-01T00:00:00Z",
|
|
1267
|
-
credentialSubject: {
|
|
1268
|
-
id: "did:example:abcdefgh",
|
|
1269
|
-
alumniOf: "The School of Examples"
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
]
|
|
1276
|
-
},
|
|
1277
|
-
responseType: [
|
|
1278
|
-
{
|
|
1279
|
-
type: "IIdentityProofCreateResponse",
|
|
1280
|
-
examples: [
|
|
1281
|
-
{
|
|
1282
|
-
id: "identityProofCreateResponseExample",
|
|
1283
|
-
response: {
|
|
1284
|
-
body: {
|
|
1285
|
-
"@context": [
|
|
1286
|
-
"https://www.w3.org/ns/credentials/v2",
|
|
1287
|
-
"https://www.w3.org/ns/credentials/examples/v2"
|
|
1288
|
-
],
|
|
1289
|
-
type: "DataIntegrityProof",
|
|
1290
|
-
cryptosuite: "eddsa-jcs-2022",
|
|
1291
|
-
created: "2024-01-31T16:00:45.490Z",
|
|
1292
|
-
verificationMethod: "did:entity-storage:0x0101010101010101010101010101010101010101010101010101010101010101#my-verification-id",
|
|
1293
|
-
proofPurpose: "assertionMethod",
|
|
1294
|
-
proofValue: "z2zGoejwpX6HH2T11BZaniEVZrqRKDpwbQSvPcL7eL9M7hV5P9zQQZxs85n6qyDzkkXCL8aFUWfwQD5bxVGqDK1fa"
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
]
|
|
1299
|
-
}
|
|
1300
|
-
]
|
|
1301
|
-
};
|
|
1302
|
-
const identityProofVerifyRoute = {
|
|
1303
|
-
operationId: "identityProofVerify",
|
|
1304
|
-
summary: "Verify an identity proof",
|
|
1305
|
-
tag: tagsIdentity[0].name,
|
|
1306
|
-
method: "POST",
|
|
1307
|
-
path: `${baseRouteName}/proof/verify`,
|
|
1308
|
-
handler: async (httpRequestContext, request) => identityProofVerify(httpRequestContext, componentName, request),
|
|
1309
|
-
requestType: {
|
|
1310
|
-
type: "IIdentityProofVerifyRequest",
|
|
1311
|
-
examples: [
|
|
1312
|
-
{
|
|
1313
|
-
id: "identityProofVerifyRequestExample",
|
|
1314
|
-
request: {
|
|
1315
|
-
body: {
|
|
1316
|
-
document: {
|
|
1317
|
-
"@context": [
|
|
1318
|
-
"https://www.w3.org/2018/credentials/v1",
|
|
1319
|
-
"https://www.w3.org/2018/credentials/examples/v1"
|
|
1320
|
-
],
|
|
1321
|
-
id: "urn:uuid:58172aac-d8ba-11ed-83dd-0b3aef56cc33",
|
|
1322
|
-
type: ["VerifiableCredential", "AlumniCredential"],
|
|
1323
|
-
name: "Alumni Credential",
|
|
1324
|
-
description: "A minimum viable example of an Alumni Credential.",
|
|
1325
|
-
issuer: "https://vc.example/issuers/5678",
|
|
1326
|
-
validFrom: "2023-01-01T00:00:00Z",
|
|
1327
|
-
credentialSubject: {
|
|
1328
|
-
id: "did:example:abcdefgh",
|
|
1329
|
-
alumniOf: "The School of Examples"
|
|
1330
|
-
}
|
|
1331
|
-
},
|
|
1332
|
-
proof: {
|
|
1333
|
-
"@context": "https://www.w3.org/ns/credentials/v2",
|
|
1334
|
-
type: "DataIntegrityProof",
|
|
1335
|
-
cryptosuite: "eddsa-jcs-2022",
|
|
1336
|
-
created: "2025-01-24T11:32:13.106Z",
|
|
1337
|
-
verificationMethod: "did:entity-storage:0xda2df3ebc91ee0d5229d6532ffd0f4426952a94f34988b0ca906694dfd366a6a#my-verification-id",
|
|
1338
|
-
proofPurpose: "assertionMethod",
|
|
1339
|
-
proofValue: "2fVLgANruCBoRPBCJavi54mZtkQdyMz6T2N4XVyB96asawiriKrVWoktcSQ7dMGrBTiemBBDpcLE2HfiTBCGuBmq"
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
]
|
|
1345
|
-
},
|
|
1346
|
-
responseType: [
|
|
1347
|
-
{
|
|
1348
|
-
type: "IIdentityProofVerifyResponse",
|
|
1349
|
-
examples: [
|
|
1350
|
-
{
|
|
1351
|
-
id: "identityProofVerifyResponseExample",
|
|
1352
|
-
response: {
|
|
1353
|
-
body: {
|
|
1354
|
-
verified: true
|
|
1355
|
-
}
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
]
|
|
1359
|
-
}
|
|
1360
|
-
],
|
|
1361
|
-
skipAuth: true
|
|
1362
|
-
};
|
|
1363
|
-
return [
|
|
1364
|
-
identityCreateRoute,
|
|
1365
|
-
identityRemoveRoute,
|
|
1366
|
-
identityVerificationMethodCreateRoute,
|
|
1367
|
-
identityVerificationMethodRemoveRoute,
|
|
1368
|
-
identityServiceCreateRoute,
|
|
1369
|
-
identityServiceRemoveRoute,
|
|
1370
|
-
identityVerifiableCredentialCreateRoute,
|
|
1371
|
-
identityVerifiableCredentialVerifyRoute,
|
|
1372
|
-
identityVerifiableCredentialRevokeRoute,
|
|
1373
|
-
identityVerifiableCredentialUnrevokeRoute,
|
|
1374
|
-
identityVerifiablePresentationCreateRoute,
|
|
1375
|
-
identityVerifiablePresentationVerifyRoute,
|
|
1376
|
-
identityProofCreateRoute,
|
|
1377
|
-
identityProofVerifyRoute
|
|
1378
|
-
];
|
|
1379
|
-
}
|
|
1380
|
-
/**
|
|
1381
|
-
* Create an identity.
|
|
1382
|
-
* @param httpRequestContext The request context for the API.
|
|
1383
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1384
|
-
* @param request The request.
|
|
1385
|
-
* @returns The response object with additional http response properties.
|
|
1386
|
-
*/
|
|
1387
|
-
async function identityCreate(httpRequestContext, componentName, request) {
|
|
1388
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1389
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1390
|
-
const component = ComponentFactory.get(componentName);
|
|
1391
|
-
const result = await component.identityCreate(request.body?.namespace, httpRequestContext.userIdentity);
|
|
1392
|
-
return {
|
|
1393
|
-
body: result
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
/**
|
|
1397
|
-
* Remove an identity.
|
|
1398
|
-
* @param httpRequestContext The request context for the API.
|
|
1399
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1400
|
-
* @param request The request.
|
|
1401
|
-
* @returns The response object with additional http response properties.
|
|
1402
|
-
*/
|
|
1403
|
-
async function identityRemove(httpRequestContext, componentName, request) {
|
|
1404
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1405
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1406
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1407
|
-
const component = ComponentFactory.get(componentName);
|
|
1408
|
-
await component.identityRemove(request.pathParams.identity, httpRequestContext.userIdentity);
|
|
1409
|
-
return {
|
|
1410
|
-
statusCode: HttpStatusCode.noContent
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
|
-
/**
|
|
1414
|
-
* Create an identity verification method.
|
|
1415
|
-
* @param httpRequestContext The request context for the API.
|
|
1416
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1417
|
-
* @param request The request.
|
|
1418
|
-
* @returns The response object with additional http response properties.
|
|
1419
|
-
*/
|
|
1420
|
-
async function identityVerificationMethodCreate(httpRequestContext, componentName, request) {
|
|
1421
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1422
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1423
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1424
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1425
|
-
const component = ComponentFactory.get(componentName);
|
|
1426
|
-
const result = await component.verificationMethodCreate(request.pathParams.identity, request.body.verificationMethodType, request.body.verificationMethodId, httpRequestContext.userIdentity);
|
|
1427
|
-
return {
|
|
1428
|
-
body: result
|
|
1429
|
-
};
|
|
1430
|
-
}
|
|
1431
|
-
/**
|
|
1432
|
-
* Remove an identity verification method.
|
|
1433
|
-
* @param httpRequestContext The request context for the API.
|
|
1434
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1435
|
-
* @param request The request.
|
|
1436
|
-
* @returns The response object with additional http response properties.
|
|
1437
|
-
*/
|
|
1438
|
-
async function identityVerificationMethodRemove(httpRequestContext, componentName, request) {
|
|
1439
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1440
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1441
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1442
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1443
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.verificationMethodId", request.pathParams.verificationMethodId);
|
|
1444
|
-
const component = ComponentFactory.get(componentName);
|
|
1445
|
-
await component.verificationMethodRemove(DocumentHelper.joinId(request.pathParams.identity, request.pathParams.verificationMethodId), httpRequestContext.userIdentity);
|
|
1446
|
-
return {
|
|
1447
|
-
statusCode: HttpStatusCode.noContent
|
|
1448
|
-
};
|
|
1449
|
-
}
|
|
1450
|
-
/**
|
|
1451
|
-
* Create an identity service.
|
|
1452
|
-
* @param httpRequestContext The request context for the API.
|
|
1453
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1454
|
-
* @param request The request.
|
|
1455
|
-
* @returns The response object with additional http response properties.
|
|
1456
|
-
*/
|
|
1457
|
-
async function identityServiceCreate(httpRequestContext, componentName, request) {
|
|
1458
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1459
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1460
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1461
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1462
|
-
const component = ComponentFactory.get(componentName);
|
|
1463
|
-
const result = await component.serviceCreate(request.pathParams.identity, request.body.serviceId, request.body.type, request.body.endpoint, httpRequestContext.userIdentity);
|
|
1464
|
-
return {
|
|
1465
|
-
body: result
|
|
1466
|
-
};
|
|
1467
|
-
}
|
|
1468
|
-
/**
|
|
1469
|
-
* Remove an identity service.
|
|
1470
|
-
* @param httpRequestContext The request context for the API.
|
|
1471
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1472
|
-
* @param request The request.
|
|
1473
|
-
* @returns The response object with additional http response properties.
|
|
1474
|
-
*/
|
|
1475
|
-
async function identityServiceRemove(httpRequestContext, componentName, request) {
|
|
1476
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1477
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1478
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1479
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1480
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.serviceId", request.pathParams.serviceId);
|
|
1481
|
-
const component = ComponentFactory.get(componentName);
|
|
1482
|
-
await component.serviceRemove(DocumentHelper.joinId(request.pathParams.identity, request.pathParams.serviceId), httpRequestContext.userIdentity);
|
|
1483
|
-
return {
|
|
1484
|
-
statusCode: HttpStatusCode.noContent
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Create a verifiable credential.
|
|
1489
|
-
* @param httpRequestContext The request context for the API.
|
|
1490
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1491
|
-
* @param request The request.
|
|
1492
|
-
* @returns The response object with additional http response properties.
|
|
1493
|
-
*/
|
|
1494
|
-
async function identityVerifiableCredentialCreate(httpRequestContext, componentName, request) {
|
|
1495
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1496
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1497
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1498
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1499
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.verificationMethodId", request.pathParams.verificationMethodId);
|
|
1500
|
-
const component = ComponentFactory.get(componentName);
|
|
1501
|
-
const result = await component.verifiableCredentialCreate(DocumentHelper.joinId(request.pathParams.identity, request.pathParams.verificationMethodId), request.body.credentialId, request.body.subject, {
|
|
1502
|
-
revocationIndex: request.body.revocationIndex,
|
|
1503
|
-
expirationDate: Coerce.date(request.body.expirationDate)
|
|
1504
|
-
}, httpRequestContext.userIdentity);
|
|
1505
|
-
return {
|
|
1506
|
-
body: result
|
|
1507
|
-
};
|
|
1508
|
-
}
|
|
1509
|
-
/**
|
|
1510
|
-
* Verify a verifiable credential.
|
|
1511
|
-
* @param httpRequestContext The request context for the API.
|
|
1512
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1513
|
-
* @param request The request.
|
|
1514
|
-
* @returns The response object with additional http response properties.
|
|
1515
|
-
*/
|
|
1516
|
-
async function identityVerifiableCredentialVerify(httpRequestContext, componentName, request) {
|
|
1517
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1518
|
-
Guards.object(ROUTES_SOURCE, "request.query", request.query);
|
|
1519
|
-
Guards.stringValue(ROUTES_SOURCE, "request.query.jwt", request.query.jwt);
|
|
1520
|
-
const component = ComponentFactory.get(componentName);
|
|
1521
|
-
const result = await component.verifiableCredentialVerify(request.query.jwt);
|
|
1522
|
-
return {
|
|
1523
|
-
body: result
|
|
1524
|
-
};
|
|
1525
|
-
}
|
|
1526
|
-
/**
|
|
1527
|
-
* Revoke a verifiable credential.
|
|
1528
|
-
* @param httpRequestContext The request context for the API.
|
|
1529
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1530
|
-
* @param request The request.
|
|
1531
|
-
* @returns The response object with additional http response properties.
|
|
1532
|
-
*/
|
|
1533
|
-
async function identityVerifiableCredentialRevoke(httpRequestContext, componentName, request) {
|
|
1534
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1535
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1536
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1537
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1538
|
-
const revocationIndex = Coerce.number(request.pathParams.revocationIndex);
|
|
1539
|
-
Guards.integer(ROUTES_SOURCE, "request.pathParams.revocationIndex", revocationIndex);
|
|
1540
|
-
const component = ComponentFactory.get(componentName);
|
|
1541
|
-
await component.verifiableCredentialRevoke(request.pathParams.identity, revocationIndex, httpRequestContext.userIdentity);
|
|
1542
|
-
return {
|
|
1543
|
-
statusCode: HttpStatusCode.noContent
|
|
1544
|
-
};
|
|
1545
|
-
}
|
|
1546
|
-
/**
|
|
1547
|
-
* Unrevoke a verifiable credential.
|
|
1548
|
-
* @param httpRequestContext The request context for the API.
|
|
1549
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1550
|
-
* @param request The request.
|
|
1551
|
-
* @returns The response object with additional http response properties.
|
|
1552
|
-
*/
|
|
1553
|
-
async function identityVerifiableCredentialUnrevoke(httpRequestContext, componentName, request) {
|
|
1554
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1555
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1556
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1557
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1558
|
-
const revocationIndex = Coerce.number(request.pathParams.revocationIndex);
|
|
1559
|
-
Guards.integer(ROUTES_SOURCE, "request.pathParams.revocationIndex", revocationIndex);
|
|
1560
|
-
const component = ComponentFactory.get(componentName);
|
|
1561
|
-
await component.verifiableCredentialUnrevoke(request.pathParams.identity, revocationIndex, httpRequestContext.userIdentity);
|
|
1562
|
-
return {
|
|
1563
|
-
statusCode: HttpStatusCode.noContent
|
|
1564
|
-
};
|
|
1565
|
-
}
|
|
1566
|
-
/**
|
|
1567
|
-
* Create a verifiable presentation.
|
|
1568
|
-
* @param httpRequestContext The request context for the API.
|
|
1569
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1570
|
-
* @param request The request.
|
|
1571
|
-
* @returns The response object with additional http response properties.
|
|
1572
|
-
*/
|
|
1573
|
-
async function identityVerifiablePresentationCreate(httpRequestContext, componentName, request) {
|
|
1574
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1575
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1576
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1577
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1578
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.verificationMethodId", request.pathParams.verificationMethodId);
|
|
1579
|
-
const component = ComponentFactory.get(componentName);
|
|
1580
|
-
const result = await component.verifiablePresentationCreate(DocumentHelper.joinId(request.pathParams.identity, request.pathParams.verificationMethodId), request.body.presentationId, request.body.contexts, request.body.types, request.body.verifiableCredentials, request.body.expiresInMinutes, httpRequestContext.userIdentity);
|
|
1581
|
-
return {
|
|
1582
|
-
body: result
|
|
1583
|
-
};
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* Verify a verifiable presentation.
|
|
1587
|
-
* @param httpRequestContext The request context for the API.
|
|
1588
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1589
|
-
* @param request The request.
|
|
1590
|
-
* @returns The response object with additional http response properties.
|
|
1591
|
-
*/
|
|
1592
|
-
async function identityVerifiablePresentationVerify(httpRequestContext, componentName, request) {
|
|
1593
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1594
|
-
Guards.object(ROUTES_SOURCE, "request.query", request.query);
|
|
1595
|
-
Guards.stringValue(ROUTES_SOURCE, "request.query.jwt", request.query.jwt);
|
|
1596
|
-
const component = ComponentFactory.get(componentName);
|
|
1597
|
-
const result = await component.verifiablePresentationVerify(request.query.jwt);
|
|
1598
|
-
return {
|
|
1599
|
-
body: result
|
|
1600
|
-
};
|
|
1601
|
-
}
|
|
1602
|
-
/**
|
|
1603
|
-
* Create an identity proof.
|
|
1604
|
-
* @param httpRequestContext The request context for the API.
|
|
1605
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1606
|
-
* @param request The request.
|
|
1607
|
-
* @returns The response object with additional http response properties.
|
|
1608
|
-
*/
|
|
1609
|
-
async function identityProofCreate(httpRequestContext, componentName, request) {
|
|
1610
|
-
Guards.stringValue(ROUTES_SOURCE, "httpRequestContext.userIdentity", httpRequestContext.userIdentity);
|
|
1611
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1612
|
-
Guards.object(ROUTES_SOURCE, "request.pathParams", request.pathParams);
|
|
1613
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.identity", request.pathParams.identity);
|
|
1614
|
-
Guards.stringValue(ROUTES_SOURCE, "request.pathParams.verificationMethodId", request.pathParams.verificationMethodId);
|
|
1615
|
-
Guards.object(ROUTES_SOURCE, "request.body", request.body);
|
|
1616
|
-
const component = ComponentFactory.get(componentName);
|
|
1617
|
-
const result = await component.proofCreate(request.pathParams.identity, request.body.proofType, request.body.document, httpRequestContext.userIdentity);
|
|
1618
|
-
return {
|
|
1619
|
-
body: result
|
|
1620
|
-
};
|
|
1621
|
-
}
|
|
1622
|
-
/**
|
|
1623
|
-
* Verify an identity proof.
|
|
1624
|
-
* @param httpRequestContext The request context for the API.
|
|
1625
|
-
* @param componentName The name of the component to use in the routes stored in the ComponentFactory.
|
|
1626
|
-
* @param request The request.
|
|
1627
|
-
* @returns The response object with additional http response properties.
|
|
1628
|
-
*/
|
|
1629
|
-
async function identityProofVerify(httpRequestContext, componentName, request) {
|
|
1630
|
-
Guards.object(ROUTES_SOURCE, "request", request);
|
|
1631
|
-
Guards.object(ROUTES_SOURCE, "request.body", request.body);
|
|
1632
|
-
const component = ComponentFactory.get(componentName);
|
|
1633
|
-
const result = await component.proofVerify(request.body.document, request.body.proof);
|
|
1634
|
-
return {
|
|
1635
|
-
body: {
|
|
1636
|
-
verified: result
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
// Copyright 2024 IOTA Stiftung.
|
|
1642
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
1643
|
-
/**
|
|
1644
|
-
* Class which implements the identity contract.
|
|
1645
|
-
*/
|
|
1646
|
-
class IdentityService {
|
|
1647
|
-
/**
|
|
1648
|
-
* Runtime name for the class.
|
|
1649
|
-
*/
|
|
1650
|
-
static CLASS_NAME = "IdentityService";
|
|
1651
|
-
/**
|
|
1652
|
-
* The default namespace for the connector to use.
|
|
1653
|
-
* @internal
|
|
1654
|
-
*/
|
|
1655
|
-
_defaultNamespace;
|
|
1656
|
-
/**
|
|
1657
|
-
* Create a new instance of IdentityService.
|
|
1658
|
-
* @param options The options for the service.
|
|
1659
|
-
*/
|
|
1660
|
-
constructor(options) {
|
|
1661
|
-
const names = IdentityConnectorFactory.names();
|
|
1662
|
-
if (names.length === 0) {
|
|
1663
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "noConnectors");
|
|
1664
|
-
}
|
|
1665
|
-
this._defaultNamespace = options?.config?.defaultNamespace ?? names[0];
|
|
1666
|
-
}
|
|
1667
|
-
/**
|
|
1668
|
-
* Create a new identity.
|
|
1669
|
-
* @param namespace The namespace of the connector to use for the identity, defaults to service configured namespace.
|
|
1670
|
-
* @param controller The controller of the identity who can make changes.
|
|
1671
|
-
* @returns The created identity document.
|
|
1672
|
-
*/
|
|
1673
|
-
async identityCreate(namespace, controller) {
|
|
1674
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1675
|
-
try {
|
|
1676
|
-
const identityConnector = this.getConnectorByNamespace(namespace);
|
|
1677
|
-
return identityConnector.createDocument(controller);
|
|
1678
|
-
}
|
|
1679
|
-
catch (error) {
|
|
1680
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "identityCreateFailed", undefined, error);
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
/**
|
|
1684
|
-
* Remove an identity.
|
|
1685
|
-
* @param identity The id of the document to remove.
|
|
1686
|
-
* @param controller The controller of the identity who can make changes.
|
|
1687
|
-
* @returns Nothing.
|
|
1688
|
-
*/
|
|
1689
|
-
async identityRemove(identity, controller) {
|
|
1690
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "identity", identity);
|
|
1691
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1692
|
-
try {
|
|
1693
|
-
const identityConnector = this.getConnectorByUri(identity);
|
|
1694
|
-
return identityConnector.removeDocument(controller, identity);
|
|
1695
|
-
}
|
|
1696
|
-
catch (error) {
|
|
1697
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "identityRemoveFailed", { identity }, error);
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
/**
|
|
1701
|
-
* Add a verification method to the document in JSON Web key Format.
|
|
1702
|
-
* @param identity The id of the document to add the verification method to.
|
|
1703
|
-
* @param verificationMethodType The type of the verification method to add.
|
|
1704
|
-
* @param verificationMethodId The id of the verification method, if undefined uses the kid of the generated JWK.
|
|
1705
|
-
* @param controller The controller of the identity who can make changes.
|
|
1706
|
-
* @returns The verification method.
|
|
1707
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
1708
|
-
* @throws NotSupportedError if the platform does not support multiple keys.
|
|
1709
|
-
*/
|
|
1710
|
-
async verificationMethodCreate(identity, verificationMethodType, verificationMethodId, controller) {
|
|
1711
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1712
|
-
Urn.guard(IdentityService.CLASS_NAME, "identity", identity);
|
|
1713
|
-
Guards.arrayOneOf(IdentityService.CLASS_NAME, "verificationMethodType", verificationMethodType, Object.values(DidVerificationMethodType));
|
|
1714
|
-
try {
|
|
1715
|
-
const identityConnector = this.getConnectorByUri(identity);
|
|
1716
|
-
const verificationMethod = await identityConnector.addVerificationMethod(controller, identity, verificationMethodType, verificationMethodId);
|
|
1717
|
-
return verificationMethod;
|
|
1718
|
-
}
|
|
1719
|
-
catch (error) {
|
|
1720
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verificationMethodCreateFailed", { identity }, error);
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
/**
|
|
1724
|
-
* Remove a verification method from the document.
|
|
1725
|
-
* @param verificationMethodId The id of the verification method.
|
|
1726
|
-
* @param controller The controller of the identity who can make changes.
|
|
1727
|
-
* @returns Nothing.
|
|
1728
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
1729
|
-
* @throws NotSupportedError if the platform does not support multiple revocable keys.
|
|
1730
|
-
*/
|
|
1731
|
-
async verificationMethodRemove(verificationMethodId, controller) {
|
|
1732
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1733
|
-
Urn.guard(IdentityService.CLASS_NAME, "verificationMethodId", verificationMethodId);
|
|
1734
|
-
try {
|
|
1735
|
-
const idParts = DocumentHelper.parseId(verificationMethodId);
|
|
1736
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1737
|
-
await identityConnector.removeVerificationMethod(controller, verificationMethodId);
|
|
1738
|
-
}
|
|
1739
|
-
catch (error) {
|
|
1740
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verificationMethodRemoveFailed", { verificationMethodId }, error);
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
/**
|
|
1744
|
-
* Add a service to the document.
|
|
1745
|
-
* @param identity The id of the document to add the service to.
|
|
1746
|
-
* @param serviceId The id of the service.
|
|
1747
|
-
* @param serviceType The type of the service.
|
|
1748
|
-
* @param serviceEndpoint The endpoint for the service.
|
|
1749
|
-
* @param controller The controller of the identity who can make changes.
|
|
1750
|
-
* @returns The service.
|
|
1751
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
1752
|
-
*/
|
|
1753
|
-
async serviceCreate(identity, serviceId, serviceType, serviceEndpoint, controller) {
|
|
1754
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1755
|
-
Urn.guard(IdentityService.CLASS_NAME, "identity", identity);
|
|
1756
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "serviceId", serviceId);
|
|
1757
|
-
if (Is.array(serviceType)) {
|
|
1758
|
-
Guards.arrayValue(IdentityService.CLASS_NAME, "serviceType", serviceType);
|
|
1759
|
-
}
|
|
1760
|
-
else {
|
|
1761
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "serviceType", serviceType);
|
|
1762
|
-
}
|
|
1763
|
-
if (Is.array(serviceEndpoint)) {
|
|
1764
|
-
Guards.arrayValue(IdentityService.CLASS_NAME, "serviceEndpoint", serviceEndpoint);
|
|
1765
|
-
}
|
|
1766
|
-
else {
|
|
1767
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "serviceEndpoint", serviceEndpoint);
|
|
1768
|
-
}
|
|
1769
|
-
try {
|
|
1770
|
-
const identityConnector = this.getConnectorByUri(identity);
|
|
1771
|
-
const service = await identityConnector.addService(controller, identity, serviceId, serviceType, serviceEndpoint);
|
|
1772
|
-
return service;
|
|
1773
|
-
}
|
|
1774
|
-
catch (error) {
|
|
1775
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "serviceCreateFailed", { identity, serviceId }, error);
|
|
1776
|
-
}
|
|
1777
|
-
}
|
|
1778
|
-
/**
|
|
1779
|
-
* Remove a service from the document.
|
|
1780
|
-
* @param serviceId The id of the service.
|
|
1781
|
-
* @param controller The controller of the identity who can make changes.
|
|
1782
|
-
* @returns Nothing.
|
|
1783
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
1784
|
-
*/
|
|
1785
|
-
async serviceRemove(serviceId, controller) {
|
|
1786
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1787
|
-
Urn.guard(IdentityService.CLASS_NAME, "serviceId", serviceId);
|
|
1788
|
-
try {
|
|
1789
|
-
const idParts = DocumentHelper.parseId(serviceId);
|
|
1790
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1791
|
-
await identityConnector.removeService(controller, serviceId);
|
|
1792
|
-
}
|
|
1793
|
-
catch (error) {
|
|
1794
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "serviceRemoveFailed", { serviceId }, error);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
/**
|
|
1798
|
-
* Create a verifiable credential for a verification method.
|
|
1799
|
-
* @param verificationMethodId The verification method id to use.
|
|
1800
|
-
* @param id The id of the credential.
|
|
1801
|
-
* @param subject The credential subject to store in the verifiable credential.
|
|
1802
|
-
* @param options Additional options for creating the verifiable credential.
|
|
1803
|
-
* @param options.revocationIndex The bitmap revocation index of the credential, if undefined will not have revocation status.
|
|
1804
|
-
* @param options.expirationDate The date the verifiable credential is valid until.
|
|
1805
|
-
* @param controller The controller of the identity who can make changes.
|
|
1806
|
-
* @returns The created verifiable credential and its token.
|
|
1807
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
1808
|
-
*/
|
|
1809
|
-
async verifiableCredentialCreate(verificationMethodId, id, subject, options, controller) {
|
|
1810
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1811
|
-
Urn.guard(IdentityService.CLASS_NAME, "verificationMethodId", verificationMethodId);
|
|
1812
|
-
Guards.objectValue(IdentityService.CLASS_NAME, "subject", subject);
|
|
1813
|
-
try {
|
|
1814
|
-
const idParts = DocumentHelper.parseId(verificationMethodId);
|
|
1815
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1816
|
-
const service = await identityConnector.createVerifiableCredential(controller, verificationMethodId, id, subject, options);
|
|
1817
|
-
return service;
|
|
1818
|
-
}
|
|
1819
|
-
catch (error) {
|
|
1820
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verifiableCredentialCreateFailed", { verificationMethodId }, error);
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
/**
|
|
1824
|
-
* Verify a verifiable credential is valid.
|
|
1825
|
-
* @param credentialJwt The credential to verify.
|
|
1826
|
-
* @returns The credential stored in the jwt and the revocation status.
|
|
1827
|
-
*/
|
|
1828
|
-
async verifiableCredentialVerify(credentialJwt) {
|
|
1829
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "credentialJwt", credentialJwt);
|
|
1830
|
-
const jwtDecoded = await Jwt.decode(credentialJwt);
|
|
1831
|
-
const jwtHeader = jwtDecoded.header;
|
|
1832
|
-
const jwtPayload = jwtDecoded.payload;
|
|
1833
|
-
const jwtSignature = jwtDecoded.signature;
|
|
1834
|
-
if (Is.undefined(jwtHeader) ||
|
|
1835
|
-
Is.undefined(jwtPayload) ||
|
|
1836
|
-
Is.undefined(jwtPayload.iss) ||
|
|
1837
|
-
Is.undefined(jwtSignature)) {
|
|
1838
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "jwtDecodeFailed");
|
|
1839
|
-
}
|
|
1840
|
-
try {
|
|
1841
|
-
const identityConnector = this.getConnectorByUri(jwtPayload.iss);
|
|
1842
|
-
const service = await identityConnector.checkVerifiableCredential(credentialJwt);
|
|
1843
|
-
return service;
|
|
1844
|
-
}
|
|
1845
|
-
catch (error) {
|
|
1846
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verifiableCredentialVerifyFailed", undefined, error);
|
|
1847
|
-
}
|
|
1848
|
-
}
|
|
1849
|
-
/**
|
|
1850
|
-
* Revoke verifiable credential.
|
|
1851
|
-
* @param issuerIdentity The id of the document to update the revocation list for.
|
|
1852
|
-
* @param credentialIndex The revocation bitmap index revoke.
|
|
1853
|
-
* @param controller The controller of the identity who can make changes.
|
|
1854
|
-
* @returns Nothing.
|
|
1855
|
-
*/
|
|
1856
|
-
async verifiableCredentialRevoke(issuerIdentity, credentialIndex, controller) {
|
|
1857
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1858
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "issuerIdentity", issuerIdentity);
|
|
1859
|
-
Guards.number(IdentityService.CLASS_NAME, "credentialIndex", credentialIndex);
|
|
1860
|
-
try {
|
|
1861
|
-
const idParts = DocumentHelper.parseId(issuerIdentity);
|
|
1862
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1863
|
-
return identityConnector.revokeVerifiableCredentials(controller, issuerIdentity, [
|
|
1864
|
-
credentialIndex
|
|
1865
|
-
]);
|
|
1866
|
-
}
|
|
1867
|
-
catch (error) {
|
|
1868
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verifiableCredentialRevokeFailed", { issuerIdentity, credentialIndex }, error);
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1871
|
-
/**
|
|
1872
|
-
* Unrevoke verifiable credential.
|
|
1873
|
-
* @param issuerIdentity The id of the document to update the revocation list for.
|
|
1874
|
-
* @param credentialIndex The revocation bitmap index to un revoke.
|
|
1875
|
-
* @param controller The controller of the identity who can make changes.
|
|
1876
|
-
* @returns Nothing.
|
|
1877
|
-
*/
|
|
1878
|
-
async verifiableCredentialUnrevoke(issuerIdentity, credentialIndex, controller) {
|
|
1879
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1880
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "issuerIdentity", issuerIdentity);
|
|
1881
|
-
Guards.number(IdentityService.CLASS_NAME, "credentialIndex", credentialIndex);
|
|
1882
|
-
try {
|
|
1883
|
-
const idParts = DocumentHelper.parseId(issuerIdentity);
|
|
1884
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1885
|
-
return identityConnector.unrevokeVerifiableCredentials(controller, issuerIdentity, [
|
|
1886
|
-
credentialIndex
|
|
1887
|
-
]);
|
|
1888
|
-
}
|
|
1889
|
-
catch (error) {
|
|
1890
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verifiableCredentialUnrevokeFailed", { issuerIdentity, credentialIndex }, error);
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
/**
|
|
1894
|
-
* Create a verifiable presentation from the supplied verifiable credentials.
|
|
1895
|
-
* @param verificationMethodId The method to associate with the presentation.
|
|
1896
|
-
* @param presentationId The id of the presentation.
|
|
1897
|
-
* @param contexts The contexts for the data stored in the verifiable credential.
|
|
1898
|
-
* @param types The types for the data stored in the verifiable credential.
|
|
1899
|
-
* @param verifiableCredentials The credentials to use for creating the presentation in jwt format.
|
|
1900
|
-
* @param expiresInMinutes The time in minutes for the presentation to expire.
|
|
1901
|
-
* @param controller The controller of the identity who can make changes.
|
|
1902
|
-
* @returns The created verifiable presentation and its token.
|
|
1903
|
-
* @throws NotFoundError if the id can not be resolved.
|
|
1904
|
-
*/
|
|
1905
|
-
async verifiablePresentationCreate(verificationMethodId, presentationId, contexts, types, verifiableCredentials, expiresInMinutes, controller) {
|
|
1906
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1907
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "verificationMethodId", verificationMethodId);
|
|
1908
|
-
try {
|
|
1909
|
-
const idParts = DocumentHelper.parseId(verificationMethodId);
|
|
1910
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1911
|
-
return identityConnector.createVerifiablePresentation(controller, verificationMethodId, presentationId, contexts, types, verifiableCredentials, expiresInMinutes);
|
|
1912
|
-
}
|
|
1913
|
-
catch (error) {
|
|
1914
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verifiablePresentationCreateFailed", { verificationMethodId }, error);
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
/**
|
|
1918
|
-
* Verify a verifiable presentation is valid.
|
|
1919
|
-
* @param presentationJwt The presentation to verify.
|
|
1920
|
-
* @returns The presentation stored in the jwt and the revocation status.
|
|
1921
|
-
*/
|
|
1922
|
-
async verifiablePresentationVerify(presentationJwt) {
|
|
1923
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "presentationJwt", presentationJwt);
|
|
1924
|
-
const jwtDecoded = await Jwt.decode(presentationJwt);
|
|
1925
|
-
const jwtHeader = jwtDecoded.header;
|
|
1926
|
-
const jwtPayload = jwtDecoded.payload;
|
|
1927
|
-
const jwtSignature = jwtDecoded.signature;
|
|
1928
|
-
if (Is.undefined(jwtHeader) ||
|
|
1929
|
-
Is.undefined(jwtPayload) ||
|
|
1930
|
-
Is.undefined(jwtPayload.iss) ||
|
|
1931
|
-
Is.undefined(jwtSignature)) {
|
|
1932
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "jwtDecodeFailed");
|
|
1933
|
-
}
|
|
1934
|
-
try {
|
|
1935
|
-
const identityConnector = this.getConnectorByUri(jwtPayload.iss);
|
|
1936
|
-
const service = await identityConnector.checkVerifiablePresentation(presentationJwt);
|
|
1937
|
-
return service;
|
|
1938
|
-
}
|
|
1939
|
-
catch (error) {
|
|
1940
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "verifiablePresentationVerifyFailed", undefined, error);
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
/**
|
|
1944
|
-
* Create a proof for a document with the specified verification method.
|
|
1945
|
-
* @param verificationMethodId The verification method id to use.
|
|
1946
|
-
* @param proofType The type of proof to create.
|
|
1947
|
-
* @param unsecureDocument The unsecure document to create the proof for.
|
|
1948
|
-
* @param controller The controller of the identity who can make changes.
|
|
1949
|
-
* @returns The proof.
|
|
1950
|
-
*/
|
|
1951
|
-
async proofCreate(verificationMethodId, proofType, unsecureDocument, controller) {
|
|
1952
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "controller", controller);
|
|
1953
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "verificationMethodId", verificationMethodId);
|
|
1954
|
-
Guards.arrayOneOf(IdentityService.CLASS_NAME, "proofType", proofType, Object.values(ProofTypes));
|
|
1955
|
-
Guards.object(IdentityService.CLASS_NAME, "unsecureDocument", unsecureDocument);
|
|
1956
|
-
try {
|
|
1957
|
-
const idParts = DocumentHelper.parseId(verificationMethodId);
|
|
1958
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1959
|
-
return identityConnector.createProof(controller, verificationMethodId, proofType, unsecureDocument);
|
|
1960
|
-
}
|
|
1961
|
-
catch (error) {
|
|
1962
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "proofCreateFailed", { verificationMethodId }, error);
|
|
1963
|
-
}
|
|
1964
|
-
}
|
|
1965
|
-
/**
|
|
1966
|
-
* Verify proof for a document with the specified verification method.
|
|
1967
|
-
* @param document The document to verify.
|
|
1968
|
-
* @param proof The proof to verify.
|
|
1969
|
-
* @returns True if the proof is verified.
|
|
1970
|
-
*/
|
|
1971
|
-
async proofVerify(document, proof) {
|
|
1972
|
-
Guards.object(IdentityService.CLASS_NAME, "document", document);
|
|
1973
|
-
Guards.object(IdentityService.CLASS_NAME, "proof", proof);
|
|
1974
|
-
Guards.stringValue(IdentityService.CLASS_NAME, "proof.verificationMethod", proof.verificationMethod);
|
|
1975
|
-
try {
|
|
1976
|
-
const idParts = DocumentHelper.parseId(proof.verificationMethod);
|
|
1977
|
-
const identityConnector = this.getConnectorByUri(idParts.id);
|
|
1978
|
-
return identityConnector.verifyProof(document, proof);
|
|
1979
|
-
}
|
|
1980
|
-
catch (error) {
|
|
1981
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "proofVerifyFailed", undefined, error);
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
/**
|
|
1985
|
-
* Get the connector from the namespace.
|
|
1986
|
-
* @param namespace The namespace for the identity.
|
|
1987
|
-
* @returns The connector.
|
|
1988
|
-
* @internal
|
|
1989
|
-
*/
|
|
1990
|
-
getConnectorByNamespace(namespace) {
|
|
1991
|
-
const namespaceMethod = namespace ?? this._defaultNamespace;
|
|
1992
|
-
const connector = IdentityConnectorFactory.getIfExists(namespaceMethod);
|
|
1993
|
-
if (Is.empty(connector)) {
|
|
1994
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "connectorNotFound", {
|
|
1995
|
-
namespace: namespaceMethod
|
|
1996
|
-
});
|
|
1997
|
-
}
|
|
1998
|
-
return connector;
|
|
1999
|
-
}
|
|
2000
|
-
/**
|
|
2001
|
-
* Get the connector from the uri.
|
|
2002
|
-
* @param id The id of the identity in urn format.
|
|
2003
|
-
* @returns The connector.
|
|
2004
|
-
* @internal
|
|
2005
|
-
*/
|
|
2006
|
-
getConnectorByUri(id) {
|
|
2007
|
-
const idUri = Urn.fromValidString(id);
|
|
2008
|
-
if (idUri.namespaceIdentifier() !== "did") {
|
|
2009
|
-
throw new GeneralError(IdentityService.CLASS_NAME, "namespaceMismatch", {
|
|
2010
|
-
namespace: "did",
|
|
2011
|
-
id
|
|
2012
|
-
});
|
|
2013
|
-
}
|
|
2014
|
-
return this.getConnectorByNamespace(idUri.namespaceMethod());
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
|
|
2018
|
-
const restEntryPoints = [
|
|
2019
|
-
{
|
|
2020
|
-
name: "identityResolver",
|
|
2021
|
-
defaultBaseRoute: "identity",
|
|
2022
|
-
tags: tagsIdentityResolver,
|
|
2023
|
-
generateRoutes: generateRestRoutesIdentityResolver
|
|
2024
|
-
},
|
|
2025
|
-
{
|
|
2026
|
-
name: "identity",
|
|
2027
|
-
defaultBaseRoute: "identity",
|
|
2028
|
-
tags: tagsIdentity,
|
|
2029
|
-
generateRoutes: generateRestRoutesIdentity
|
|
2030
|
-
},
|
|
2031
|
-
{
|
|
2032
|
-
name: "identityProfile",
|
|
2033
|
-
defaultBaseRoute: "identity/profile",
|
|
2034
|
-
tags: tagsIdentityProfile,
|
|
2035
|
-
generateRoutes: generateRestRoutesIdentityProfile
|
|
2036
|
-
}
|
|
2037
|
-
];
|
|
2038
|
-
|
|
2039
|
-
export { IdentityProfileService, IdentityResolverService, IdentityService, generateRestRoutesIdentity, generateRestRoutesIdentityProfile, generateRestRoutesIdentityResolver, identitiesList, identityCreate, identityGet, identityGetPublic, identityProfileCreate, identityProfileRemove, identityProfileUpdate, identityProofCreate, identityProofVerify, identityRemove, identityResolve, identityServiceCreate, identityServiceRemove, identityVerifiableCredentialCreate, identityVerifiableCredentialRevoke, identityVerifiableCredentialUnrevoke, identityVerifiableCredentialVerify, identityVerifiablePresentationCreate, identityVerifiablePresentationVerify, identityVerificationMethodCreate, identityVerificationMethodRemove, restEntryPoints, tagsIdentity, tagsIdentityProfile, tagsIdentityResolver };
|