@tinycloud/sdk-core 3.1.0 → 3.2.0-beta.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.
package/dist/index.cjs CHANGED
@@ -4705,9 +4705,11 @@ function parseSignedCompactUcanAttenuation(input, expectedCid) {
4705
4705
  const signature = decodeBase64Url2(signatureSegment);
4706
4706
  if (!import_ed255193.ed25519.verify(signature, new TextEncoder().encode(`${headerSegment}.${payloadSegment}`), publicKey))
4707
4707
  throw new Error("compact UCAN signature is invalid");
4708
+ if (typeof payloadValue.aud !== "string" || payloadValue.aud.length === 0)
4709
+ throw new Error("compact UCAN signed audience is missing");
4708
4710
  const cid2 = CID.createV1(85, create(30, (0, import_blake3.blake3)(new TextEncoder().encode(input)))).toString();
4709
4711
  if (expectedCid !== void 0 && cid2 !== expectedCid) throw new Error("compact UCAN CID does not match exact Authorization bytes");
4710
- return { cid: cid2, payload: { att } };
4712
+ return { cid: cid2, payload: { att, aud: payloadValue.aud } };
4711
4713
  }
4712
4714
  function parsePolicySessionUcan(authorization, expectedProofs) {
4713
4715
  const parsed = parseCompactUcanAuthorization(authorization);