@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/{credential-admission-ohx0XnQr.d.cts → credential-admission-1EOQgdzY.d.cts} +1 -0
- package/dist/{credential-admission-BaP4pdpy.d.ts → credential-admission-CJ1ZPqcx.d.ts} +1 -0
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +3 -1
- package/dist/policy/index.cjs.map +1 -1
- package/dist/policy/index.d.cts +2 -2
- package/dist/policy/index.d.ts +2 -2
- package/dist/policy/index.js +3 -1
- package/dist/policy/index.js.map +1 -1
- package/package.json +1 -1
package/dist/policy/index.cjs
CHANGED
|
@@ -4130,9 +4130,11 @@ function parseSignedCompactUcanAttenuation(input, expectedCid) {
|
|
|
4130
4130
|
const signature = decodeBase64Url(signatureSegment);
|
|
4131
4131
|
if (!import_ed255192.ed25519.verify(signature, new TextEncoder().encode(`${headerSegment}.${payloadSegment}`), publicKey))
|
|
4132
4132
|
throw new Error("compact UCAN signature is invalid");
|
|
4133
|
+
if (typeof payloadValue.aud !== "string" || payloadValue.aud.length === 0)
|
|
4134
|
+
throw new Error("compact UCAN signed audience is missing");
|
|
4133
4135
|
const cid = CID.createV1(85, create(30, (0, import_blake3.blake3)(new TextEncoder().encode(input)))).toString();
|
|
4134
4136
|
if (expectedCid !== void 0 && cid !== expectedCid) throw new Error("compact UCAN CID does not match exact Authorization bytes");
|
|
4135
|
-
return { cid, payload: { att } };
|
|
4137
|
+
return { cid, payload: { att, aud: payloadValue.aud } };
|
|
4136
4138
|
}
|
|
4137
4139
|
function parsePolicySessionUcan(authorization, expectedProofs) {
|
|
4138
4140
|
const parsed = parseCompactUcanAuthorization(authorization);
|