@bedrock/vc-delivery 7.17.1 → 7.17.2

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 (2) hide show
  1. package/lib/oid4/http.js +7 -0
  2. package/package.json +1 -1
package/lib/oid4/http.js CHANGED
@@ -439,6 +439,13 @@ function _normalizeCredentials({verifiablePresentation}) {
439
439
  vc.id?.startsWith('data:application/jwt,')) {
440
440
  return vc.id.slice('data:application/jwt,'.length);
441
441
  }
442
+ // parse any mdoc mDL into its non-VC format (includes base64 => base64url)
443
+ if(vc.type === 'EnvelopedVerifiableCredential' &&
444
+ vc.id?.startsWith('data:application/mdl;base64,')) {
445
+ const buffer = Buffer.from(
446
+ vc.id.slice('data:application/mdl;base64,'.length), 'base64');
447
+ return buffer.toString('base64url');
448
+ }
442
449
  return vc;
443
450
  });
444
451
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-delivery",
3
- "version": "7.17.1",
3
+ "version": "7.17.2",
4
4
  "type": "module",
5
5
  "description": "Bedrock Verifiable Credential Delivery",
6
6
  "main": "./lib/index.js",