@learncard/credential-library 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -98
- package/package.json +49 -39
- package/src/__tests__/issuance.test.ts +51 -0
- package/src/__tests__/registry.test.ts +457 -0
- package/src/fixtures/boost/basic.ts +50 -0
- package/src/fixtures/boost/boost-id.ts +59 -0
- package/src/fixtures/boost/community-award.ts +96 -0
- package/src/fixtures/boost/delegate.ts +60 -0
- package/src/fixtures/boost/with-skills.ts +80 -0
- package/src/fixtures/clr/competency-aligned.ts +737 -0
- package/src/fixtures/clr/great-plains-full.ts +7841 -0
- package/src/fixtures/clr/minimal.ts +53 -0
- package/src/fixtures/clr/multi-achievement.ts +125 -0
- package/src/fixtures/clr/nd-student-transcript.ts +411 -0
- package/src/fixtures/clr/university-transcript.ts +328 -0
- package/src/fixtures/clr/westbridge-full.ts +2524 -0
- package/src/fixtures/index.ts +159 -0
- package/src/fixtures/invalid/empty-type.ts +27 -0
- package/src/fixtures/invalid/missing-context.ts +27 -0
- package/src/fixtures/invalid/missing-issuer.ts +27 -0
- package/src/fixtures/obv3/1edtech-full.ts +237 -0
- package/src/fixtures/obv3/course-completion.ts +82 -0
- package/src/fixtures/obv3/endorsement.ts +58 -0
- package/src/fixtures/obv3/full-badge.ts +121 -0
- package/src/fixtures/obv3/k12-diploma.ts +92 -0
- package/src/fixtures/obv3/micro-credential.ts +170 -0
- package/src/fixtures/obv3/minimal-badge.ts +40 -0
- package/src/fixtures/obv3/plugfest-jff2.ts +57 -0
- package/src/fixtures/obv3/professional-cert.ts +102 -0
- package/src/fixtures/obv3/with-alignment.ts +62 -0
- package/src/fixtures/obv3/with-endorsement.ts +62 -0
- package/src/fixtures/render-method/render-method-example.ts +45 -0
- package/src/fixtures/vc-v1/alumni-credential.ts +37 -0
- package/src/fixtures/vc-v1/basic.ts +27 -0
- package/src/fixtures/vc-v1/with-status.ts +44 -0
- package/src/fixtures/vc-v2/basic.ts +27 -0
- package/src/fixtures/vc-v2/digital-id.ts +78 -0
- package/src/fixtures/vc-v2/education-degree.ts +77 -0
- package/src/fixtures/vc-v2/employment-credential.ts +64 -0
- package/src/fixtures/vc-v2/license-credential.ts +79 -0
- package/src/fixtures/vc-v2/membership-credential.ts +62 -0
- package/src/fixtures/vc-v2/multiple-subjects.ts +39 -0
- package/src/fixtures/vc-v2/with-evidence.ts +50 -0
- package/src/index.ts +45 -0
- package/src/prepare.ts +212 -0
- package/src/registry.ts +209 -0
- package/src/types.ts +164 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { UnsignedAchievementCredentialValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const obv3WithEndorsement: CredentialFixture = {
|
|
6
|
+
id: 'obv3/with-endorsement',
|
|
7
|
+
name: 'OBv3 Badge with Endorsement',
|
|
8
|
+
description:
|
|
9
|
+
'Open Badges v3 credential containing an embedded endorsement credential from a third party',
|
|
10
|
+
spec: 'obv3',
|
|
11
|
+
profile: 'badge',
|
|
12
|
+
features: ['endorsement'],
|
|
13
|
+
source: 'synthetic',
|
|
14
|
+
signed: false,
|
|
15
|
+
validity: 'valid',
|
|
16
|
+
validator: UnsignedAchievementCredentialValidator,
|
|
17
|
+
|
|
18
|
+
credential: {
|
|
19
|
+
'@context': [
|
|
20
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
21
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
22
|
+
],
|
|
23
|
+
id: 'urn:uuid:c3d4e5f6-0003-4000-8000-000000000001',
|
|
24
|
+
type: ['VerifiableCredential', 'OpenBadgeCredential'],
|
|
25
|
+
name: 'Endorsed Teamwork Badge',
|
|
26
|
+
issuer: { id: 'did:example:issuer123', type: ['Profile'], name: 'Acme Corp' },
|
|
27
|
+
validFrom: '2024-05-01T00:00:00Z',
|
|
28
|
+
credentialSubject: {
|
|
29
|
+
id: 'did:example:employee42',
|
|
30
|
+
type: ['AchievementSubject'],
|
|
31
|
+
achievement: {
|
|
32
|
+
id: 'urn:uuid:c3d4e5f6-0003-4000-8000-000000000002',
|
|
33
|
+
type: ['Achievement'],
|
|
34
|
+
name: 'Teamwork Excellence',
|
|
35
|
+
description: 'Recognizes outstanding collaborative skills in cross-functional teams.',
|
|
36
|
+
criteria: { narrative: 'Nominated by peers and approved by management.' },
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
endorsement: [
|
|
40
|
+
{
|
|
41
|
+
'@context': [
|
|
42
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
43
|
+
'https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json',
|
|
44
|
+
],
|
|
45
|
+
id: 'urn:uuid:c3d4e5f6-0003-4000-8000-000000000003',
|
|
46
|
+
type: ['VerifiableCredential', 'EndorsementCredential'],
|
|
47
|
+
issuer: {
|
|
48
|
+
id: 'did:example:endorser999',
|
|
49
|
+
type: ['Profile'],
|
|
50
|
+
name: 'Industry Standards Board',
|
|
51
|
+
},
|
|
52
|
+
validFrom: '2024-04-01T00:00:00Z',
|
|
53
|
+
credentialSubject: {
|
|
54
|
+
id: 'urn:uuid:c3d4e5f6-0003-4000-8000-000000000002',
|
|
55
|
+
type: ['EndorsementSubject'],
|
|
56
|
+
endorsementComment:
|
|
57
|
+
'This badge program meets industry standards for collaborative skill assessment.',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { UnsignedVCValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const vcV2RenderMethodExample: CredentialFixture = {
|
|
6
|
+
id: 'vc-v2/render-method-example',
|
|
7
|
+
name: 'VC v2 Render Method Example',
|
|
8
|
+
description: 'Minimal VC v2 example that demonstrates top-level renderMethod support.',
|
|
9
|
+
spec: 'vc-v2',
|
|
10
|
+
profile: 'generic',
|
|
11
|
+
features: [],
|
|
12
|
+
source: 'spec-example',
|
|
13
|
+
signed: false,
|
|
14
|
+
validity: 'valid',
|
|
15
|
+
tags: ['render-method', 'svg-mustache', 'template'],
|
|
16
|
+
validator: UnsignedVCValidator,
|
|
17
|
+
|
|
18
|
+
credential: {
|
|
19
|
+
'@context': [
|
|
20
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
21
|
+
'https://digitalbazaar.github.io/vc-render-method-context/contexts/v2rc2.jsonld',
|
|
22
|
+
],
|
|
23
|
+
id: 'urn:uuid:99fc4030-3d05-4619-9e0e-46d0f711ccc9',
|
|
24
|
+
type: ['VerifiableCredential'],
|
|
25
|
+
issuer: {
|
|
26
|
+
id: 'did:example:issuer123',
|
|
27
|
+
name: 'Example Issuer',
|
|
28
|
+
},
|
|
29
|
+
name: 'Render Method Example',
|
|
30
|
+
description: 'A minimal VC v2 example for SVG Mustache rendering.',
|
|
31
|
+
validFrom: '2024-07-01T00:00:00Z',
|
|
32
|
+
credentialSubject: {
|
|
33
|
+
id: 'did:example:subject456',
|
|
34
|
+
name: 'Example Subject',
|
|
35
|
+
},
|
|
36
|
+
renderMethod: {
|
|
37
|
+
type: 'TemplateRenderMethod',
|
|
38
|
+
renderSuite: 'svg-mustache',
|
|
39
|
+
template: 'https://templates.learncard.com/svg/card/card-1.0.0.svg',
|
|
40
|
+
outputPreference: {
|
|
41
|
+
mediaType: 'image/svg+xml',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const vcV1AlumniCredential: CredentialFixture = {
|
|
4
|
+
id: 'vc-v1/alumni-credential',
|
|
5
|
+
name: 'University Alumni Credential',
|
|
6
|
+
description:
|
|
7
|
+
'A W3C VC v1.1 alumni credential from the W3C VC specification examples, representing a common real-world use case for university alumni verification.',
|
|
8
|
+
spec: 'vc-v1',
|
|
9
|
+
profile: 'membership',
|
|
10
|
+
features: ['expiration'],
|
|
11
|
+
source: 'spec-example',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['alumni', 'university', 'education', 'w3c-example'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/2018/credentials/v1',
|
|
19
|
+
'https://www.w3.org/2018/credentials/examples/v1',
|
|
20
|
+
],
|
|
21
|
+
id: 'https://example.edu/credentials/1872',
|
|
22
|
+
type: ['VerifiableCredential', 'AlumniCredential'],
|
|
23
|
+
issuer: {
|
|
24
|
+
id: 'https://example.edu/issuers/565049',
|
|
25
|
+
name: 'Example University',
|
|
26
|
+
},
|
|
27
|
+
issuanceDate: '2010-01-01T19:23:24Z',
|
|
28
|
+
expirationDate: '2030-01-01T19:23:24Z',
|
|
29
|
+
credentialSubject: {
|
|
30
|
+
id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
|
|
31
|
+
alumniOf: {
|
|
32
|
+
id: 'did:example:c276e12ec21ebfeb1f712ebc6f1',
|
|
33
|
+
name: 'Example University',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UnsignedVCValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const vcV1Basic: CredentialFixture = {
|
|
6
|
+
id: 'vc-v1/basic',
|
|
7
|
+
name: 'Basic VC v1 Credential',
|
|
8
|
+
description: 'Minimal W3C Verifiable Credential Data Model v1 credential with only required fields',
|
|
9
|
+
spec: 'vc-v1',
|
|
10
|
+
profile: 'generic',
|
|
11
|
+
features: [],
|
|
12
|
+
source: 'spec-example',
|
|
13
|
+
signed: false,
|
|
14
|
+
validity: 'valid',
|
|
15
|
+
validator: UnsignedVCValidator,
|
|
16
|
+
|
|
17
|
+
credential: {
|
|
18
|
+
'@context': ['https://www.w3.org/2018/credentials/v1'],
|
|
19
|
+
id: 'http://example.org/credentials/3731',
|
|
20
|
+
type: ['VerifiableCredential'],
|
|
21
|
+
issuer: 'did:example:issuer123',
|
|
22
|
+
issuanceDate: '2020-08-19T21:41:50Z',
|
|
23
|
+
credentialSubject: {
|
|
24
|
+
id: 'did:example:subject456',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UnsignedVCValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const vcV1WithStatus: CredentialFixture = {
|
|
6
|
+
id: 'vc-v1/with-status',
|
|
7
|
+
name: 'VC v1 with Credential Status',
|
|
8
|
+
description:
|
|
9
|
+
'W3C VCDM v1 credential with credentialStatus for revocation checking (StatusList2021)',
|
|
10
|
+
spec: 'vc-v1',
|
|
11
|
+
profile: 'generic',
|
|
12
|
+
features: ['status'],
|
|
13
|
+
source: 'synthetic',
|
|
14
|
+
signed: false,
|
|
15
|
+
validity: 'valid',
|
|
16
|
+
validator: UnsignedVCValidator,
|
|
17
|
+
|
|
18
|
+
credential: {
|
|
19
|
+
'@context': [
|
|
20
|
+
'https://www.w3.org/2018/credentials/v1',
|
|
21
|
+
'https://www.w3.org/2018/credentials/examples/v1',
|
|
22
|
+
'https://w3id.org/vc/status-list/2021/v1',
|
|
23
|
+
],
|
|
24
|
+
id: 'http://example.org/credentials/status-example',
|
|
25
|
+
type: ['VerifiableCredential'],
|
|
26
|
+
issuer: 'did:example:issuer123',
|
|
27
|
+
issuanceDate: '2023-06-15T10:00:00Z',
|
|
28
|
+
expirationDate: '2025-06-15T10:00:00Z',
|
|
29
|
+
credentialSubject: {
|
|
30
|
+
id: 'did:example:subject456',
|
|
31
|
+
degree: {
|
|
32
|
+
type: 'BachelorDegree',
|
|
33
|
+
name: 'Bachelor of Science in Computer Science',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
credentialStatus: {
|
|
37
|
+
id: 'https://example.com/credentials/status/1#42',
|
|
38
|
+
type: 'StatusList2021Entry',
|
|
39
|
+
statusPurpose: 'revocation',
|
|
40
|
+
statusListIndex: '42',
|
|
41
|
+
statusListCredential: 'https://example.com/credentials/status/1',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UnsignedVCValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const vcV2Basic: CredentialFixture = {
|
|
6
|
+
id: 'vc-v2/basic',
|
|
7
|
+
name: 'Basic VC v2 Credential',
|
|
8
|
+
description: 'Minimal W3C Verifiable Credential Data Model v2 credential using validFrom instead of issuanceDate',
|
|
9
|
+
spec: 'vc-v2',
|
|
10
|
+
profile: 'generic',
|
|
11
|
+
features: [],
|
|
12
|
+
source: 'spec-example',
|
|
13
|
+
signed: false,
|
|
14
|
+
validity: 'valid',
|
|
15
|
+
validator: UnsignedVCValidator,
|
|
16
|
+
|
|
17
|
+
credential: {
|
|
18
|
+
'@context': ['https://www.w3.org/ns/credentials/v2'],
|
|
19
|
+
id: 'urn:uuid:58172aac-d8ba-11ed-83dd-0b3aef56cc33',
|
|
20
|
+
type: ['VerifiableCredential'],
|
|
21
|
+
issuer: 'did:example:issuer123',
|
|
22
|
+
validFrom: '2023-06-15T10:00:00Z',
|
|
23
|
+
credentialSubject: {
|
|
24
|
+
id: 'did:example:subject456',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const vcV2DigitalId: CredentialFixture = {
|
|
4
|
+
id: 'vc-v2/digital-id',
|
|
5
|
+
name: 'Government Digital Identity Credential',
|
|
6
|
+
description:
|
|
7
|
+
'A W3C VC v2.0 digital identity credential modeled after government-issued digital ID programs, with status checking, terms of use, and credential schema.',
|
|
8
|
+
spec: 'vc-v2',
|
|
9
|
+
profile: 'id',
|
|
10
|
+
features: ['status', 'terms-of-use', 'credential-schema', 'image', 'expiration'],
|
|
11
|
+
source: 'synthetic',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['identity', 'government', 'digital-id', 'kyc'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
19
|
+
'https://www.w3.org/ns/credentials/examples/v2',
|
|
20
|
+
],
|
|
21
|
+
id: 'urn:uuid:d12e6b3a-45f8-4c91-a7d0-9e8b2f1c3a56',
|
|
22
|
+
type: ['VerifiableCredential'],
|
|
23
|
+
name: 'National Digital Identity Card',
|
|
24
|
+
description:
|
|
25
|
+
'A government-issued digital identity credential verifying the identity of the holder.',
|
|
26
|
+
image: 'https://gov-id-example.gov/credentials/id-card-hologram.png',
|
|
27
|
+
credentialSubject: {
|
|
28
|
+
id: 'did:example:citizen-98765',
|
|
29
|
+
type: ['Person'],
|
|
30
|
+
givenName: 'Maria',
|
|
31
|
+
familyName: 'Garcia',
|
|
32
|
+
birthDate: '1990-07-22',
|
|
33
|
+
gender: 'Female',
|
|
34
|
+
nationality: 'US',
|
|
35
|
+
address: {
|
|
36
|
+
type: ['PostalAddress'],
|
|
37
|
+
streetAddress: '456 Oak Avenue, Apt 12B',
|
|
38
|
+
addressLocality: 'Portland',
|
|
39
|
+
addressRegion: 'OR',
|
|
40
|
+
addressCountry: 'US',
|
|
41
|
+
postalCode: '97201',
|
|
42
|
+
},
|
|
43
|
+
identifier: {
|
|
44
|
+
type: ['PropertyValue'],
|
|
45
|
+
propertyID: 'nationalIdNumber',
|
|
46
|
+
value: 'XXX-XX-1234',
|
|
47
|
+
},
|
|
48
|
+
image: 'https://gov-id-example.gov/photos/citizen-98765.jpg',
|
|
49
|
+
},
|
|
50
|
+
issuer: {
|
|
51
|
+
id: 'did:web:identity.gov-example.gov',
|
|
52
|
+
type: ['Profile'],
|
|
53
|
+
name: 'Department of Digital Identity',
|
|
54
|
+
url: 'https://identity.gov-example.gov',
|
|
55
|
+
description: 'Government agency responsible for issuing and managing digital identity credentials.',
|
|
56
|
+
},
|
|
57
|
+
validFrom: '2024-01-15T00:00:00Z',
|
|
58
|
+
validUntil: '2034-01-15T00:00:00Z',
|
|
59
|
+
credentialStatus: {
|
|
60
|
+
id: 'https://identity.gov-example.gov/credentials/status/3',
|
|
61
|
+
type: 'BitstringStatusListEntry',
|
|
62
|
+
statusPurpose: 'revocation',
|
|
63
|
+
statusListIndex: '94567',
|
|
64
|
+
statusListCredential: 'https://identity.gov-example.gov/credentials/status/3',
|
|
65
|
+
},
|
|
66
|
+
credentialSchema: {
|
|
67
|
+
id: 'https://identity.gov-example.gov/schemas/digital-id-v1.json',
|
|
68
|
+
type: 'JsonSchema',
|
|
69
|
+
},
|
|
70
|
+
termsOfUse: [
|
|
71
|
+
{
|
|
72
|
+
type: 'IssuerPolicy',
|
|
73
|
+
id: 'https://identity.gov-example.gov/policies/digital-id-terms',
|
|
74
|
+
profile: 'https://identity.gov-example.gov/policies/digital-id-terms',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const vcV2EducationDegree: CredentialFixture = {
|
|
4
|
+
id: 'vc-v2/education-degree',
|
|
5
|
+
name: 'University Bachelor Degree Credential',
|
|
6
|
+
description:
|
|
7
|
+
'A W3C VC v2.0 university degree credential following the DCC (Digital Credentials Consortium) pattern used by MIT, Harvard, and other universities for digital diploma issuance.',
|
|
8
|
+
spec: 'vc-v2',
|
|
9
|
+
profile: 'diploma',
|
|
10
|
+
features: ['image'],
|
|
11
|
+
source: 'synthetic',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['education', 'degree', 'university', 'diploma', 'dcc'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
19
|
+
'https://www.w3.org/ns/credentials/examples/v2',
|
|
20
|
+
],
|
|
21
|
+
id: 'urn:uuid:e4d89b31-a4f7-4c8e-9d02-b6ef3a17c9e8',
|
|
22
|
+
type: ['VerifiableCredential'],
|
|
23
|
+
name: 'Bachelor of Science in Computer Science',
|
|
24
|
+
description:
|
|
25
|
+
'Conferred upon successful completion of all requirements for the degree of Bachelor of Science in Computer Science from Metropolis University.',
|
|
26
|
+
image: 'https://metropolis-university-example.edu/diplomas/cs-bsc-seal.png',
|
|
27
|
+
credentialSubject: {
|
|
28
|
+
id: 'did:example:graduate-2024-1234',
|
|
29
|
+
type: ['Person'],
|
|
30
|
+
name: 'Alex J. Rivera',
|
|
31
|
+
hasCredential: {
|
|
32
|
+
type: ['EducationalOccupationalCredential'],
|
|
33
|
+
name: 'Bachelor of Science in Computer Science',
|
|
34
|
+
credentialCategory: 'degree',
|
|
35
|
+
educationalLevel: 'Bachelor',
|
|
36
|
+
competencyRequired: [
|
|
37
|
+
'Software Engineering',
|
|
38
|
+
'Data Structures & Algorithms',
|
|
39
|
+
'Computer Systems',
|
|
40
|
+
'Artificial Intelligence',
|
|
41
|
+
'Mathematics (Calculus, Linear Algebra, Discrete Math)',
|
|
42
|
+
],
|
|
43
|
+
dateAwarded: '2024-05-18',
|
|
44
|
+
awardedBy: {
|
|
45
|
+
type: ['Organization'],
|
|
46
|
+
name: 'Metropolis University',
|
|
47
|
+
url: 'https://metropolis-university-example.edu',
|
|
48
|
+
address: {
|
|
49
|
+
type: ['PostalAddress'],
|
|
50
|
+
addressLocality: 'Metropolis',
|
|
51
|
+
addressRegion: 'NY',
|
|
52
|
+
addressCountry: 'US',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
recognizedBy: {
|
|
56
|
+
type: ['Organization'],
|
|
57
|
+
name: 'Middle States Commission on Higher Education',
|
|
58
|
+
url: 'https://www.msche.org',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
honors: 'Magna Cum Laude',
|
|
62
|
+
gpa: '3.78',
|
|
63
|
+
},
|
|
64
|
+
issuer: {
|
|
65
|
+
id: 'did:web:registrar.metropolis-university-example.edu',
|
|
66
|
+
type: ['Profile'],
|
|
67
|
+
name: 'Metropolis University – Office of the Registrar',
|
|
68
|
+
url: 'https://metropolis-university-example.edu',
|
|
69
|
+
image: {
|
|
70
|
+
id: 'https://metropolis-university-example.edu/logo.png',
|
|
71
|
+
type: 'Image',
|
|
72
|
+
caption: 'Metropolis University seal',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
validFrom: '2024-05-18T00:00:00Z',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const vcV2EmploymentCredential: CredentialFixture = {
|
|
4
|
+
id: 'vc-v2/employment-credential',
|
|
5
|
+
name: 'Employment Verification Credential',
|
|
6
|
+
description:
|
|
7
|
+
'A W3C VC v2.0 employment verification credential, representing a common real-world use case for background checks and professional verification.',
|
|
8
|
+
spec: 'vc-v2',
|
|
9
|
+
profile: 'generic',
|
|
10
|
+
features: ['expiration'],
|
|
11
|
+
source: 'synthetic',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['employment', 'verification', 'hr', 'professional'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
19
|
+
'https://www.w3.org/ns/credentials/examples/v2',
|
|
20
|
+
],
|
|
21
|
+
id: 'urn:uuid:7c8e2a4f-91b3-4d06-a857-3e1f9c0d4a72',
|
|
22
|
+
type: ['VerifiableCredential'],
|
|
23
|
+
name: 'Employment Verification – Senior Software Engineer',
|
|
24
|
+
description:
|
|
25
|
+
'Verifies employment of the credential subject as a Senior Software Engineer at TechCorp Global from March 2021 to present.',
|
|
26
|
+
credentialSubject: {
|
|
27
|
+
id: 'did:example:employee-567',
|
|
28
|
+
type: ['Person'],
|
|
29
|
+
name: 'Jane A. Doe',
|
|
30
|
+
employmentRecord: {
|
|
31
|
+
type: ['EmploymentRecord'],
|
|
32
|
+
employer: {
|
|
33
|
+
type: ['Organization'],
|
|
34
|
+
name: 'TechCorp Global Inc.',
|
|
35
|
+
url: 'https://techcorp-global-example.com',
|
|
36
|
+
address: {
|
|
37
|
+
type: ['PostalAddress'],
|
|
38
|
+
addressLocality: 'San Francisco',
|
|
39
|
+
addressRegion: 'CA',
|
|
40
|
+
addressCountry: 'US',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
jobTitle: 'Senior Software Engineer',
|
|
44
|
+
department: 'Platform Engineering',
|
|
45
|
+
startDate: '2021-03-15',
|
|
46
|
+
employmentType: 'Full-time',
|
|
47
|
+
occupationalCategory: '15-1252.00',
|
|
48
|
+
responsibilities: [
|
|
49
|
+
'Lead architecture design for cloud-native microservices',
|
|
50
|
+
'Mentor junior engineers and conduct code reviews',
|
|
51
|
+
'Drive adoption of CI/CD best practices across teams',
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
issuer: {
|
|
56
|
+
id: 'did:web:hr.techcorp-global-example.com',
|
|
57
|
+
type: ['Profile'],
|
|
58
|
+
name: 'TechCorp Global Inc. – Human Resources',
|
|
59
|
+
url: 'https://techcorp-global-example.com',
|
|
60
|
+
},
|
|
61
|
+
validFrom: '2024-06-01T00:00:00Z',
|
|
62
|
+
validUntil: '2025-06-01T00:00:00Z',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const vcV2LicenseCredential: CredentialFixture = {
|
|
4
|
+
id: 'vc-v2/license-credential',
|
|
5
|
+
name: 'Professional Nursing License',
|
|
6
|
+
description:
|
|
7
|
+
'A W3C VC v2.0 professional license credential modeled after state nursing board licenses, with status checking and expiration. Represents a common regulated-profession use case.',
|
|
8
|
+
spec: 'vc-v2',
|
|
9
|
+
profile: 'license',
|
|
10
|
+
features: ['expiration', 'status', 'credential-schema'],
|
|
11
|
+
source: 'synthetic',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['license', 'nursing', 'healthcare', 'regulated-profession', 'state-board'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
19
|
+
'https://www.w3.org/ns/credentials/examples/v2',
|
|
20
|
+
],
|
|
21
|
+
id: 'urn:uuid:3c7d5e9a-12b4-4f68-8a91-d7e2c3f0b15a',
|
|
22
|
+
type: ['VerifiableCredential'],
|
|
23
|
+
name: 'Registered Nurse License – State of California',
|
|
24
|
+
description:
|
|
25
|
+
'Authorizes the holder to practice as a Registered Nurse in the State of California. License is subject to biennial renewal and continuing education requirements.',
|
|
26
|
+
credentialSubject: {
|
|
27
|
+
id: 'did:example:nurse-rn-88420',
|
|
28
|
+
type: ['Person'],
|
|
29
|
+
name: 'Sarah M. Chen',
|
|
30
|
+
license: {
|
|
31
|
+
type: ['ProfessionalLicense'],
|
|
32
|
+
licenseName: 'Registered Nurse (RN)',
|
|
33
|
+
licenseNumber: 'RN-88420-CA',
|
|
34
|
+
licenseType: 'Registered Nurse',
|
|
35
|
+
issuingAuthority: {
|
|
36
|
+
type: ['Organization'],
|
|
37
|
+
name: 'California Board of Registered Nursing',
|
|
38
|
+
url: 'https://rn.ca.gov-example.gov',
|
|
39
|
+
address: {
|
|
40
|
+
type: ['PostalAddress'],
|
|
41
|
+
addressLocality: 'Sacramento',
|
|
42
|
+
addressRegion: 'CA',
|
|
43
|
+
addressCountry: 'US',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
dateIssued: '2019-06-15',
|
|
47
|
+
jurisdiction: 'US-CA',
|
|
48
|
+
occupationalCategory: '29-1141.00',
|
|
49
|
+
continuingEducation: {
|
|
50
|
+
hoursRequired: 30,
|
|
51
|
+
renewalPeriod: 'biennial',
|
|
52
|
+
hoursCompleted: 30,
|
|
53
|
+
lastCompletedDate: '2024-12-01',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
issuer: {
|
|
58
|
+
id: 'did:web:rn.ca.gov-example.gov',
|
|
59
|
+
type: ['Profile'],
|
|
60
|
+
name: 'California Board of Registered Nursing',
|
|
61
|
+
url: 'https://rn.ca.gov-example.gov',
|
|
62
|
+
description:
|
|
63
|
+
'The California Board of Registered Nursing protects the public by regulating the practice of registered nurses.',
|
|
64
|
+
},
|
|
65
|
+
validFrom: '2025-01-01T00:00:00Z',
|
|
66
|
+
validUntil: '2027-01-01T00:00:00Z',
|
|
67
|
+
credentialStatus: {
|
|
68
|
+
id: 'https://rn.ca.gov-example.gov/credentials/status/5',
|
|
69
|
+
type: 'BitstringStatusListEntry',
|
|
70
|
+
statusPurpose: 'revocation',
|
|
71
|
+
statusListIndex: '88420',
|
|
72
|
+
statusListCredential: 'https://rn.ca.gov-example.gov/credentials/status/5',
|
|
73
|
+
},
|
|
74
|
+
credentialSchema: {
|
|
75
|
+
id: 'https://rn.ca.gov-example.gov/schemas/nursing-license-v1.json',
|
|
76
|
+
type: 'JsonSchema',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { CredentialFixture } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const vcV2MembershipCredential: CredentialFixture = {
|
|
4
|
+
id: 'vc-v2/membership-credential',
|
|
5
|
+
name: 'Professional Association Membership',
|
|
6
|
+
description:
|
|
7
|
+
'A W3C VC v2.0 membership credential for a professional association, with annual expiration and status checking. Modeled after IEEE, ACM, and similar professional body memberships.',
|
|
8
|
+
spec: 'vc-v2',
|
|
9
|
+
profile: 'membership',
|
|
10
|
+
features: ['expiration', 'status'],
|
|
11
|
+
source: 'synthetic',
|
|
12
|
+
signed: false,
|
|
13
|
+
validity: 'valid',
|
|
14
|
+
tags: ['membership', 'professional', 'association'],
|
|
15
|
+
|
|
16
|
+
credential: {
|
|
17
|
+
'@context': [
|
|
18
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
19
|
+
'https://www.w3.org/ns/credentials/examples/v2',
|
|
20
|
+
],
|
|
21
|
+
id: 'urn:uuid:f9a2e3c4-7b58-4d1a-bc06-2e9f1d8a7b34',
|
|
22
|
+
type: ['VerifiableCredential'],
|
|
23
|
+
name: 'Association of Computing Professionals – Senior Member',
|
|
24
|
+
description:
|
|
25
|
+
'Certifies that the holder is a Senior Member in good standing of the Association of Computing Professionals for the 2025 membership year.',
|
|
26
|
+
credentialSubject: {
|
|
27
|
+
id: 'did:example:member-acp-44210',
|
|
28
|
+
type: ['Person'],
|
|
29
|
+
name: 'Dr. Priya Ramanathan',
|
|
30
|
+
memberOf: {
|
|
31
|
+
type: ['Organization'],
|
|
32
|
+
name: 'Association of Computing Professionals',
|
|
33
|
+
url: 'https://acp-example.org',
|
|
34
|
+
},
|
|
35
|
+
membershipId: 'ACP-44210',
|
|
36
|
+
membershipLevel: 'Senior Member',
|
|
37
|
+
memberSince: '2018-01-01',
|
|
38
|
+
specialInterestGroups: [
|
|
39
|
+
'Software Engineering',
|
|
40
|
+
'Artificial Intelligence',
|
|
41
|
+
'Human-Computer Interaction',
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
issuer: {
|
|
45
|
+
id: 'did:web:acp-example.org',
|
|
46
|
+
type: ['Profile'],
|
|
47
|
+
name: 'Association of Computing Professionals',
|
|
48
|
+
url: 'https://acp-example.org',
|
|
49
|
+
description:
|
|
50
|
+
'The world\'s largest educational and scientific computing society, delivering resources that advance computing as a science and a profession.',
|
|
51
|
+
},
|
|
52
|
+
validFrom: '2025-01-01T00:00:00Z',
|
|
53
|
+
validUntil: '2025-12-31T23:59:59Z',
|
|
54
|
+
credentialStatus: {
|
|
55
|
+
id: 'https://acp-example.org/credentials/status/2025/1',
|
|
56
|
+
type: 'BitstringStatusListEntry',
|
|
57
|
+
statusPurpose: 'revocation',
|
|
58
|
+
statusListIndex: '44210',
|
|
59
|
+
statusListCredential: 'https://acp-example.org/credentials/status/2025/1',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UnsignedVCValidator } from '@learncard/types';
|
|
2
|
+
|
|
3
|
+
import type { CredentialFixture } from '../../types';
|
|
4
|
+
|
|
5
|
+
export const vcV2MultipleSubjects: CredentialFixture = {
|
|
6
|
+
id: 'vc-v2/multiple-subjects',
|
|
7
|
+
name: 'VC v2 with Multiple Credential Subjects',
|
|
8
|
+
description:
|
|
9
|
+
'W3C VCDM v2 credential with an array of credentialSubjects, which is valid per spec but uncommon',
|
|
10
|
+
spec: 'vc-v2',
|
|
11
|
+
profile: 'generic',
|
|
12
|
+
features: ['multiple-subjects'],
|
|
13
|
+
source: 'synthetic',
|
|
14
|
+
signed: false,
|
|
15
|
+
validity: 'valid',
|
|
16
|
+
validator: UnsignedVCValidator,
|
|
17
|
+
tags: ['edge-case'],
|
|
18
|
+
|
|
19
|
+
credential: {
|
|
20
|
+
'@context': [
|
|
21
|
+
'https://www.w3.org/ns/credentials/v2',
|
|
22
|
+
'https://www.w3.org/ns/credentials/examples/v2',
|
|
23
|
+
],
|
|
24
|
+
id: 'urn:uuid:b2c3d4e5-f6a7-8901-bcde-f12345678901',
|
|
25
|
+
type: ['VerifiableCredential'],
|
|
26
|
+
issuer: 'did:example:issuer123',
|
|
27
|
+
validFrom: '2024-01-15T00:00:00Z',
|
|
28
|
+
credentialSubject: [
|
|
29
|
+
{
|
|
30
|
+
id: 'did:example:alice',
|
|
31
|
+
role: 'Team Lead',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'did:example:bob',
|
|
35
|
+
role: 'Developer',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
};
|