@bedrock/vc-delivery 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/verify.js +19 -2
- package/package.json +1 -1
package/lib/verify.js
CHANGED
|
@@ -159,6 +159,18 @@ export async function verifyDidProofJwt({workflow, exchange, jwt} = {}) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
const vm = await didIo.get({url: kid});
|
|
162
|
+
if(!vm) {
|
|
163
|
+
throw new BedrockError(
|
|
164
|
+
`Verification method identified by "kid" (${kid}) could not be ` +
|
|
165
|
+
'retrieved.', {
|
|
166
|
+
name: 'DataError',
|
|
167
|
+
details: {
|
|
168
|
+
public: true,
|
|
169
|
+
httpStatusCode: 400
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
162
174
|
// `vm.controller` must be the issuer of the DID JWT; also ensure that
|
|
163
175
|
// the specified controller authorized `vm` for the purpose of
|
|
164
176
|
// authentication
|
|
@@ -174,8 +186,13 @@ export async function verifyDidProofJwt({workflow, exchange, jwt} = {}) {
|
|
|
174
186
|
match.controller === vm.controller)) {
|
|
175
187
|
throw new BedrockError(
|
|
176
188
|
`Verification method controller "${issuer}" did not authorize ` +
|
|
177
|
-
`verification method "${vm.id}" for the purpose of "authentication".`,
|
|
178
|
-
|
|
189
|
+
`verification method "${vm.id}" for the purpose of "authentication".`, {
|
|
190
|
+
name: 'NotAllowedError',
|
|
191
|
+
details: {
|
|
192
|
+
public: true,
|
|
193
|
+
httpStatusCode: 400
|
|
194
|
+
}
|
|
195
|
+
});
|
|
179
196
|
}
|
|
180
197
|
let jwk;
|
|
181
198
|
if(isEcdsa) {
|