@learncard/network-plugin 2.13.5 → 2.13.7

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.
@@ -0,0 +1,89 @@
1
+ import { generateLearnCard, LearnCard } from '@learncard/core';
2
+ import { getDidKitPlugin, DIDKitPlugin, DidMethod } from '@learncard/didkit-plugin';
3
+ import { getDidKeyPlugin, DidKeyPlugin } from '@learncard/didkey-plugin';
4
+ import { getVCPlugin, VCPlugin } from '@learncard/vc-plugin';
5
+
6
+ import { getLearnCardNetworkPlugin, LearnCardNetworkPlugin } from '../';
7
+ import { SAMPLE_VCS } from './mocks/sample-vcs';
8
+
9
+ let learnCards: Record<
10
+ string,
11
+ {
12
+ learnCard: LearnCard<
13
+ [DIDKitPlugin, DidKeyPlugin<DidMethod>, VCPlugin, LearnCardNetworkPlugin]
14
+ >;
15
+ }
16
+ > = {};
17
+
18
+ const getLearnCard = async (seed = 'a'.repeat(64)) => {
19
+ if (!learnCards[seed]) {
20
+ const didkitCard = await (await generateLearnCard()).addPlugin(await getDidKitPlugin());
21
+ const didkeyCard = await didkitCard.addPlugin(
22
+ await getDidKeyPlugin(didkitCard, seed, 'key' as DidMethod)
23
+ );
24
+ const vcCard = await didkeyCard.addPlugin(getVCPlugin(didkeyCard));
25
+ const learnCard = await vcCard.addPlugin(
26
+ await getLearnCardNetworkPlugin(vcCard, 'https://network.learncard.com/trpc')
27
+ );
28
+
29
+ learnCards[seed] = { learnCard };
30
+ }
31
+
32
+ return {
33
+ ...learnCards[seed].learnCard,
34
+ };
35
+ };
36
+
37
+ // Skipping until LCN has the updated function and vc-templates can be updated with resolveable VCs.
38
+ describe.skip('LearnCard Network Plugin', () => {
39
+ describe('NetworkLearnCard', () => {
40
+ it('should work', async () => {
41
+ await expect(getLearnCard()).resolves.toBeDefined();
42
+ });
43
+ });
44
+
45
+ describe('VerifyBoost Plugin', () => {
46
+ // This test can't pass till we can sign an authentic boost with LearnCard Network.
47
+ it.skip('should verify an Authentic Boost as valid', async () => {
48
+ const networkLC = await getLearnCard();
49
+ expect(
50
+ (await networkLC.invoke.verifyCredential(SAMPLE_VCS.VALID_BOOST)).errors
51
+ ).toEqual([]);
52
+ expect(
53
+ (await networkLC.invoke.verifyCredential(SAMPLE_VCS.VALID_BOOST)).warnings
54
+ ).toEqual([]);
55
+ });
56
+
57
+ it('should warn that Boost was validated outside of registry', async () => {
58
+ const networkLC = await getLearnCard();
59
+ expect(
60
+ (await networkLC.invoke.verifyCredential(SAMPLE_VCS.VALID_BOOST_OUTSIDE_REGISTRY))
61
+ .warnings.length
62
+ ).toBeGreaterThan(0);
63
+ });
64
+
65
+ it('should fail validation if a Boost Certificate was tampered with', async () => {
66
+ const networkLC = await getLearnCard();
67
+ expect(
68
+ (await networkLC.invoke.verifyCredential(SAMPLE_VCS.TAMPERED_BOOST_CERTIFICATE))
69
+ .errors.length
70
+ ).toBeGreaterThan(0);
71
+ });
72
+
73
+ it('should fail validation if a Boost Credential was tampered with', async () => {
74
+ const networkLC = await getLearnCard();
75
+ expect(
76
+ (await networkLC.invoke.verifyCredential(SAMPLE_VCS.TAMPERED_BOOST_CREDENTIAL))
77
+ .errors.length
78
+ ).toBeGreaterThan(0);
79
+ });
80
+
81
+ it('should fail validation if a Boost Credential has a mismatched ID from its Boost Certificate', async () => {
82
+ const networkLC = await getLearnCard();
83
+ expect(
84
+ (await networkLC.invoke.verifyCredential(SAMPLE_VCS.MISMATCHED_BOOST_ID_CREDENTIAL))
85
+ .errors.length
86
+ ).toBeGreaterThan(0);
87
+ });
88
+ });
89
+ });
@@ -0,0 +1,579 @@
1
+ import { VC, CredentialRecord } from '@learncard/types';
2
+
3
+ export const SAMPLE_VCS: Record<string, VC> = {
4
+ VALID_BOOST: {
5
+ '@context': [
6
+ 'https://www.w3.org/2018/credentials/v1',
7
+ {
8
+ 'lcn': 'https://docs.learncard.com/definitions#',
9
+ 'id': '@id',
10
+ 'type': '@type',
11
+ 'cred': 'https://www.w3.org/2018/credentials#',
12
+ 'CertifiedBoostCredential': {
13
+ '@context': {
14
+ '@version': 1.1,
15
+ 'boostCredential': {
16
+ '@container': '@graph',
17
+ '@id': 'cred:VerifiableCredential',
18
+ '@type': '@id',
19
+ },
20
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
21
+ },
22
+ '@id': 'lcn:certifiedBoostCredential',
23
+ },
24
+ },
25
+ ],
26
+ 'id': 'urn:uuid:8f6579d1-e217-4ad7-bb65-1d2dad2fc9b4',
27
+ 'type': ['VerifiableCredential', 'CertifiedBoostCredential'],
28
+ 'issuer': 'did:web:localhost%3A3000',
29
+ 'issuanceDate': '2023-03-03T17:35:21.531Z',
30
+ 'credentialSubject': { 'id': 'did:web:localhost%3A3000' },
31
+ 'proof': {
32
+ 'type': 'Ed25519Signature2020',
33
+ 'created': '2023-03-03T17:35:21.654Z',
34
+ 'proofPurpose': 'assertionMethod',
35
+ 'verificationMethod': 'did:web:localhost%3A3000#owner',
36
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
37
+ 'proofValue':
38
+ 'z53MJtv7bdGWVkcNkUZyy8xzDQWQkSUx8nY9B7ETdAgLejJGARYQdParKCsV6tNig3k13qP4nFJDfTLWMp94hsN2q',
39
+ },
40
+ 'boostCredential': {
41
+ '@context': [
42
+ 'https://www.w3.org/2018/credentials/v1',
43
+ 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',
44
+ {
45
+ 'BoostCredential': {
46
+ '@context': {
47
+ 'attachments': {
48
+ '@container': '@set',
49
+ '@context': {
50
+ 'title': {
51
+ '@id': 'lcn:boostAttachmentTitle',
52
+ '@type': 'xsd:string',
53
+ },
54
+ 'type': {
55
+ '@id': 'lcn:boostAttachmentType',
56
+ '@type': 'xsd:string',
57
+ },
58
+ 'url': {
59
+ '@id': 'lcn:boostAttachmentUrl',
60
+ '@type': 'xsd:string',
61
+ },
62
+ },
63
+ '@id': 'lcn:boostAttachments',
64
+ },
65
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
66
+ 'display': {
67
+ '@context': {
68
+ 'backgroundColor': {
69
+ '@id': 'lcn:boostBackgroundColor',
70
+ '@type': 'xsd:string',
71
+ },
72
+ 'backgroundImage': {
73
+ '@id': 'lcn:boostBackgroundImage',
74
+ '@type': 'xsd:string',
75
+ },
76
+ },
77
+ '@id': 'lcn:boostDisplay',
78
+ },
79
+ 'image': { '@id': 'lcn:boostImage', '@type': 'xsd:string' },
80
+ },
81
+ '@id': 'lcn:boostCredential',
82
+ },
83
+ 'lcn': 'https://docs.learncard.com/definitions#',
84
+ 'type': '@type',
85
+ 'xsd': 'https://www.w3.org/2001/XMLSchema#',
86
+ },
87
+ ],
88
+ 'boostId':
89
+ 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
90
+ 'credentialSubject': {
91
+ 'achievement': {
92
+ 'achievementType': 'Influencer',
93
+ 'criteria': { 'narrative': 'Earned by being Goody.' },
94
+ 'description': 'Goody People Earn Goody Badge',
95
+ 'id': 'urn:uuid:123',
96
+ 'image': '',
97
+ 'name': 'Goodynwaa',
98
+ 'type': ['Achievement'],
99
+ },
100
+ 'id': 'did:web:localhost%3A3000:users:bbb',
101
+ 'type': ['AchievementSubject'],
102
+ },
103
+ 'issuanceDate': '2020-08-19T21:41:50Z',
104
+ 'issuer': 'did:web:localhost%3A3000:users:test',
105
+ 'name': 'Goody Boost',
106
+ 'proof': {
107
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
108
+ 'created': '2023-03-03T17:35:19.948Z',
109
+ 'proofPurpose': 'assertionMethod',
110
+ 'proofValue':
111
+ 'z53NHZJJWogLSDRT8Pqmkd2zkTz7bMhA1FbULc6GWshTDiJgQyu9tQ3VtHMdB7vyHnyaUtczKZWFo57fS5tWfuo6L',
112
+ 'type': 'Ed25519Signature2020',
113
+ 'verificationMethod': 'did:web:localhost%3A3000:users:test#owner',
114
+ },
115
+ 'type': ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
116
+ },
117
+ 'boostId': 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
118
+ },
119
+ VALID_BOOST_OUTSIDE_REGISTRY: {
120
+ '@context': [
121
+ 'https://www.w3.org/2018/credentials/v1',
122
+ {
123
+ 'lcn': 'https://docs.learncard.com/definitions#',
124
+ 'id': '@id',
125
+ 'type': '@type',
126
+ 'cred': 'https://www.w3.org/2018/credentials#',
127
+ 'CertifiedBoostCredential': {
128
+ '@context': {
129
+ '@version': 1.1,
130
+ 'boostCredential': {
131
+ '@container': '@graph',
132
+ '@id': 'cred:VerifiableCredential',
133
+ '@type': '@id',
134
+ },
135
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
136
+ },
137
+ '@id': 'lcn:certifiedBoostCredential',
138
+ },
139
+ },
140
+ ],
141
+ 'id': 'urn:uuid:8f6579d1-e217-4ad7-bb65-1d2dad2fc9b4',
142
+ 'type': ['VerifiableCredential', 'CertifiedBoostCredential'],
143
+ 'issuer': 'did:web:localhost%3A3000',
144
+ 'issuanceDate': '2023-03-03T17:35:21.531Z',
145
+ 'credentialSubject': { 'id': 'did:web:localhost%3A3000' },
146
+ 'proof': {
147
+ 'type': 'Ed25519Signature2020',
148
+ 'created': '2023-03-03T17:35:21.654Z',
149
+ 'proofPurpose': 'assertionMethod',
150
+ 'verificationMethod': 'did:web:localhost%3A3000#owner',
151
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
152
+ 'proofValue':
153
+ 'z53MJtv7bdGWVkcNkUZyy8xzDQWQkSUx8nY9B7ETdAgLejJGARYQdParKCsV6tNig3k13qP4nFJDfTLWMp94hsN2q',
154
+ },
155
+ 'boostCredential': {
156
+ '@context': [
157
+ 'https://www.w3.org/2018/credentials/v1',
158
+ 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',
159
+ {
160
+ 'BoostCredential': {
161
+ '@context': {
162
+ 'attachments': {
163
+ '@container': '@set',
164
+ '@context': {
165
+ 'title': {
166
+ '@id': 'lcn:boostAttachmentTitle',
167
+ '@type': 'xsd:string',
168
+ },
169
+ 'type': {
170
+ '@id': 'lcn:boostAttachmentType',
171
+ '@type': 'xsd:string',
172
+ },
173
+ 'url': {
174
+ '@id': 'lcn:boostAttachmentUrl',
175
+ '@type': 'xsd:string',
176
+ },
177
+ },
178
+ '@id': 'lcn:boostAttachments',
179
+ },
180
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
181
+ 'display': {
182
+ '@context': {
183
+ 'backgroundColor': {
184
+ '@id': 'lcn:boostBackgroundColor',
185
+ '@type': 'xsd:string',
186
+ },
187
+ 'backgroundImage': {
188
+ '@id': 'lcn:boostBackgroundImage',
189
+ '@type': 'xsd:string',
190
+ },
191
+ },
192
+ '@id': 'lcn:boostDisplay',
193
+ },
194
+ 'image': { '@id': 'lcn:boostImage', '@type': 'xsd:string' },
195
+ },
196
+ '@id': 'lcn:boostCredential',
197
+ },
198
+ 'lcn': 'https://docs.learncard.com/definitions#',
199
+ 'type': '@type',
200
+ 'xsd': 'https://www.w3.org/2001/XMLSchema#',
201
+ },
202
+ ],
203
+ 'boostId':
204
+ 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
205
+ 'credentialSubject': {
206
+ 'achievement': {
207
+ 'achievementType': 'Influencer',
208
+ 'criteria': { 'narrative': 'Earned by being Goody.' },
209
+ 'description': 'Goody People Earn Goody Badge',
210
+ 'id': 'urn:uuid:123',
211
+ 'image': '',
212
+ 'name': 'Goodynwaa',
213
+ 'type': ['Achievement'],
214
+ },
215
+ 'id': 'did:web:localhost%3A3000:users:bbb',
216
+ 'type': ['AchievementSubject'],
217
+ },
218
+ 'issuanceDate': '2020-08-19T21:41:50Z',
219
+ 'issuer': 'did:web:localhost%3A3000:users:test',
220
+ 'name': 'Goody Boost',
221
+ 'proof': {
222
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
223
+ 'created': '2023-03-03T17:35:19.948Z',
224
+ 'proofPurpose': 'assertionMethod',
225
+ 'proofValue':
226
+ 'z53NHZJJWogLSDRT8Pqmkd2zkTz7bMhA1FbULc6GWshTDiJgQyu9tQ3VtHMdB7vyHnyaUtczKZWFo57fS5tWfuo6L',
227
+ 'type': 'Ed25519Signature2020',
228
+ 'verificationMethod': 'did:web:localhost%3A3000:users:test#owner',
229
+ },
230
+ 'type': ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
231
+ },
232
+ 'boostId': 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
233
+ },
234
+ TAMPERED_BOOST_CERTIFICATE: {
235
+ '@context': [
236
+ 'https://www.w3.org/2018/credentials/v1',
237
+ {
238
+ 'lcn': 'https://docs.learncard.com/definitions#',
239
+ 'id': '@id',
240
+ 'type': '@type',
241
+ 'cred': 'https://www.w3.org/2018/credentials#',
242
+ 'CertifiedBoostCredential': {
243
+ '@context': {
244
+ '@version': 1.1,
245
+ 'boostCredential': {
246
+ '@container': '@graph',
247
+ '@id': 'cred:VerifiableCredential',
248
+ '@type': '@id',
249
+ },
250
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
251
+ },
252
+ '@id': 'lcn:certifiedBoostCredential',
253
+ },
254
+ },
255
+ ],
256
+ 'id': 'urn:uuid:8f6579d1-e217-4ad7-bb65-1d2dad2fc9b4',
257
+ 'type': ['VerifiableCredential', 'CertifiedBoostCredential'],
258
+ 'issuer': 'did:web:localhost%3A3000',
259
+ 'issuanceDate': '2023-03-03T17:35:21.531Z',
260
+ 'credentialSubject': { 'id': 'did:web:localhost%3A3000' },
261
+ 'proof': {
262
+ 'type': 'Ed25519Signature2020',
263
+ 'created': '2023-03-03T17:35:21.654Z',
264
+ 'proofPurpose': 'assertionMethod',
265
+ 'verificationMethod': 'did:web:localhost%3A3000#owner',
266
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
267
+ 'proofValue':
268
+ 'z53MJtv7bdGWVkcNkUZyy8xzDQWQkSUx8nY9B7ETdAgLejJGARYQdParKCsV6tNig3k13qP4nFJDfTLWMp94hsN2q',
269
+ },
270
+ 'boostCredential': {
271
+ '@context': [
272
+ 'https://www.w3.org/2018/credentials/v1',
273
+ 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',
274
+ {
275
+ 'BoostCredential': {
276
+ '@context': {
277
+ 'attachments': {
278
+ '@container': '@set',
279
+ '@context': {
280
+ 'title': {
281
+ '@id': 'lcn:boostAttachmentTitle',
282
+ '@type': 'xsd:string',
283
+ },
284
+ 'type': {
285
+ '@id': 'lcn:boostAttachmentType',
286
+ '@type': 'xsd:string',
287
+ },
288
+ 'url': {
289
+ '@id': 'lcn:boostAttachmentUrl',
290
+ '@type': 'xsd:string',
291
+ },
292
+ },
293
+ '@id': 'lcn:boostAttachments',
294
+ },
295
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
296
+ 'display': {
297
+ '@context': {
298
+ 'backgroundColor': {
299
+ '@id': 'lcn:boostBackgroundColor',
300
+ '@type': 'xsd:string',
301
+ },
302
+ 'backgroundImage': {
303
+ '@id': 'lcn:boostBackgroundImage',
304
+ '@type': 'xsd:string',
305
+ },
306
+ },
307
+ '@id': 'lcn:boostDisplay',
308
+ },
309
+ 'image': { '@id': 'lcn:boostImage', '@type': 'xsd:string' },
310
+ },
311
+ '@id': 'lcn:boostCredential',
312
+ },
313
+ 'lcn': 'https://docs.learncard.com/definitions#',
314
+ 'type': '@type',
315
+ 'xsd': 'https://www.w3.org/2001/XMLSchema#',
316
+ },
317
+ ],
318
+ 'boostId': 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-TAMPER',
319
+ 'credentialSubject': {
320
+ 'achievement': {
321
+ 'achievementType': 'Influencer',
322
+ 'criteria': { 'narrative': 'Earned by being Goody.' },
323
+ 'description': 'Goody People Earn Goody Badge',
324
+ 'id': 'urn:uuid:123',
325
+ 'image': '',
326
+ 'name': 'Goodynwaa',
327
+ 'type': ['Achievement'],
328
+ },
329
+ 'id': 'did:web:localhost%3A3000:users:bbb',
330
+ 'type': ['AchievementSubject'],
331
+ },
332
+ 'issuanceDate': '2020-08-19T21:41:50Z',
333
+ 'issuer': 'did:web:localhost%3A3000:users:test',
334
+ 'name': 'Goody Boost',
335
+ 'proof': {
336
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
337
+ 'created': '2023-03-03T17:35:19.948Z',
338
+ 'proofPurpose': 'assertionMethod',
339
+ 'proofValue':
340
+ 'z53NHZJJWogLSDRT8Pqmkd2zkTz7bMhA1FbULc6GWshTDiJgQyu9tQ3VtHMdB7vyHnyaUtczKZWFo57fS5tWfuo6L',
341
+ 'type': 'Ed25519Signature2020',
342
+ 'verificationMethod': 'did:web:localhost%3A3000:users:test#owner',
343
+ },
344
+ 'type': ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
345
+ },
346
+ 'boostId': 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
347
+ },
348
+ TAMPERED_BOOST_CREDENTIAL: {
349
+ '@context': [
350
+ 'https://www.w3.org/2018/credentials/v1',
351
+ {
352
+ 'lcn': 'https://docs.learncard.com/definitions#',
353
+ 'id': '@id',
354
+ 'type': '@type',
355
+ 'cred': 'https://www.w3.org/2018/credentials#',
356
+ 'CertifiedBoostCredential': {
357
+ '@context': {
358
+ '@version': 1.1,
359
+ 'boostCredential': {
360
+ '@container': '@graph',
361
+ '@id': 'cred:VerifiableCredential',
362
+ '@type': '@id',
363
+ },
364
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
365
+ },
366
+ '@id': 'lcn:certifiedBoostCredential',
367
+ },
368
+ },
369
+ ],
370
+ 'id': 'urn:uuid:8f6579d1-e217-4ad7-bb65-1d2dad2fc9b4',
371
+ 'type': ['VerifiableCredential', 'CertifiedBoostCredential'],
372
+ 'issuer': 'did:web:localhost%3A3000',
373
+ 'issuanceDate': '2023-03-03T17:35:21.531Z',
374
+ 'credentialSubject': { 'id': 'did:web:localhost%3A3000' },
375
+ 'proof': {
376
+ 'type': 'Ed25519Signature2020',
377
+ 'created': '2023-03-03T17:35:21.654Z',
378
+ 'proofPurpose': 'assertionMethod',
379
+ 'verificationMethod': 'did:web:localhost%3A3000#owner',
380
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
381
+ 'proofValue':
382
+ 'z53MJtv7bdGWVkcNkUZyy8xzDQWQkSUx8nY9B7ETdAgLejJGARYQdParKCsV6tNig3k13qP4nFJDfTLWMp94hsN2q',
383
+ },
384
+ 'boostCredential': {
385
+ '@context': [
386
+ 'https://www.w3.org/2018/credentials/v1',
387
+ 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',
388
+ {
389
+ 'BoostCredential': {
390
+ '@context': {
391
+ 'attachments': {
392
+ '@container': '@set',
393
+ '@context': {
394
+ 'title': {
395
+ '@id': 'lcn:boostAttachmentTitle',
396
+ '@type': 'xsd:string',
397
+ },
398
+ 'type': {
399
+ '@id': 'lcn:boostAttachmentType',
400
+ '@type': 'xsd:string',
401
+ },
402
+ 'url': {
403
+ '@id': 'lcn:boostAttachmentUrl',
404
+ '@type': 'xsd:string',
405
+ },
406
+ },
407
+ '@id': 'lcn:boostAttachments',
408
+ },
409
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
410
+ 'display': {
411
+ '@context': {
412
+ 'backgroundColor': {
413
+ '@id': 'lcn:boostBackgroundColor',
414
+ '@type': 'xsd:string',
415
+ },
416
+ 'backgroundImage': {
417
+ '@id': 'lcn:boostBackgroundImage',
418
+ '@type': 'xsd:string',
419
+ },
420
+ },
421
+ '@id': 'lcn:boostDisplay',
422
+ },
423
+ 'image': { '@id': 'lcn:boostImage', '@type': 'xsd:string' },
424
+ },
425
+ '@id': 'lcn:boostCredential',
426
+ },
427
+ 'lcn': 'https://docs.learncard.com/definitions#',
428
+ 'type': '@type',
429
+ 'xsd': 'https://www.w3.org/2001/XMLSchema#',
430
+ },
431
+ ],
432
+ 'boostId':
433
+ 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
434
+ 'credentialSubject': {
435
+ 'achievement': {
436
+ 'achievementType': 'Influencer',
437
+ 'criteria': { 'narrative': 'Earned by being Goody.' },
438
+ 'description': 'Goody People Earn Goody Badge',
439
+ 'id': 'urn:uuid:123',
440
+ 'image': '',
441
+ 'name': 'Goodynwaa',
442
+ 'type': ['Achievement'],
443
+ },
444
+ 'id': 'did:web:localhost%3A3000:users:bbb',
445
+ 'type': ['AchievementSubject'],
446
+ },
447
+ 'issuanceDate': '2020-08-19T21:41:50Z',
448
+ 'issuer': 'did:web:localhost%3A3000:users:test',
449
+ 'name': 'Goody Boost',
450
+ 'proof': {
451
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
452
+ 'created': '2023-03-03T17:35:19.948Z',
453
+ 'proofPurpose': 'assertionMethod',
454
+ 'proofValue':
455
+ 'z53NHZJJWogLSDRT8Pqmkd2zkTz7bMhA1FbULc6GWshTDiJgQyu9tQ3VtHMdB7vyHnyaUtczKZWFo57fS5tWfuo6L',
456
+ 'type': 'Ed25519Signature2020',
457
+ 'verificationMethod': 'did:web:localhost%3A3000:users:test#owner',
458
+ },
459
+ 'type': ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
460
+ },
461
+ 'boostId': 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-TAMPER',
462
+ },
463
+ MISMATCHED_BOOST_ID_CREDENTIAL: {
464
+ '@context': [
465
+ 'https://www.w3.org/2018/credentials/v1',
466
+ {
467
+ 'lcn': 'https://docs.learncard.com/definitions#',
468
+ 'id': '@id',
469
+ 'type': '@type',
470
+ 'cred': 'https://www.w3.org/2018/credentials#',
471
+ 'CertifiedBoostCredential': {
472
+ '@context': {
473
+ '@version': 1.1,
474
+ 'boostCredential': {
475
+ '@container': '@graph',
476
+ '@id': 'cred:VerifiableCredential',
477
+ '@type': '@id',
478
+ },
479
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
480
+ },
481
+ '@id': 'lcn:certifiedBoostCredential',
482
+ },
483
+ },
484
+ ],
485
+ 'id': 'urn:uuid:86d8c5c0-ce4b-4e42-a4e6-3624d65b1631',
486
+ 'type': ['VerifiableCredential', 'CertifiedBoostCredential'],
487
+ 'issuer': 'did:web:localhost%3A3000',
488
+ 'issuanceDate': '2023-03-03T20:44:50.799Z',
489
+ 'credentialSubject': { 'id': 'did:web:localhost%3A3000' },
490
+ 'proof': {
491
+ 'type': 'Ed25519Signature2020',
492
+ 'created': '2023-03-03T20:44:50.917Z',
493
+ 'proofPurpose': 'assertionMethod',
494
+ 'verificationMethod': 'did:web:localhost%3A3000#owner',
495
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
496
+ 'proofValue':
497
+ 'z4eYynEgQwZJDMTmtKrDVLStQyQ6FaqeNKpDmUH8APZVRExqUPLqgYjeabyqNnXbi9MUeNW77hLGU12gHuoXKurRq',
498
+ },
499
+ 'boostCredential': {
500
+ '@context': [
501
+ 'https://www.w3.org/2018/credentials/v1',
502
+ 'https://purl.imsglobal.org/spec/ob/v3p0/context.json',
503
+ {
504
+ 'BoostCredential': {
505
+ '@context': {
506
+ 'attachments': {
507
+ '@container': '@set',
508
+ '@context': {
509
+ 'title': {
510
+ '@id': 'lcn:boostAttachmentTitle',
511
+ '@type': 'xsd:string',
512
+ },
513
+ 'type': {
514
+ '@id': 'lcn:boostAttachmentType',
515
+ '@type': 'xsd:string',
516
+ },
517
+ 'url': {
518
+ '@id': 'lcn:boostAttachmentUrl',
519
+ '@type': 'xsd:string',
520
+ },
521
+ },
522
+ '@id': 'lcn:boostAttachments',
523
+ },
524
+ 'boostId': { '@id': 'lcn:boostId', '@type': 'xsd:string' },
525
+ 'display': {
526
+ '@context': {
527
+ 'backgroundColor': {
528
+ '@id': 'lcn:boostBackgroundColor',
529
+ '@type': 'xsd:string',
530
+ },
531
+ 'backgroundImage': {
532
+ '@id': 'lcn:boostBackgroundImage',
533
+ '@type': 'xsd:string',
534
+ },
535
+ },
536
+ '@id': 'lcn:boostDisplay',
537
+ },
538
+ 'image': { '@id': 'lcn:boostImage', '@type': 'xsd:string' },
539
+ },
540
+ '@id': 'lcn:boostCredential',
541
+ },
542
+ 'lcn': 'https://docs.learncard.com/definitions#',
543
+ 'type': '@type',
544
+ 'xsd': 'https://www.w3.org/2001/XMLSchema#',
545
+ },
546
+ ],
547
+ 'boostId':
548
+ 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26',
549
+ 'credentialSubject': {
550
+ 'achievement': {
551
+ 'achievementType': 'Influencer',
552
+ 'criteria': { 'narrative': 'Earned by being Goody.' },
553
+ 'description': 'Goody People Earn Goody Badge',
554
+ 'id': 'urn:uuid:123',
555
+ 'image': '',
556
+ 'name': 'Goodynwaa',
557
+ 'type': ['Achievement'],
558
+ },
559
+ 'id': 'did:web:localhost%3A3000:users:bbb',
560
+ 'type': ['AchievementSubject'],
561
+ },
562
+ 'issuanceDate': '2020-08-19T21:41:50Z',
563
+ 'issuer': 'did:web:localhost%3A3000:users:test',
564
+ 'name': 'Goody Boost',
565
+ 'proof': {
566
+ '@context': ['https://w3id.org/security/suites/ed25519-2020/v1'],
567
+ 'created': '2023-03-03T20:44:49.001Z',
568
+ 'proofPurpose': 'assertionMethod',
569
+ 'proofValue':
570
+ 'z2Uz1KyAwep5h5L3GSubrXSZZ5BpUpnVqwLB4uFHHQENTNZEjZVCqXgwwJkyWMPeRHSX3TWSUHwW1oYaNTq5tsCzQ',
571
+ 'type': 'Ed25519Signature2020',
572
+ 'verificationMethod': 'did:web:localhost%3A3000:users:test#owner',
573
+ },
574
+ 'type': ['VerifiableCredential', 'OpenBadgeCredential', 'BoostCredential'],
575
+ },
576
+ 'boostId':
577
+ 'lc:network:localhost%3A3000/trpc:boost:8adff1c1-696d-49b3-bffc-8eea89f72e26MISMATCH',
578
+ },
579
+ };