@sphereon/ssi-types 0.9.1-next.9 → 0.9.1-unstable.27
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/LICENSE +201 -201
- package/README.md +49 -49
- package/dist/mapper/credential-mapper.d.ts +2 -2
- package/dist/mapper/credential-mapper.d.ts.map +1 -1
- package/dist/mapper/credential-mapper.js +15 -2
- package/dist/mapper/credential-mapper.js.map +1 -1
- package/dist/types/vc.d.ts +3 -0
- package/dist/types/vc.d.ts.map +1 -1
- package/dist/types/vc.js.map +1 -1
- package/package.json +3 -4
- package/src/index.ts +3 -3
- package/src/mapper/credential-mapper.ts +40 -16
- package/src/mapper/index.ts +1 -1
- package/src/types/did.ts +1 -1
- package/src/types/index.ts +3 -3
- package/src/types/pex.ts +36 -36
- package/src/types/vc.ts +3 -0
- package/src/utils/index.ts +1 -1
- package/src/utils/object.ts +19 -19
package/LICENSE
CHANGED
|
@@ -1,201 +1,201 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this fragment.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [2021] [Sphereon BV]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this fragment.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [2021] [Sphereon BV]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
<!--suppress HtmlDeprecatedAttribute -->
|
|
2
|
-
<h1 align="center">
|
|
3
|
-
<br>
|
|
4
|
-
<a href="https://www.sphereon.com"><img src="https://sphereon.com/content/themes/sphereon/assets/img/logo.svg" alt="Sphereon" width="400"></a>
|
|
5
|
-
<br>SSI Common Types (Typescript)
|
|
6
|
-
<br>
|
|
7
|
-
</h1>
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# ssi-types
|
|
16
|
-
|
|
17
|
-
Common SSI types
|
|
18
|
-
|
|
19
|
-
### Installation
|
|
20
|
-
|
|
21
|
-
```shell
|
|
22
|
-
yarn add @sphereon/ssi-types
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Build
|
|
26
|
-
|
|
27
|
-
```shell
|
|
28
|
-
yarn build
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Test
|
|
32
|
-
|
|
33
|
-
The test command runs:
|
|
34
|
-
|
|
35
|
-
- `prettier`
|
|
36
|
-
- `jest`
|
|
37
|
-
- `coverage`
|
|
38
|
-
|
|
39
|
-
You can also run only a single section of these tests, using for example `yarn test:unit`.
|
|
40
|
-
|
|
41
|
-
```shell
|
|
42
|
-
yarn test
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Utility scripts
|
|
46
|
-
|
|
47
|
-
There are other utility scripts that help with development.
|
|
48
|
-
|
|
49
|
-
- `yarn fix` - runs `eslint --fix` as well as `prettier` to fix code style.
|
|
1
|
+
<!--suppress HtmlDeprecatedAttribute -->
|
|
2
|
+
<h1 align="center">
|
|
3
|
+
<br>
|
|
4
|
+
<a href="https://www.sphereon.com"><img src="https://sphereon.com/content/themes/sphereon/assets/img/logo.svg" alt="Sphereon" width="400"></a>
|
|
5
|
+
<br>SSI Common Types (Typescript)
|
|
6
|
+
<br>
|
|
7
|
+
</h1>
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# ssi-types
|
|
16
|
+
|
|
17
|
+
Common SSI types
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
yarn add @sphereon/ssi-types
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Build
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
yarn build
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Test
|
|
32
|
+
|
|
33
|
+
The test command runs:
|
|
34
|
+
|
|
35
|
+
- `prettier`
|
|
36
|
+
- `jest`
|
|
37
|
+
- `coverage`
|
|
38
|
+
|
|
39
|
+
You can also run only a single section of these tests, using for example `yarn test:unit`.
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
yarn test
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Utility scripts
|
|
46
|
+
|
|
47
|
+
There are other utility scripts that help with development.
|
|
48
|
+
|
|
49
|
+
- `yarn fix` - runs `eslint --fix` as well as `prettier` to fix code style.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentFormat, IPresentation, IVerifiableCredential, IVerifiablePresentation, JwtDecodedVerifiableCredential, JwtDecodedVerifiablePresentation, OriginalVerifiableCredential, OriginalVerifiablePresentation, W3CVerifiableCredential, W3CVerifiablePresentation, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '../types';
|
|
1
|
+
import { DocumentFormat, ICredential, IPresentation, IVerifiableCredential, IVerifiablePresentation, JwtDecodedVerifiableCredential, JwtDecodedVerifiablePresentation, OriginalVerifiableCredential, OriginalVerifiablePresentation, W3CVerifiableCredential, W3CVerifiablePresentation, WrappedVerifiableCredential, WrappedVerifiablePresentation } from '../types';
|
|
2
2
|
export declare class CredentialMapper {
|
|
3
3
|
static decodeVerifiablePresentation(presentation: OriginalVerifiablePresentation): JwtDecodedVerifiablePresentation | IVerifiablePresentation;
|
|
4
4
|
static decodeVerifiableCredential(credential: OriginalVerifiableCredential): JwtDecodedVerifiableCredential | IVerifiableCredential;
|
|
@@ -29,7 +29,7 @@ export declare class CredentialMapper {
|
|
|
29
29
|
}): IVerifiablePresentation;
|
|
30
30
|
static jwtEncodedCredentialToUniformCredential(jwt: string, opts?: {
|
|
31
31
|
maxTimeSkewInMS?: number;
|
|
32
|
-
}):
|
|
32
|
+
}): ICredential;
|
|
33
33
|
static jwtDecodedCredentialToUniformCredential(decoded: JwtDecodedVerifiableCredential, opts?: {
|
|
34
34
|
maxTimeSkewInMS?: number;
|
|
35
35
|
}): IVerifiableCredential;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-mapper.d.ts","sourceRoot":"","sources":["../../src/mapper/credential-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,aAAa,EAIb,qBAAqB,EACrB,uBAAuB,EACvB,8BAA8B,EAC9B,gCAAgC,EAEhC,4BAA4B,EAC5B,8BAA8B,EAG9B,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC9B,MAAM,UAAU,CAAA;AAIjB,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,4BAA4B,CAAC,YAAY,EAAE,8BAA8B,GAAG,gCAAgC,GAAG,uBAAuB;IAsB7I,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,4BAA4B,GAAG,8BAA8B,GAAG,qBAAqB;IAqBnI,MAAM,CAAC,+BAA+B,CACpC,oBAAoB,EAAE,8BAA8B,EACpD,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAClC,6BAA6B;
|
|
1
|
+
{"version":3,"file":"credential-mapper.d.ts","sourceRoot":"","sources":["../../src/mapper/credential-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,WAAW,EACX,aAAa,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,EACtC,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAClC,uBAAuB;IAsC1B,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,4BAA4B,EAAE,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,qBAAqB;IAc1I,MAAM,CAAC,qBAAqB,CAAC,YAAY,EAAE,8BAA8B,EAAE,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,uBAAuB;IAqBxI,MAAM,CAAC,uCAAuC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,WAAW;IAI7G,MAAM,CAAC,uCAAuC,CAC5C,OAAO,EAAE,8BAA8B,EACvC,IAAI,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,GAClC,qBAAqB;IA2ExB,MAAM,CAAC,8BAA8B,CAAC,oBAAoB,EAAE,GAAG,GAAG,qBAAqB;IAsCvF,MAAM,CAAC,gCAAgC,CAAC,UAAU,EAAE,uBAAuB,GAAG,uBAAuB;IAYrG,MAAM,CAAC,kCAAkC,CAAC,YAAY,EAAE,yBAAyB,GAAG,yBAAyB;IAY7G,MAAM,CAAC,YAAY,CACjB,WAAW,EAAE,uBAAuB,GAAG,8BAA8B,GAAG,yBAAyB,GAAG,gCAAgC,GACnI,MAAM;IAqBT,MAAM,CAAC,kBAAkB,CACvB,QAAQ,EAAE,uBAAuB,GAAG,yBAAyB,GAAG,8BAA8B,GAAG,gCAAgC,GAChI,cAAc;CAclB"}
|
|
@@ -121,7 +121,7 @@ class CredentialMapper {
|
|
|
121
121
|
return CredentialMapper.jwtDecodedPresentationToUniformPresentation((0, jwt_decode_1.default)(jwt), makeCredentialsUniform, opts);
|
|
122
122
|
}
|
|
123
123
|
static jwtDecodedPresentationToUniformPresentation(decoded, makeCredentialsUniform = true, opts) {
|
|
124
|
-
const presentation = Object.assign({},
|
|
124
|
+
const presentation = Object.assign({}, decoded.vp);
|
|
125
125
|
if (makeCredentialsUniform) {
|
|
126
126
|
if (!decoded.vp.verifiableCredential) {
|
|
127
127
|
throw Error('Verifiable Presentation should have a verifiable credential at this point');
|
|
@@ -137,6 +137,15 @@ class CredentialMapper {
|
|
|
137
137
|
}
|
|
138
138
|
presentation.holder = decoded.iss;
|
|
139
139
|
}
|
|
140
|
+
if (decoded.aud) {
|
|
141
|
+
const verifier = presentation.verifier;
|
|
142
|
+
if (verifier) {
|
|
143
|
+
if (verifier !== decoded.aud) {
|
|
144
|
+
throw new Error(`Inconsistent holders between JWT claim (${decoded.iss}) and VC value (${verifier})`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
presentation.verifier = decoded.aud;
|
|
148
|
+
}
|
|
140
149
|
if (decoded.jti) {
|
|
141
150
|
const id = presentation.id;
|
|
142
151
|
if (id && id !== decoded.jti) {
|
|
@@ -167,6 +176,10 @@ class CredentialMapper {
|
|
|
167
176
|
const uniformPresentation = isJwtEncoded || isJwtDecoded
|
|
168
177
|
? CredentialMapper.jwtDecodedPresentationToUniformPresentation(decoded, false)
|
|
169
178
|
: decoded;
|
|
179
|
+
// At time of writing Velocity Networks does not conform to specification. Adding bare minimum @context section to stop parsers from crashing and whatnot
|
|
180
|
+
if (!uniformPresentation['@context']) {
|
|
181
|
+
uniformPresentation['@context'] = ['https://www.w3.org/2018/credentials/v1'];
|
|
182
|
+
}
|
|
170
183
|
uniformPresentation.verifiableCredential = (_a = uniformPresentation.verifiableCredential) === null || _a === void 0 ? void 0 : _a.map((vc) => CredentialMapper.toUniformCredential(vc, opts)); // We cast it because we IPresentation needs a VC. The internal Credential doesn't have the required Proof anymore (that is intended)
|
|
171
184
|
return uniformPresentation;
|
|
172
185
|
}
|
|
@@ -174,7 +187,7 @@ class CredentialMapper {
|
|
|
174
187
|
return CredentialMapper.jwtDecodedCredentialToUniformCredential((0, jwt_decode_1.default)(jwt), opts);
|
|
175
188
|
}
|
|
176
189
|
static jwtDecodedCredentialToUniformCredential(decoded, opts) {
|
|
177
|
-
const credential = Object.assign({},
|
|
190
|
+
const credential = Object.assign({}, decoded.vc);
|
|
178
191
|
const maxSkewInMS = (opts === null || opts === void 0 ? void 0 : opts.maxTimeSkewInMS) !== undefined ? opts.maxTimeSkewInMS : 999;
|
|
179
192
|
if (decoded.exp) {
|
|
180
193
|
const expDate = credential.expirationDate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-mapper.js","sourceRoot":"","sources":["../../src/mapper/credential-mapper.ts"],"names":[],"mappings":";;;;;;AAAA,oCAmBiB;AACjB,4DAAmC;AACnC,oCAAsC;AAEtC,MAAa,gBAAgB;IAC3B,MAAM,CAAC,4BAA4B,CAAC,YAA4C;;QAC9E,IAAI,gBAAgB,CAAC,YAAY,CAAC,YAAY,CAAC,EAAE;YAC/C,MAAM,OAAO,GAAG,IAAA,oBAAU,EAAC,YAAsB,CAAqC,CAAA;YACtF,MAAM,MAAM,GAAG,IAAA,oBAAU,EAAC,YAAsB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAwB,CAAA;YAE1F,OAAO,CAAC,EAAE,CAAC,KAAK,GAAG;gBACjB,IAAI,EAAE,kBAAU,CAAC,YAAY;gBAC7B,OAAO,EAAE,OAAO,CAAC,GAAG;gBACpB,YAAY,EAAE,qBAAa,CAAC,cAAc;gBAC1C,kBAAkB,EAAE,MAAA,MAAM,CAAC,KAAK,CAAC,mCAAI,OAAO,CAAC,GAAG;gBAChD,GAAG,EAAE,YAAsB;aAC5B,CAAA;YACD,OAAO,OAAO,CAAA;SACf;aAAM,IAAI,gBAAgB,CAAC,wBAAwB,CAAC,YAAY,CAAC,EAAE;YAClE,OAAO,YAAgD,CAAA;SACxD;aAAM,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE;YAC1D,OAAO,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_submission?: PresentationSubmission;
|
|
74
74
|
holder?: string;
|
|
75
|
+
verifier?: string;
|
|
75
76
|
[x: string]: any;
|
|
76
77
|
}
|
|
77
78
|
export type IVerifiablePresentation = IPresentation & IHasProof;
|
|
@@ -157,6 +158,8 @@ export interface JwtDecodedVerifiablePresentation {
|
|
|
157
158
|
nbf: string;
|
|
158
159
|
sub: string;
|
|
159
160
|
jti: string;
|
|
161
|
+
aud: string;
|
|
162
|
+
iat: string;
|
|
160
163
|
[x: string]: any;
|
|
161
164
|
}
|
|
162
165
|
export type CredentialFormat = 'jwt' | 'ldp' | 'jwt_vc' | 'ldp_vc' | string;
|
package/dist/types/vc.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc.d.ts","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEjD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAElD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,sBAAsB,GAAG,sBAAsB,EAAE,CAAA;IAC7D,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,gBAAgB,CAAC,EAAE,SAAS,GAAG,qBAAqB,GAAG,qBAAqB,EAAE,CAAA;IAE9E,MAAM,EAAE,SAAS,GAAG,OAAO,CAAA;IAE3B,YAAY,EAAE,MAAM,CAAA;IAEpB,iBAAiB,EAAE,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,GAAG,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,EAAE,CAAA;IAEtG,cAAc,CAAC,EAAE,MAAM,CAAA;IAEvB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,gBAAgB,CAAC,EAAE,iBAAi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,CAAA;AAC3E,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAA;AAC7E,MAAM,MAAM,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;AAE/D,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,GAAG,8BAA8B,CAAA;AACnG,MAAM,MAAM,8BAA8B,GAAG,yBAAyB,GAAG,gCAAgC,CAAA;AACzG,MAAM,MAAM,QAAQ,GAAG,8BAA8B,GAAG,4BAA4B,CAAA;AAEpF,0BAAkB,cAAc;IAC9B,GAAG,IAAA;IACH,MAAM,IAAA;IACN,MAAM,IAAA;CACP"}
|
package/dist/types/vc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vc.js","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"vc.js","sourceRoot":"","sources":["../../src/types/vc.ts"],"names":[],"mappings":";;;AAkKA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,kCAAkB,CAAA;IAClB,2CAA2B,CAAA;IAC3B,2CAA2B,CAAA;AAC7B,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AA0CD,IAAkB,cAIjB;AAJD,WAAkB,cAAc;IAC9B,iDAAG,CAAA;IACH,uDAAM,CAAA;IACN,uDAAM,CAAA;AACR,CAAC,EAJiB,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAI/B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-types",
|
|
3
3
|
"description": "SSI Common Types",
|
|
4
|
-
"version": "0.9.1-
|
|
4
|
+
"version": "0.9.1-unstable.27+f588994",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"@veramo/core": "4.2.0",
|
|
16
16
|
"jest": "^27.3.1",
|
|
17
17
|
"prettier": "^2.4.1",
|
|
18
|
-
"ts-jest": "^27.0.7"
|
|
19
|
-
"typescript": "4.6.4"
|
|
18
|
+
"ts-jest": "^27.0.7"
|
|
20
19
|
},
|
|
21
20
|
"files": [
|
|
22
21
|
"dist/**/*",
|
|
@@ -38,5 +37,5 @@
|
|
|
38
37
|
"Verifiable Credentials",
|
|
39
38
|
"DIDs"
|
|
40
39
|
],
|
|
41
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "f588994f2aad4f6e7554a3449df78a0816ee063a"
|
|
42
41
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './types'
|
|
2
|
-
export * from './utils'
|
|
3
|
-
export * from './mapper'
|
|
1
|
+
export * from './types'
|
|
2
|
+
export * from './utils'
|
|
3
|
+
export * from './mapper'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DocumentFormat,
|
|
3
|
+
ICredential,
|
|
3
4
|
IPresentation,
|
|
4
5
|
IProof,
|
|
5
6
|
IProofPurpose,
|
|
@@ -67,7 +68,7 @@ export class CredentialMapper {
|
|
|
67
68
|
|
|
68
69
|
static toWrappedVerifiablePresentation(
|
|
69
70
|
originalPresentation: OriginalVerifiablePresentation,
|
|
70
|
-
opts?: { maxTimeSkewInMS?: number }
|
|
71
|
+
opts?: { maxTimeSkewInMS?: number }
|
|
71
72
|
): WrappedVerifiablePresentation {
|
|
72
73
|
const original = originalPresentation
|
|
73
74
|
const isJwtEncoded: boolean = CredentialMapper.isJwtEncoded(original)
|
|
@@ -85,7 +86,10 @@ export class CredentialMapper {
|
|
|
85
86
|
if (!vp || !('verifiableCredential' in vp) || !vp.verifiableCredential || vp.verifiableCredential.length === 0) {
|
|
86
87
|
throw Error(`VP needs to have at least one verifiable credential at this point`)
|
|
87
88
|
}
|
|
88
|
-
const vcs: WrappedVerifiableCredential[] = CredentialMapper.toWrappedVerifiableCredentials(
|
|
89
|
+
const vcs: WrappedVerifiableCredential[] = CredentialMapper.toWrappedVerifiableCredentials(
|
|
90
|
+
vp.verifiableCredential /*.map(value => value.original)*/,
|
|
91
|
+
opts
|
|
92
|
+
)
|
|
89
93
|
|
|
90
94
|
const presentation = {
|
|
91
95
|
...vp,
|
|
@@ -103,14 +107,14 @@ export class CredentialMapper {
|
|
|
103
107
|
|
|
104
108
|
static toWrappedVerifiableCredentials(
|
|
105
109
|
verifiableCredentials: OriginalVerifiableCredential[],
|
|
106
|
-
opts?: { maxTimeSkewInMS?: number }
|
|
110
|
+
opts?: { maxTimeSkewInMS?: number }
|
|
107
111
|
): WrappedVerifiableCredential[] {
|
|
108
112
|
return verifiableCredentials.map((vc) => CredentialMapper.toWrappedVerifiableCredential(vc, opts))
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
static toWrappedVerifiableCredential(
|
|
112
116
|
verifiableCredential: OriginalVerifiableCredential,
|
|
113
|
-
opts?: { maxTimeSkewInMS?: number }
|
|
117
|
+
opts?: { maxTimeSkewInMS?: number }
|
|
114
118
|
): WrappedVerifiableCredential {
|
|
115
119
|
const original = verifiableCredential
|
|
116
120
|
const decoded = CredentialMapper.decodeVerifiableCredential(verifiableCredential)
|
|
@@ -153,7 +157,7 @@ export class CredentialMapper {
|
|
|
153
157
|
static jwtEncodedPresentationToUniformPresentation(
|
|
154
158
|
jwt: string,
|
|
155
159
|
makeCredentialsUniform: boolean = true,
|
|
156
|
-
opts?: { maxTimeSkewInMS?: number }
|
|
160
|
+
opts?: { maxTimeSkewInMS?: number }
|
|
157
161
|
): IPresentation {
|
|
158
162
|
return CredentialMapper.jwtDecodedPresentationToUniformPresentation(jwt_decode(jwt), makeCredentialsUniform, opts)
|
|
159
163
|
}
|
|
@@ -161,18 +165,16 @@ export class CredentialMapper {
|
|
|
161
165
|
static jwtDecodedPresentationToUniformPresentation(
|
|
162
166
|
decoded: JwtDecodedVerifiablePresentation,
|
|
163
167
|
makeCredentialsUniform: boolean = true,
|
|
164
|
-
opts?: { maxTimeSkewInMS?: number }
|
|
168
|
+
opts?: { maxTimeSkewInMS?: number }
|
|
165
169
|
): IVerifiablePresentation {
|
|
166
170
|
const presentation: IVerifiablePresentation = {
|
|
167
|
-
...
|
|
171
|
+
...decoded.vp,
|
|
168
172
|
}
|
|
169
173
|
if (makeCredentialsUniform) {
|
|
170
174
|
if (!decoded.vp.verifiableCredential) {
|
|
171
175
|
throw Error('Verifiable Presentation should have a verifiable credential at this point')
|
|
172
176
|
}
|
|
173
|
-
presentation.verifiableCredential = decoded.vp.verifiableCredential.map((vc) =>
|
|
174
|
-
CredentialMapper.toUniformCredential(vc, opts),
|
|
175
|
-
)
|
|
177
|
+
presentation.verifiableCredential = decoded.vp.verifiableCredential.map((vc) => CredentialMapper.toUniformCredential(vc, opts))
|
|
176
178
|
}
|
|
177
179
|
if (decoded.iss) {
|
|
178
180
|
const holder = presentation.holder
|
|
@@ -183,6 +185,15 @@ export class CredentialMapper {
|
|
|
183
185
|
}
|
|
184
186
|
presentation.holder = decoded.iss
|
|
185
187
|
}
|
|
188
|
+
if (decoded.aud) {
|
|
189
|
+
const verifier = presentation.verifier
|
|
190
|
+
if (verifier) {
|
|
191
|
+
if (verifier !== decoded.aud) {
|
|
192
|
+
throw new Error(`Inconsistent holders between JWT claim (${decoded.iss}) and VC value (${verifier})`)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
presentation.verifier = decoded.aud
|
|
196
|
+
}
|
|
186
197
|
if (decoded.jti) {
|
|
187
198
|
const id = presentation.id
|
|
188
199
|
if (id && id !== decoded.jti) {
|
|
@@ -216,19 +227,28 @@ export class CredentialMapper {
|
|
|
216
227
|
isJwtEncoded || isJwtDecoded
|
|
217
228
|
? CredentialMapper.jwtDecodedPresentationToUniformPresentation(decoded as JwtDecodedVerifiablePresentation, false)
|
|
218
229
|
: (decoded as IVerifiablePresentation)
|
|
230
|
+
|
|
231
|
+
// At time of writing Velocity Networks does not conform to specification. Adding bare minimum @context section to stop parsers from crashing and whatnot
|
|
232
|
+
if (!uniformPresentation['@context']) {
|
|
233
|
+
uniformPresentation['@context'] = ['https://www.w3.org/2018/credentials/v1']
|
|
234
|
+
}
|
|
235
|
+
|
|
219
236
|
uniformPresentation.verifiableCredential = uniformPresentation.verifiableCredential?.map((vc) =>
|
|
220
|
-
CredentialMapper.toUniformCredential(vc, opts)
|
|
237
|
+
CredentialMapper.toUniformCredential(vc, opts)
|
|
221
238
|
) as IVerifiableCredential[] // We cast it because we IPresentation needs a VC. The internal Credential doesn't have the required Proof anymore (that is intended)
|
|
222
239
|
return uniformPresentation
|
|
223
240
|
}
|
|
224
241
|
|
|
225
|
-
static jwtEncodedCredentialToUniformCredential(jwt: string, opts?: { maxTimeSkewInMS?: number }):
|
|
242
|
+
static jwtEncodedCredentialToUniformCredential(jwt: string, opts?: { maxTimeSkewInMS?: number }): ICredential {
|
|
226
243
|
return CredentialMapper.jwtDecodedCredentialToUniformCredential(jwt_decode(jwt), opts)
|
|
227
244
|
}
|
|
228
245
|
|
|
229
|
-
static jwtDecodedCredentialToUniformCredential(
|
|
246
|
+
static jwtDecodedCredentialToUniformCredential(
|
|
247
|
+
decoded: JwtDecodedVerifiableCredential,
|
|
248
|
+
opts?: { maxTimeSkewInMS?: number }
|
|
249
|
+
): IVerifiableCredential {
|
|
230
250
|
const credential: IVerifiableCredential = {
|
|
231
|
-
...
|
|
251
|
+
...decoded.vc,
|
|
232
252
|
}
|
|
233
253
|
|
|
234
254
|
const maxSkewInMS = opts?.maxTimeSkewInMS !== undefined ? opts.maxTimeSkewInMS : 999
|
|
@@ -363,7 +383,9 @@ export class CredentialMapper {
|
|
|
363
383
|
return presentation
|
|
364
384
|
}
|
|
365
385
|
|
|
366
|
-
static toCompactJWT(
|
|
386
|
+
static toCompactJWT(
|
|
387
|
+
jwtDocument: W3CVerifiableCredential | JwtDecodedVerifiableCredential | W3CVerifiablePresentation | JwtDecodedVerifiablePresentation
|
|
388
|
+
): string {
|
|
367
389
|
if (CredentialMapper.detectDocumentType(jwtDocument) !== DocumentFormat.JWT) {
|
|
368
390
|
throw Error('Cannot convert non JWT credential to JWT')
|
|
369
391
|
}
|
|
@@ -384,7 +406,9 @@ export class CredentialMapper {
|
|
|
384
406
|
return proof
|
|
385
407
|
}
|
|
386
408
|
|
|
387
|
-
static detectDocumentType(
|
|
409
|
+
static detectDocumentType(
|
|
410
|
+
document: W3CVerifiableCredential | W3CVerifiablePresentation | JwtDecodedVerifiableCredential | JwtDecodedVerifiablePresentation
|
|
411
|
+
): DocumentFormat {
|
|
388
412
|
if (typeof document === 'string') {
|
|
389
413
|
return this.isJsonLdAsString(document) ? DocumentFormat.JSONLD : DocumentFormat.JWT
|
|
390
414
|
}
|
package/src/mapper/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './credential-mapper'
|
|
1
|
+
export * from './credential-mapper'
|
package/src/types/did.ts
CHANGED
|
@@ -19,7 +19,7 @@ export enum IProofType {
|
|
|
19
19
|
JcsEd25519Signature2020 = 'JcsEd25519Signature2020',
|
|
20
20
|
BbsBlsSignatureProof2020 = 'BbsBlsSignatureProof2020',
|
|
21
21
|
BbsBlsBoundSignatureProof2020 = 'BbsBlsBoundSignatureProof2020',
|
|
22
|
-
JwtProof2020 = 'JwtProof2020'
|
|
22
|
+
JwtProof2020 = 'JwtProof2020',
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export interface IParsedDID {
|
package/src/types/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './did'
|
|
2
|
-
export * from './pex'
|
|
3
|
-
export * from './vc'
|
|
1
|
+
export * from './did'
|
|
2
|
+
export * from './pex'
|
|
3
|
+
export * from './vc'
|
package/src/types/pex.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* It expresses how the inputs are presented as proofs to a Verifier.
|
|
3
|
-
*/
|
|
4
|
-
export interface PresentationSubmission {
|
|
5
|
-
/**
|
|
6
|
-
* A UUID or some other unique ID to identify this Presentation Submission
|
|
7
|
-
*/
|
|
8
|
-
id: string
|
|
9
|
-
/**
|
|
10
|
-
* A UUID or some other unique ID to identify this Presentation Definition
|
|
11
|
-
*/
|
|
12
|
-
definition_id: string
|
|
13
|
-
/**
|
|
14
|
-
* List of descriptors of how the claims are being mapped to presentation definition
|
|
15
|
-
*/
|
|
16
|
-
descriptor_map: Array<Descriptor>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* descriptor map laying out the structure of the presentation submission.
|
|
21
|
-
*/
|
|
22
|
-
export interface Descriptor {
|
|
23
|
-
/**
|
|
24
|
-
* ID to identify the descriptor from Presentation Definition Input Descriptor it coresponds to.
|
|
25
|
-
*/
|
|
26
|
-
id: string
|
|
27
|
-
/**
|
|
28
|
-
* The path where the verifiable credential is located in the presentation submission json
|
|
29
|
-
*/
|
|
30
|
-
path: string
|
|
31
|
-
path_nested?: Descriptor
|
|
32
|
-
/**
|
|
33
|
-
* The Proof or JWT algorith that the proof is in
|
|
34
|
-
*/
|
|
35
|
-
format: string
|
|
36
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* It expresses how the inputs are presented as proofs to a Verifier.
|
|
3
|
+
*/
|
|
4
|
+
export interface PresentationSubmission {
|
|
5
|
+
/**
|
|
6
|
+
* A UUID or some other unique ID to identify this Presentation Submission
|
|
7
|
+
*/
|
|
8
|
+
id: string
|
|
9
|
+
/**
|
|
10
|
+
* A UUID or some other unique ID to identify this Presentation Definition
|
|
11
|
+
*/
|
|
12
|
+
definition_id: string
|
|
13
|
+
/**
|
|
14
|
+
* List of descriptors of how the claims are being mapped to presentation definition
|
|
15
|
+
*/
|
|
16
|
+
descriptor_map: Array<Descriptor>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* descriptor map laying out the structure of the presentation submission.
|
|
21
|
+
*/
|
|
22
|
+
export interface Descriptor {
|
|
23
|
+
/**
|
|
24
|
+
* ID to identify the descriptor from Presentation Definition Input Descriptor it coresponds to.
|
|
25
|
+
*/
|
|
26
|
+
id: string
|
|
27
|
+
/**
|
|
28
|
+
* The path where the verifiable credential is located in the presentation submission json
|
|
29
|
+
*/
|
|
30
|
+
path: string
|
|
31
|
+
path_nested?: Descriptor
|
|
32
|
+
/**
|
|
33
|
+
* The Proof or JWT algorith that the proof is in
|
|
34
|
+
*/
|
|
35
|
+
format: string
|
|
36
|
+
}
|
package/src/types/vc.ts
CHANGED
|
@@ -96,6 +96,7 @@ export interface IPresentation {
|
|
|
96
96
|
verifiableCredential?: W3CVerifiableCredential[]
|
|
97
97
|
presentation_submission?: PresentationSubmission
|
|
98
98
|
holder?: string
|
|
99
|
+
verifier?: string
|
|
99
100
|
|
|
100
101
|
[x: string]: any
|
|
101
102
|
}
|
|
@@ -191,6 +192,8 @@ export interface JwtDecodedVerifiablePresentation {
|
|
|
191
192
|
nbf: string
|
|
192
193
|
sub: string
|
|
193
194
|
jti: string
|
|
195
|
+
aud: string
|
|
196
|
+
iat: string
|
|
194
197
|
|
|
195
198
|
[x: string]: any
|
|
196
199
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './object'
|
|
1
|
+
export * from './object'
|
package/src/utils/object.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export class ObjectUtils {
|
|
2
|
-
public static asArray(value: unknown) {
|
|
3
|
-
return Array.isArray(value) ? value : [value]
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
public static isObject(value: unknown) {
|
|
7
|
-
return Object.prototype.toString.call(value) === '[object Object]'
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
public static isUrlAbsolute(url: string) {
|
|
11
|
-
// regex to check for absolute IRI (starting scheme and ':') or blank node IRI
|
|
12
|
-
const isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/
|
|
13
|
-
ObjectUtils.isString(url) && isAbsoluteRegex.test(url)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public static isString(value: unknown): boolean {
|
|
17
|
-
return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]'
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
export class ObjectUtils {
|
|
2
|
+
public static asArray(value: unknown) {
|
|
3
|
+
return Array.isArray(value) ? value : [value]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
public static isObject(value: unknown) {
|
|
7
|
+
return Object.prototype.toString.call(value) === '[object Object]'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
public static isUrlAbsolute(url: string) {
|
|
11
|
+
// regex to check for absolute IRI (starting scheme and ':') or blank node IRI
|
|
12
|
+
const isAbsoluteRegex = /^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/
|
|
13
|
+
ObjectUtils.isString(url) && isAbsoluteRegex.test(url)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public static isString(value: unknown): boolean {
|
|
17
|
+
return typeof value === 'string' || Object.prototype.toString.call(value) === '[object String]'
|
|
18
|
+
}
|
|
19
|
+
}
|