@nuggetslife/vc 0.0.30 → 0.2.0

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.
Files changed (66) hide show
  1. package/Cargo.toml +11 -0
  2. package/W3C_CONFORMANCE.md +6 -5
  3. package/bench/frame_compare.mjs +203 -0
  4. package/bench/v2_internals.mjs +115 -0
  5. package/bench/vc_ops.mjs +308 -0
  6. package/interop-allowlist.json +3 -0
  7. package/interop-smoke-allowlist.json +3 -0
  8. package/package.json +8 -7
  9. package/scripts/fetch-w3c-tests.sh +8 -0
  10. package/src/jsonld.rs +211 -140
  11. package/src/ld_signatures.rs +11 -2
  12. package/test-fixtures/interop/README.md +46 -0
  13. package/test-fixtures/interop/_contexts/README.md +51 -0
  14. package/test-fixtures/interop/_contexts/bbs-bound-v1.jsonld +92 -0
  15. package/test-fixtures/interop/_contexts/citizenship-v1.jsonld +58 -0
  16. package/test-fixtures/interop/_contexts/credentials-v1.jsonld +316 -0
  17. package/test-fixtures/interop/_contexts/elm-edc-ap.jsonld +809 -0
  18. package/test-fixtures/interop/_contexts/essif-schemas-vc-2020-v1.jsonld +47 -0
  19. package/test-fixtures/interop/_contexts/identity-v2.jsonld +195 -0
  20. package/test-fixtures/interop/_contexts/nuggets-identity-v1.jsonld +175 -0
  21. package/test-fixtures/interop/_contexts/nuggets-kyb-v1.jsonld +333 -0
  22. package/test-fixtures/interop/_contexts/openbadges-v3.jsonld +445 -0
  23. package/test-fixtures/interop/_contexts/security-bbs-v1.jsonld +93 -0
  24. package/test-fixtures/interop/ebsi/diploma-elm/README.md +29 -0
  25. package/test-fixtures/interop/ebsi/diploma-elm/expected.nq +70 -0
  26. package/test-fixtures/interop/ebsi/diploma-elm/frame.jsonld +24 -0
  27. package/test-fixtures/interop/ebsi/diploma-elm/input.jsonld +444 -0
  28. package/test-fixtures/interop/ebsi/diploma-simple/README.md +19 -0
  29. package/test-fixtures/interop/ebsi/diploma-simple/expected.nq +9 -0
  30. package/test-fixtures/interop/ebsi/diploma-simple/frame.jsonld +13 -0
  31. package/test-fixtures/interop/ebsi/diploma-simple/input.jsonld +24 -0
  32. package/test-fixtures/interop/idv2/full-disclosure/README.md +9 -0
  33. package/test-fixtures/interop/idv2/full-disclosure/expected.nq +59 -0
  34. package/test-fixtures/interop/idv2/full-disclosure/frame.jsonld +9 -0
  35. package/test-fixtures/interop/idv2/full-disclosure/input.jsonld +82 -0
  36. package/test-fixtures/interop/nuggets/identity-v1/README.md +17 -0
  37. package/test-fixtures/interop/nuggets/identity-v1/expected.nq +21 -0
  38. package/test-fixtures/interop/nuggets/identity-v1/frame.jsonld +17 -0
  39. package/test-fixtures/interop/nuggets/identity-v1/input.jsonld +31 -0
  40. package/test-fixtures/interop/nuggets/kyb-v1/README.md +15 -0
  41. package/test-fixtures/interop/nuggets/kyb-v1/expected.nq +18 -0
  42. package/test-fixtures/interop/nuggets/kyb-v1/frame.jsonld +24 -0
  43. package/test-fixtures/interop/nuggets/kyb-v1/input.jsonld +60 -0
  44. package/test-fixtures/interop/openbadges-v3/basic-achievement/README.md +17 -0
  45. package/test-fixtures/interop/openbadges-v3/basic-achievement/expected.nq +12 -0
  46. package/test-fixtures/interop/openbadges-v3/basic-achievement/frame.jsonld +17 -0
  47. package/test-fixtures/interop/openbadges-v3/basic-achievement/input.jsonld +25 -0
  48. package/test-fixtures/interop/openbadges-v3/with-allowed-values/README.md +11 -0
  49. package/test-fixtures/interop/openbadges-v3/with-allowed-values/expected.nq +25 -0
  50. package/test-fixtures/interop/openbadges-v3/with-allowed-values/frame.jsonld +22 -0
  51. package/test-fixtures/interop/openbadges-v3/with-allowed-values/input.jsonld +40 -0
  52. package/test-fixtures/interop/vp/single-vc-wrap/README.md +6 -0
  53. package/test-fixtures/interop/vp/single-vc-wrap/expected.nq +7 -0
  54. package/test-fixtures/interop/vp/single-vc-wrap/frame.jsonld +17 -0
  55. package/test-fixtures/interop/vp/single-vc-wrap/input.jsonld +27 -0
  56. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/README.md +5 -0
  57. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/expected.nq +13 -0
  58. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/frame.jsonld +14 -0
  59. package/test-fixtures/interop/w3c-vc-v1/permanent-resident-card/input.jsonld +29 -0
  60. package/test_interop.mjs +184 -0
  61. package/test_interop_smoke.mjs +388 -0
  62. package/test_jsonld_crossverify.mjs +8 -2
  63. package/test_w3c_conformance.mjs +80 -7
  64. package/tools/regen_expected.mjs +108 -0
  65. package/w3c-baseline.json +881 -263
  66. package/w3c-denylist.json +6 -1
@@ -0,0 +1,47 @@
1
+ {
2
+ "__url__": "https://essif.europa.eu/schemas/vc/2020/v1",
3
+ "@context": {
4
+ "@version": 1.1,
5
+ "@protected": true,
6
+ "id": "@id",
7
+ "type": "@type",
8
+ "name": "https://schema.org/name",
9
+ "description": "https://schema.org/description",
10
+ "identifier": "http://schema.org/identifier",
11
+ "image": {
12
+ "@id": "http://schema.org/image",
13
+ "@type": "@id"
14
+ },
15
+ "essif": "https://essif.europa.eu/schemas/vc/2020/v1#",
16
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
17
+ "VerifiableAttestation": "essif:VerifiableAttestation",
18
+ "DiplomaCredential": "essif:DiplomaCredential",
19
+ "Student": {
20
+ "@id": "essif:Student",
21
+ "@context": {
22
+ "essif": "https://essif.europa.eu/schemas/vc/2020/v1#",
23
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
24
+ "@version": 1.1,
25
+ "@protected": true,
26
+ "id": "@id",
27
+ "type": "@type",
28
+ "studyProgram": "essif:studyProgram",
29
+ "immatriculationNumber": "essif:immatriculationNumber",
30
+ "currentGivenName": "essif:currentGivenName",
31
+ "currentFamilyName": "essif:currentFamilyName",
32
+ "learningAchievement": "essif:learningAchievement",
33
+ "dateOfBirth": {
34
+ "@id": "essif:dateOfBirth",
35
+ "@type": "xsd:dateTime"
36
+ },
37
+ "dateOfAchievement": {
38
+ "@id": "essif:dateOfAchievement",
39
+ "@type": "xsd:dateTime"
40
+ },
41
+ "overallEvaluation": "essif:overallEvaluation",
42
+ "eqfLevel": "essif:eqfLevel",
43
+ "targetFrameworkName": "essif:targetFrameworkName"
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,195 @@
1
+ {
2
+ "__url__": "https://schemas.nuggets.life/identityV2.json",
3
+ "@context": {
4
+ "@version": 1.1,
5
+ "@protected": true,
6
+ "schema": "http://schema.org/",
7
+ "name": "schema:name",
8
+ "description": "schema:description",
9
+ "identifier": "schema:identifier",
10
+ "DrivingLicence": {
11
+ "@id": "https://schemas.nuggets.life/identityV2.json#DrivingLicence",
12
+ "@context": {
13
+ "@version": 1.1,
14
+ "@protected": true,
15
+ "id": "@id",
16
+ "type": "@type",
17
+ "schema": "http://schema.org/",
18
+ "address": {
19
+ "@id": "schema:PostalAddress",
20
+ "@context": {
21
+ "@version": 1.1,
22
+ "@protected": true,
23
+ "id": "@id",
24
+ "type": "@type",
25
+ "schema": "http://schema.org/",
26
+ "streetAddress": "schema:streetAddress",
27
+ "addressLocality": "schema:addressLocality",
28
+ "addressRegion": "schema:addressRegion",
29
+ "postalCode": "schema:postalCode",
30
+ "addressCountry": "schema:addressCountry"
31
+ }
32
+ },
33
+ "document": {
34
+ "@id": "schema:DigitalDocument",
35
+ "@context": {
36
+ "@version": 1.1,
37
+ "@protected": true,
38
+ "id": "@id",
39
+ "type": "@type",
40
+ "idty": "https://schemas.nuggets.life/identityV2.json#",
41
+ "schema": "http://schema.org/",
42
+ "identifier": "schema:identifier",
43
+ "name": "schema:name",
44
+ "description": "schema:description",
45
+ "additionalType": "schema:additionalType",
46
+ "countryOfOrigin": "schema:countryOfOrigin",
47
+ "encodingFormat": "schema:encodingFormat",
48
+ "expires": "schema:expires",
49
+ "image": {
50
+ "@id": "schema:image",
51
+ "@type": "@id"
52
+ },
53
+ "hash": "idty:hash"
54
+ }
55
+ }
56
+ }
57
+ },
58
+ "Passport": {
59
+ "@id": "https://schemas.nuggets.life/identityV2.json#Passport",
60
+ "@context": {
61
+ "@version": 1.1,
62
+ "@protected": true,
63
+ "id": "@id",
64
+ "type": "@type",
65
+ "schema": "http://schema.org/",
66
+ "document": {
67
+ "@id": "schema:DigitalDocument",
68
+ "@context": {
69
+ "@version": 1.1,
70
+ "@protected": true,
71
+ "id": "@id",
72
+ "type": "@type",
73
+ "idty": "https://schemas.nuggets.life/identityV2.json#",
74
+ "schema": "http://schema.org/",
75
+ "identifier": "schema:identifier",
76
+ "name": "schema:name",
77
+ "description": "schema:description",
78
+ "additionalType": "schema:additionalType",
79
+ "countryOfOrigin": "schema:countryOfOrigin",
80
+ "encodingFormat": "schema:encodingFormat",
81
+ "expires": "schema:expires",
82
+ "image": {
83
+ "@id": "schema:image",
84
+ "@type": "@id"
85
+ },
86
+ "hash": "idty:hash"
87
+ }
88
+ }
89
+ }
90
+ },
91
+ "Person": {
92
+ "@id": "https://schemas.nuggets.life/identityV2.json#Person",
93
+ "@context": {
94
+ "@version": 1.1,
95
+ "@protected": true,
96
+ "id": "@id",
97
+ "type": "@type",
98
+ "idty": "https://schemas.nuggets.life/identityV2.json#",
99
+ "schema": "http://schema.org/",
100
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
101
+ "birthDate": {
102
+ "@id": "schema:birthDate",
103
+ "@type": "xsd:dateTime"
104
+ },
105
+ "familyName": "schema:familyName",
106
+ "givenName": "schema:givenName",
107
+ "gender": "schema:gender",
108
+ "nationality": "schema:nationality",
109
+ "age": {
110
+ "@id": "idty:age",
111
+ "@type": "xsd:integer"
112
+ },
113
+ "over5": {
114
+ "@id": "idty:over5",
115
+ "@type": "xsd:boolean"
116
+ },
117
+ "over10": {
118
+ "@id": "idty:over10",
119
+ "@type": "xsd:boolean"
120
+ },
121
+ "over12": {
122
+ "@id": "idty:over12",
123
+ "@type": "xsd:boolean"
124
+ },
125
+ "over13": {
126
+ "@id": "idty:over13",
127
+ "@type": "xsd:boolean"
128
+ },
129
+ "over14": {
130
+ "@id": "idty:over14",
131
+ "@type": "xsd:boolean"
132
+ },
133
+ "over15": {
134
+ "@id": "idty:over15",
135
+ "@type": "xsd:boolean"
136
+ },
137
+ "over16": {
138
+ "@id": "idty:over16",
139
+ "@type": "xsd:boolean"
140
+ },
141
+ "over17": {
142
+ "@id": "idty:over17",
143
+ "@type": "xsd:boolean"
144
+ },
145
+ "over18": {
146
+ "@id": "idty:over18",
147
+ "@type": "xsd:boolean"
148
+ },
149
+ "over19": {
150
+ "@id": "idty:over19",
151
+ "@type": "xsd:boolean"
152
+ },
153
+ "over21": {
154
+ "@id": "idty:over21",
155
+ "@type": "xsd:boolean"
156
+ }
157
+ }
158
+ },
159
+ "DocumentVerification": {
160
+ "@id": "https://schemas.nuggets.life/identityV2.json#DocumentVerification",
161
+ "@context": {
162
+ "@version": 1.1,
163
+ "@protected": true,
164
+ "id": "@id",
165
+ "type": "@type",
166
+ "idty": "https://schemas.nuggets.life/identityV2.json#",
167
+ "verifier": "idty:verifier",
168
+ "evidenceDocument": "idty:evidenceDocument",
169
+ "subjectPresence": "idty:subjectPresence",
170
+ "documentPresence": "idty:documentPresence"
171
+ }
172
+ },
173
+ "BiometricVerification": {
174
+ "@id": "https://schemas.nuggets.life/identityV2.json#BiometricVerification",
175
+ "@context": {
176
+ "@version": 1.1,
177
+ "@protected": true,
178
+ "id": "@id",
179
+ "type": "@type",
180
+ "idty": "https://schemas.nuggets.life/identityV2.json#",
181
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
182
+ "schema": "http://schema.org/",
183
+ "verifier": "idty:verifier",
184
+ "facialSimilarity": {
185
+ "@id": "idty:facialSimilarity",
186
+ "@type": "xsd:decimal"
187
+ },
188
+ "image": {
189
+ "@id": "idty:biometricImage",
190
+ "@type": "schema:image"
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
@@ -0,0 +1,175 @@
1
+ {
2
+ "__url__": "https://schemas.nuggets.life/identity.json",
3
+ "@context": {
4
+ "@version": 1.1,
5
+ "@protected": true,
6
+
7
+ "schema": "http://schema.org/",
8
+
9
+ "name": "schema:name",
10
+ "description": "schema:description",
11
+ "identifier": "schema:identifier",
12
+
13
+ "DrivingLicence": {
14
+ "@id": "https://schemas.nuggets.life/identity.json#DrivingLicence",
15
+ "@context": {
16
+ "@version": 1.1,
17
+ "@protected": true,
18
+
19
+ "id": "@id",
20
+ "type": "@type",
21
+
22
+ "schema": "http://schema.org/",
23
+
24
+ "address": {
25
+ "@id": "schema:PostalAddress",
26
+ "@context": {
27
+ "@version": 1.1,
28
+ "@protected": true,
29
+
30
+ "id": "@id",
31
+ "type": "@type",
32
+
33
+ "schema": "http://schema.org/",
34
+
35
+ "streetAddress": "schema:streetAddress",
36
+ "addressLocality": "schema:addressLocality",
37
+ "addressRegion": "schema:addressRegion",
38
+ "postalCode": "schema:postalCode",
39
+ "addressCountry": "schema:addressCountry"
40
+ }
41
+ },
42
+
43
+ "document": {
44
+ "@id": "schema:DigitalDocument",
45
+ "@context": {
46
+ "@version": 1.1,
47
+ "@protected": true,
48
+
49
+ "id": "@id",
50
+ "type": "@type",
51
+
52
+ "idty": "https://schemas.nuggets.life/identity.json#",
53
+ "schema": "http://schema.org/",
54
+
55
+ "identifier": "schema:identifier",
56
+ "name": "schema:name",
57
+ "description": "schema:description",
58
+ "additionalType": "schema:additionalType",
59
+ "countryOfOrigin": "schema:countryOfOrigin",
60
+ "encodingFormat": "schema:encodingFormat",
61
+ "expires": "schema:expires",
62
+ "image": { "@id": "schema:image", "@type": "@id" },
63
+ "hash": "idty:hash"
64
+ }
65
+ }
66
+ }
67
+ },
68
+
69
+ "Passport": {
70
+ "@id": "https://schemas.nuggets.life/identity.json#Passport",
71
+ "@context": {
72
+ "@version": 1.1,
73
+ "@protected": true,
74
+
75
+ "id": "@id",
76
+ "type": "@type",
77
+
78
+ "schema": "http://schema.org/",
79
+
80
+ "document": {
81
+ "@id": "schema:DigitalDocument",
82
+ "@context": {
83
+ "@version": 1.1,
84
+ "@protected": true,
85
+
86
+ "id": "@id",
87
+ "type": "@type",
88
+
89
+ "idty": "https://schemas.nuggets.life/identity.json#",
90
+ "schema": "http://schema.org/",
91
+
92
+ "identifier": "schema:identifier",
93
+ "name": "schema:name",
94
+ "description": "schema:description",
95
+ "additionalType": "schema:additionalType",
96
+ "countryOfOrigin": "schema:countryOfOrigin",
97
+ "encodingFormat": "schema:encodingFormat",
98
+ "expires": "schema:expires",
99
+ "image": { "@id": "schema:image", "@type": "@id" },
100
+ "hash": "idty:hash"
101
+ }
102
+ }
103
+ }
104
+ },
105
+
106
+ "Person": {
107
+ "@id": "https://schemas.nuggets.life/identity.json#Person",
108
+ "@context": {
109
+ "@version": 1.1,
110
+ "@protected": true,
111
+
112
+ "id": "@id",
113
+ "type": "@type",
114
+
115
+ "idty": "https://schemas.nuggets.life/identity.json#",
116
+ "schema": "http://schema.org/",
117
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
118
+
119
+ "birthDate": { "@id": "schema:birthDate", "@type": "xsd:dateTime" },
120
+ "familyName": "schema:familyName",
121
+ "givenName": "schema:givenName",
122
+ "gender": "schema:gender",
123
+ "nationality": "schema:nationality",
124
+
125
+ "age": {"@id": "idty:age", "@type": "xsd:integer"},
126
+ "over5": {"@id": "idty:over5", "@type": "xsd:boolean"},
127
+ "over10": {"@id": "idty:over10", "@type": "xsd:boolean"},
128
+ "over12": {"@id": "idty:over12", "@type": "xsd:boolean"},
129
+ "over13": {"@id": "idty:over13", "@type": "xsd:boolean"},
130
+ "over14": {"@id": "idty:over14", "@type": "xsd:boolean"},
131
+ "over15": {"@id": "idty:over15", "@type": "xsd:boolean"},
132
+ "over16": {"@id": "idty:over16", "@type": "xsd:boolean"},
133
+ "over17": {"@id": "idty:over17", "@type": "xsd:boolean"},
134
+ "over18": {"@id": "idty:over18", "@type": "xsd:boolean"},
135
+ "over19": {"@id": "idty:over19", "@type": "xsd:boolean"},
136
+ "over21": {"@id": "idty:over21", "@type": "xsd:boolean"}
137
+ }
138
+ },
139
+
140
+ "DocumentVerification": {
141
+ "@id": "https://schemas.nuggets.life/identity.json#DocumentVerification",
142
+ "@context": {
143
+ "@version": 1.1,
144
+ "@protected": true,
145
+
146
+ "id": "@id",
147
+ "type": "@type",
148
+
149
+ "idty": "https://schemas.nuggets.life/identity.json#",
150
+
151
+ "verifier": "idty:verifier",
152
+ "evidenceDocument": "idty:evidenceDocument",
153
+ "subjectPresence": "idty:subjectPresence",
154
+ "documentPresence": "idty:documentPresence"
155
+ }
156
+ },
157
+
158
+ "BiometricVerification": {
159
+ "@id": "https://schemas.nuggets.life/identity.json#BiometricVerification",
160
+ "@context": {
161
+ "@version": 1.1,
162
+ "@protected": true,
163
+
164
+ "id": "@id",
165
+ "type": "@type",
166
+
167
+ "idty": "https://schemas.nuggets.life/identity.json#",
168
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
169
+
170
+ "verifier": "idty:verifier",
171
+ "facialSimilarity": {"@id": "idty:facialSimilarity", "@type": "xsd:decimal"}
172
+ }
173
+ }
174
+ }
175
+ }