@tinycloud/sdk-core 3.0.0-beta.1 → 3.0.0-beta.10
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-C_cO1QqB.d.cts → credential-admission-CFjUChF8.d.cts} +122 -2
- package/dist/{credential-admission-cvHe-HUC.d.ts → credential-admission-DIEPgQ0o.d.ts} +122 -2
- package/dist/delegations/index.cjs +80 -133
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +3 -3
- package/dist/delegations/index.d.ts +3 -3
- package/dist/delegations/index.js +81 -138
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +756 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -7
- package/dist/index.d.ts +66 -7
- package/dist/index.js +758 -311
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +323 -8
- 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 +323 -8
- package/dist/policy/index.js.map +1 -1
- package/dist/{recipient-types.schema-G8NEKRoo.d.cts → recipient-types.schema-Cz5zJzED.d.cts} +50 -77
- package/dist/{recipient-types.schema-G8NEKRoo.d.ts → recipient-types.schema-Cz5zJzED.d.ts} +50 -77
- package/package.json +4 -4
package/dist/policy/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PolicyEngineRecord, S as SignedObjectSigner, a as Policy, U as UnsignedPolicyEngineRecord } from '../credential-admission-
|
|
2
|
-
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, B as BuildPolicyCredentialPresentationV3Input, C as CONTENT_SOURCE_V1_DOMAIN,
|
|
1
|
+
import { P as PolicyEngineRecord, S as SignedObjectSigner, a as Policy, U as UnsignedPolicyEngineRecord } from '../credential-admission-CFjUChF8.cjs';
|
|
2
|
+
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, d as AttestedEnforcerBindingV2, B as BuildPolicyCredentialPresentationV3Input, e as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, f as CompactPolicyInvocationInput, g as CompactUcanAuthorizationV1, E as ED25519_JCS_SIGNATURE_SUITE, h as EIP191_JCS_SIGNATURE_SUITE, J as JsonObject, L as LAST_V2_CREATE_AT, i as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, j as POLICY_CAPABILITY_V1_DOMAIN, k as POLICY_CAPABILITY_V1_SCHEMA, l as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, m as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, n as POLICY_ENGINE_RECORD_SCHEMA, o as POLICY_PRESENTATION_V3_DOMAIN, p as POLICY_PRESENTATION_V3_SCHEMA, q as POLICY_PRESENTATION_V4_DOMAIN, r as POLICY_PRESENTATION_V4_SCHEMA, s as POLICY_SCHEMA, t as POLICY_SESSION_UCAN_V1_PROFILE, u as POLICY_STATUS_SCHEMA, v as POLICY_V1_DOMAIN, w as POLICY_V1_SCHEMA, x as POLICY_V2_DOMAIN, y as POLICY_V2_SCHEMA, z as PolicyChallengeV3, D as PolicyCredentialAdmissionV3, F as PolicyCredentialAdmissionV4, G as PolicyCredentialPresentationV3, H as PolicyCredentialPresentationV4, I as PolicyCredentialRequirementV1, K as PolicyRootStatusV3, O as PolicyRootV3, Q as PolicySessionUcanFactV1, R as PolicySessionUcanV1, T as PolicyStatus, V as ROOT_REVOCATION_V1_DOMAIN, W as ROOT_REVOCATION_V1_SCHEMA, X as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, Y as ROOT_STATUS_RENEWAL_V1_DOMAIN, Z as ROOT_STATUS_V1_DOMAIN, _ as RegisterPolicyV3Input, $ as RegisterPolicyV3Receipt, a0 as SignCompactUcanAuthorizationInput, a1 as SignCompactUcanRootAuthorizationInput, a2 as SignatureMaterialError, a3 as SignatureSuite, a4 as SignatureVerificationError, a5 as SignedObjectCanonicalizationError, a6 as SignedObjectDigestError, a7 as SignedObjectErrorCode, a8 as SignedObjectIdError, a9 as SignedObjectKind, aa as SignedObjectMaterial, ab as SignedObjectProfileError, ac as SignedObjectSchemaError, ad as SignedObjectSignature, ae as SignedObjectVerificationResult, af as SignedPolicyObject, ag as SigningKeyBindingError, ah as UnifiedContentSource, ai as UnifiedEncryptionCapability, aj as UnifiedKvCapability, ak as UnifiedNativeCapability, al as UnifiedPolicyCapability, am as UnifiedPolicyV1, an as UnifiedPolicyV2, ao as UnifiedResourceSelector, ap as UnsignedPolicy, aq as UnsignedPolicyCredentialPresentationV4, ar as UnsignedPolicyObject, as as UnsignedPolicyStatus, at as UnsignedUnifiedPolicyV2, au as UnsupportedSignatureSuiteError, av as admitPolicyCredentialV3, aw as admitPolicyCredentialV4, ax as buildPolicyCredentialPresentationV3, ay as buildPolicyCredentialPresentationV4, az as canonicalizeSignedObjectUnsigned, aA as canonicalizeUnifiedPolicyCapability, aB as compactAttenuationContains, aC as contentSourceDigestHex, aD as createAndSignPolicy, aE as createAndSignPolicyEngineRecord, aF as createAndSignPolicyStatus, aG as createAndSignSignedObject, aH as createCompactPolicyDescendant, aI as createCompactPolicyInvocation, aJ as deriveSignedObjectMaterial, aK as getPolicyRootStatusV3, aL as issuedCredentialEnvelopeFromVerified, aM as mintPolicySessionV3, aN as normalizeUnifiedPolicyCapability, aO as parseCompactUcanAuthorization, aP as parsePolicySessionUcan, aQ as policyCidFromCanonicalBytes, aR as policyDigestHex, aS as policyIdForDigestHex, aT as policyV2DigestHex, aU as projectUnifiedPolicyCapabilities, aV as projectUnifiedPolicyCapability, aW as registerPolicyV3, aX as renewPolicyRootStatusV3, aY as requestPolicyChallengeV3, aZ as revokePolicyRootV3, a_ as signCompactUcanAuthorization, a$ as signCompactUcanRootAuthorization, b0 as signPolicyCredentialPresentationV4, b1 as signedObjectIdFor, b2 as toSignedObjectError, b3 as unifiedNativeProjectionHashHex, b4 as unifiedPolicyCapabilityContains, b5 as unifiedPolicyCapabilityDigestHex, b6 as unifiedPolicyCapabilityFromNative, b7 as validatePolicyCredentialRequirementV1, b8 as validatePolicyEngineRecordSigned, b9 as validatePolicyEngineRecordSignedShape, ba as validatePolicyEngineRecordUnsigned, bb as validatePolicySigned, bc as validatePolicySignedShape, bd as validatePolicyStatusSigned, be as validatePolicyStatusSignedShape, bf as validatePolicyStatusUnsigned, bg as validatePolicyUnsigned, bh as validateUnifiedPolicyV2, bi as verifyPolicy, bj as verifyPolicyEngineRecord, bk as verifyPolicyRootRevocationV3, bl as verifyPolicyRootStatusCheckpointV3, bm as verifyPolicyStatus, bn as verifySignedObject } from '../credential-admission-CFjUChF8.cjs';
|
|
3
3
|
import { J as JsonObject, P as PolicyCapabilityError } from '../capability-BjzXwtNw.cjs';
|
|
4
4
|
export { a as JsonValue, b as PolicyCapability, c as PolicyCapabilityErrorCode, d as canonicalizePolicyCapability, j as jcsCanonicalize, n as normalizeJson, e as normalizePolicyCapability, p as policyCapabilityContains, f as policyCapabilityDigestHex, s as serializeJcsJson } from '../capability-BjzXwtNw.cjs';
|
|
5
5
|
import 'zod';
|
package/dist/policy/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PolicyEngineRecord, S as SignedObjectSigner, a as Policy, U as UnsignedPolicyEngineRecord } from '../credential-admission-
|
|
2
|
-
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, B as BuildPolicyCredentialPresentationV3Input, C as CONTENT_SOURCE_V1_DOMAIN,
|
|
1
|
+
import { P as PolicyEngineRecord, S as SignedObjectSigner, a as Policy, U as UnsignedPolicyEngineRecord } from '../credential-admission-DIEPgQ0o.js';
|
|
2
|
+
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, d as AttestedEnforcerBindingV2, B as BuildPolicyCredentialPresentationV3Input, e as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, f as CompactPolicyInvocationInput, g as CompactUcanAuthorizationV1, E as ED25519_JCS_SIGNATURE_SUITE, h as EIP191_JCS_SIGNATURE_SUITE, J as JsonObject, L as LAST_V2_CREATE_AT, i as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, j as POLICY_CAPABILITY_V1_DOMAIN, k as POLICY_CAPABILITY_V1_SCHEMA, l as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, m as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, n as POLICY_ENGINE_RECORD_SCHEMA, o as POLICY_PRESENTATION_V3_DOMAIN, p as POLICY_PRESENTATION_V3_SCHEMA, q as POLICY_PRESENTATION_V4_DOMAIN, r as POLICY_PRESENTATION_V4_SCHEMA, s as POLICY_SCHEMA, t as POLICY_SESSION_UCAN_V1_PROFILE, u as POLICY_STATUS_SCHEMA, v as POLICY_V1_DOMAIN, w as POLICY_V1_SCHEMA, x as POLICY_V2_DOMAIN, y as POLICY_V2_SCHEMA, z as PolicyChallengeV3, D as PolicyCredentialAdmissionV3, F as PolicyCredentialAdmissionV4, G as PolicyCredentialPresentationV3, H as PolicyCredentialPresentationV4, I as PolicyCredentialRequirementV1, K as PolicyRootStatusV3, O as PolicyRootV3, Q as PolicySessionUcanFactV1, R as PolicySessionUcanV1, T as PolicyStatus, V as ROOT_REVOCATION_V1_DOMAIN, W as ROOT_REVOCATION_V1_SCHEMA, X as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, Y as ROOT_STATUS_RENEWAL_V1_DOMAIN, Z as ROOT_STATUS_V1_DOMAIN, _ as RegisterPolicyV3Input, $ as RegisterPolicyV3Receipt, a0 as SignCompactUcanAuthorizationInput, a1 as SignCompactUcanRootAuthorizationInput, a2 as SignatureMaterialError, a3 as SignatureSuite, a4 as SignatureVerificationError, a5 as SignedObjectCanonicalizationError, a6 as SignedObjectDigestError, a7 as SignedObjectErrorCode, a8 as SignedObjectIdError, a9 as SignedObjectKind, aa as SignedObjectMaterial, ab as SignedObjectProfileError, ac as SignedObjectSchemaError, ad as SignedObjectSignature, ae as SignedObjectVerificationResult, af as SignedPolicyObject, ag as SigningKeyBindingError, ah as UnifiedContentSource, ai as UnifiedEncryptionCapability, aj as UnifiedKvCapability, ak as UnifiedNativeCapability, al as UnifiedPolicyCapability, am as UnifiedPolicyV1, an as UnifiedPolicyV2, ao as UnifiedResourceSelector, ap as UnsignedPolicy, aq as UnsignedPolicyCredentialPresentationV4, ar as UnsignedPolicyObject, as as UnsignedPolicyStatus, at as UnsignedUnifiedPolicyV2, au as UnsupportedSignatureSuiteError, av as admitPolicyCredentialV3, aw as admitPolicyCredentialV4, ax as buildPolicyCredentialPresentationV3, ay as buildPolicyCredentialPresentationV4, az as canonicalizeSignedObjectUnsigned, aA as canonicalizeUnifiedPolicyCapability, aB as compactAttenuationContains, aC as contentSourceDigestHex, aD as createAndSignPolicy, aE as createAndSignPolicyEngineRecord, aF as createAndSignPolicyStatus, aG as createAndSignSignedObject, aH as createCompactPolicyDescendant, aI as createCompactPolicyInvocation, aJ as deriveSignedObjectMaterial, aK as getPolicyRootStatusV3, aL as issuedCredentialEnvelopeFromVerified, aM as mintPolicySessionV3, aN as normalizeUnifiedPolicyCapability, aO as parseCompactUcanAuthorization, aP as parsePolicySessionUcan, aQ as policyCidFromCanonicalBytes, aR as policyDigestHex, aS as policyIdForDigestHex, aT as policyV2DigestHex, aU as projectUnifiedPolicyCapabilities, aV as projectUnifiedPolicyCapability, aW as registerPolicyV3, aX as renewPolicyRootStatusV3, aY as requestPolicyChallengeV3, aZ as revokePolicyRootV3, a_ as signCompactUcanAuthorization, a$ as signCompactUcanRootAuthorization, b0 as signPolicyCredentialPresentationV4, b1 as signedObjectIdFor, b2 as toSignedObjectError, b3 as unifiedNativeProjectionHashHex, b4 as unifiedPolicyCapabilityContains, b5 as unifiedPolicyCapabilityDigestHex, b6 as unifiedPolicyCapabilityFromNative, b7 as validatePolicyCredentialRequirementV1, b8 as validatePolicyEngineRecordSigned, b9 as validatePolicyEngineRecordSignedShape, ba as validatePolicyEngineRecordUnsigned, bb as validatePolicySigned, bc as validatePolicySignedShape, bd as validatePolicyStatusSigned, be as validatePolicyStatusSignedShape, bf as validatePolicyStatusUnsigned, bg as validatePolicyUnsigned, bh as validateUnifiedPolicyV2, bi as verifyPolicy, bj as verifyPolicyEngineRecord, bk as verifyPolicyRootRevocationV3, bl as verifyPolicyRootStatusCheckpointV3, bm as verifyPolicyStatus, bn as verifySignedObject } from '../credential-admission-DIEPgQ0o.js';
|
|
3
3
|
import { J as JsonObject, P as PolicyCapabilityError } from '../capability-BjzXwtNw.js';
|
|
4
4
|
export { a as JsonValue, b as PolicyCapability, c as PolicyCapabilityErrorCode, d as canonicalizePolicyCapability, j as jcsCanonicalize, n as normalizeJson, e as normalizePolicyCapability, p as policyCapabilityContains, f as policyCapabilityDigestHex, s as serializeJcsJson } from '../capability-BjzXwtNw.js';
|
|
5
5
|
import 'zod';
|
package/dist/policy/index.js
CHANGED
|
@@ -3210,9 +3210,11 @@ var MAX_LEGACY_ENVELOPE_EXPIRES_AT = "2026-12-29T00:00:00Z";
|
|
|
3210
3210
|
var LAST_V2_READ_AT = "2027-01-05T00:00:00Z";
|
|
3211
3211
|
async function requestPolicyChallengeV3(input) {
|
|
3212
3212
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3213
|
-
const
|
|
3213
|
+
const policyRuntimePath = policyRuntimeBasePath(input.policyRuntimePath);
|
|
3214
|
+
const response = await fetchFn(new URL(`${policyRuntimePath}/challenges`, input.nodeOrigin), {
|
|
3214
3215
|
method: "POST",
|
|
3215
3216
|
redirect: "error",
|
|
3217
|
+
signal: input.signal,
|
|
3216
3218
|
headers: { accept: "application/json", "content-type": "application/json" },
|
|
3217
3219
|
body: JSON.stringify({ policyCid: input.policyCid, recipientDid: input.recipientDid, requestedCapabilities: input.requestedCapabilities.map(normalizeUnifiedPolicyCapability) })
|
|
3218
3220
|
});
|
|
@@ -3222,14 +3224,22 @@ async function requestPolicyChallengeV3(input) {
|
|
|
3222
3224
|
throw new Error("policy challenge binding is invalid");
|
|
3223
3225
|
return value;
|
|
3224
3226
|
}
|
|
3227
|
+
function policyRuntimeBasePath(value) {
|
|
3228
|
+
const path = value ?? "/policy/v3";
|
|
3229
|
+
if (!/^\/policy(?:\/[a-z0-9-]+)*$/.test(path)) {
|
|
3230
|
+
throw new Error("policy runtime path is invalid");
|
|
3231
|
+
}
|
|
3232
|
+
return path;
|
|
3233
|
+
}
|
|
3225
3234
|
async function mintPolicySessionV3(input) {
|
|
3226
3235
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3227
3236
|
const challenge = input.challenge ?? await requestPolicyChallengeV3(input);
|
|
3228
3237
|
if (challenge.policyCid !== input.policyCid || challenge.recipientDid !== input.recipientDid)
|
|
3229
3238
|
throw new Error("policy challenge binding is invalid");
|
|
3230
|
-
const response = await fetchFn(new URL("/
|
|
3239
|
+
const response = await fetchFn(new URL("/policy/v3/delegations", input.nodeOrigin), {
|
|
3231
3240
|
method: "POST",
|
|
3232
3241
|
redirect: "error",
|
|
3242
|
+
signal: input.signal,
|
|
3233
3243
|
headers: { accept: "application/json", "content-type": "application/json" },
|
|
3234
3244
|
body: JSON.stringify({ policyCid: input.policyCid, challengeId: challenge.challengeId, nonce: challenge.nonce, claim: input.claim, presentation: input.presentation })
|
|
3235
3245
|
});
|
|
@@ -3288,7 +3298,7 @@ function verifyPolicyRootStatusCheckpointV3(input) {
|
|
|
3288
3298
|
}
|
|
3289
3299
|
async function getPolicyRootStatusV3(input) {
|
|
3290
3300
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3291
|
-
const response = await fetchFn(new URL(`/
|
|
3301
|
+
const response = await fetchFn(new URL(`/policy/v3/status/${encodeURIComponent(input.rootCid)}`, input.nodeOrigin), {
|
|
3292
3302
|
method: "GET",
|
|
3293
3303
|
redirect: "error",
|
|
3294
3304
|
headers: { accept: "application/json" }
|
|
@@ -3347,7 +3357,7 @@ async function renewPolicyRootStatusV3(input) {
|
|
|
3347
3357
|
};
|
|
3348
3358
|
const signature = await input.sign(sha2564(new TextEncoder().encode(ROOT_STATUS_RENEWAL_V1_DOMAIN + jcsCanonicalize(unsigned))));
|
|
3349
3359
|
if (signature.length !== 64) throw new Error("policy root renewal signature must be Ed25519");
|
|
3350
|
-
const response = await fetchFn(new URL("/
|
|
3360
|
+
const response = await fetchFn(new URL("/policy/v3/status", input.nodeOrigin), {
|
|
3351
3361
|
method: "POST",
|
|
3352
3362
|
redirect: "error",
|
|
3353
3363
|
headers: { accept: "application/json", "content-type": "application/json" },
|
|
@@ -3403,6 +3413,11 @@ var POLICY_SESSION_FACT_KEYS = [
|
|
|
3403
3413
|
"issuanceAuditDigestHex",
|
|
3404
3414
|
"remainingRedelegationDepth"
|
|
3405
3415
|
];
|
|
3416
|
+
var POLICY_SESSION_V4_AUDIT_FACT_KEYS = [
|
|
3417
|
+
"credentialIdAuditDigestHex",
|
|
3418
|
+
"presentationJtiAuditDigestHex"
|
|
3419
|
+
];
|
|
3420
|
+
var LOWER_SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
3406
3421
|
var KV_ACTIONS = /* @__PURE__ */ new Set([
|
|
3407
3422
|
"tinycloud.kv/get",
|
|
3408
3423
|
"tinycloud.kv/list",
|
|
@@ -3597,6 +3612,133 @@ function contentSourceDigestHex(input) {
|
|
|
3597
3612
|
)
|
|
3598
3613
|
);
|
|
3599
3614
|
}
|
|
3615
|
+
function exactObject(value, keys, label) {
|
|
3616
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
3617
|
+
throw new Error(`${label} is invalid`);
|
|
3618
|
+
}
|
|
3619
|
+
const record2 = value;
|
|
3620
|
+
if (Object.keys(record2).length !== keys.length || keys.some((key) => !Object.prototype.hasOwnProperty.call(record2, key))) {
|
|
3621
|
+
throw new Error(`${label} is invalid`);
|
|
3622
|
+
}
|
|
3623
|
+
return record2;
|
|
3624
|
+
}
|
|
3625
|
+
function didKeyEd25519PublicKey(value) {
|
|
3626
|
+
const principal = value.split("#", 1)[0];
|
|
3627
|
+
if (!principal.startsWith("did:key:")) {
|
|
3628
|
+
throw new Error("policy enforcer binding signer is invalid");
|
|
3629
|
+
}
|
|
3630
|
+
const material = base58btc.decode(principal.slice("did:key:".length));
|
|
3631
|
+
if (material.length !== 34 || material[0] !== 237 || material[1] !== 1) {
|
|
3632
|
+
throw new Error("policy enforcer binding signer is invalid");
|
|
3633
|
+
}
|
|
3634
|
+
return material.slice(2);
|
|
3635
|
+
}
|
|
3636
|
+
async function registerPolicyV3(input) {
|
|
3637
|
+
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
3638
|
+
const rootExpiresAt = new Date(input.rootExpiresAt);
|
|
3639
|
+
const canonicalRootExpiresAt = new Date(
|
|
3640
|
+
Math.floor(rootExpiresAt.getTime() / 1e3) * 1e3
|
|
3641
|
+
).toISOString().replace(/\.000Z$/, "Z");
|
|
3642
|
+
if (!Number.isFinite(rootExpiresAt.getTime()) || canonicalRootExpiresAt !== input.rootExpiresAt || rootExpiresAt.getTime() <= Date.now()) {
|
|
3643
|
+
throw new Error("policy root expiry is invalid");
|
|
3644
|
+
}
|
|
3645
|
+
const bindingResponse = await fetchFn(
|
|
3646
|
+
new URL("/policy/v3/enforcer-bindings", input.nodeOrigin),
|
|
3647
|
+
{
|
|
3648
|
+
method: "POST",
|
|
3649
|
+
redirect: "error",
|
|
3650
|
+
signal: input.signal,
|
|
3651
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
3652
|
+
body: JSON.stringify({
|
|
3653
|
+
rootExpiresAt: input.rootExpiresAt,
|
|
3654
|
+
enforcerDid: input.enforcerDid
|
|
3655
|
+
})
|
|
3656
|
+
}
|
|
3657
|
+
);
|
|
3658
|
+
if (!bindingResponse.ok) {
|
|
3659
|
+
throw new Error(`policy enforcer binding rejected (${bindingResponse.status})`);
|
|
3660
|
+
}
|
|
3661
|
+
const binding = exactObject(
|
|
3662
|
+
await bindingResponse.json(),
|
|
3663
|
+
[
|
|
3664
|
+
"schema",
|
|
3665
|
+
"enforcerDid",
|
|
3666
|
+
"nodeAudience",
|
|
3667
|
+
"attestationBindingDigestHex",
|
|
3668
|
+
"issuedAt",
|
|
3669
|
+
"expiresAt",
|
|
3670
|
+
"signature"
|
|
3671
|
+
],
|
|
3672
|
+
"policy enforcer binding"
|
|
3673
|
+
);
|
|
3674
|
+
const signature = exactObject(
|
|
3675
|
+
binding.signature,
|
|
3676
|
+
["suite", "signerDid", "value"],
|
|
3677
|
+
"policy enforcer binding signature"
|
|
3678
|
+
);
|
|
3679
|
+
const expectedBindingDigestHex = hex(
|
|
3680
|
+
sha2564(
|
|
3681
|
+
new TextEncoder().encode(
|
|
3682
|
+
jcsCanonicalize({
|
|
3683
|
+
enforcerDid: input.enforcerDid,
|
|
3684
|
+
nodeAudience: input.expectedNodeAudience
|
|
3685
|
+
})
|
|
3686
|
+
)
|
|
3687
|
+
)
|
|
3688
|
+
);
|
|
3689
|
+
if (binding.schema !== ATTESTED_ENFORCER_BINDING_V2_SCHEMA || binding.enforcerDid !== input.enforcerDid || binding.nodeAudience !== input.expectedNodeAudience || binding.attestationBindingDigestHex !== expectedBindingDigestHex || binding.expiresAt !== input.rootExpiresAt || typeof binding.issuedAt !== "string" || Date.parse(binding.issuedAt) > Date.now() || signature.suite !== "Ed25519" || signature.signerDid !== input.expectedNodeAudience || typeof signature.value !== "string") {
|
|
3690
|
+
throw new Error("policy enforcer binding is invalid");
|
|
3691
|
+
}
|
|
3692
|
+
const { signature: _signature, ...unsignedBinding } = binding;
|
|
3693
|
+
const signedBinding = sha2564(
|
|
3694
|
+
new TextEncoder().encode(
|
|
3695
|
+
`xyz.tinycloud.policy/AttestedEnforcerBinding/v2\0${jcsCanonicalize(unsignedBinding)}`
|
|
3696
|
+
)
|
|
3697
|
+
);
|
|
3698
|
+
if (!ed255192.verify(
|
|
3699
|
+
decodeBase64Url(signature.value),
|
|
3700
|
+
signedBinding,
|
|
3701
|
+
didKeyEd25519PublicKey(input.expectedNodeAudience),
|
|
3702
|
+
{ zip215: false }
|
|
3703
|
+
)) {
|
|
3704
|
+
throw new Error("policy enforcer binding signature is invalid");
|
|
3705
|
+
}
|
|
3706
|
+
const response = await fetchFn(
|
|
3707
|
+
new URL("/policy/v3/policies", input.nodeOrigin),
|
|
3708
|
+
{
|
|
3709
|
+
method: "POST",
|
|
3710
|
+
redirect: "error",
|
|
3711
|
+
signal: input.signal,
|
|
3712
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
3713
|
+
body: JSON.stringify({
|
|
3714
|
+
policyCid: input.policyCid,
|
|
3715
|
+
policy: input.policy,
|
|
3716
|
+
policyRoot: input.policyRoot.authorization.replace(/^Bearer\s+/i, ""),
|
|
3717
|
+
enforcementRoot: input.enforcementRoot.authorization.replace(/^Bearer\s+/i, ""),
|
|
3718
|
+
contentSourceDigestHex: input.contentSourceDigestHex,
|
|
3719
|
+
nativeProjectionHashHex: input.nativeProjectionHashHex,
|
|
3720
|
+
attestedEnforcerBinding: binding
|
|
3721
|
+
})
|
|
3722
|
+
}
|
|
3723
|
+
);
|
|
3724
|
+
if (!response.ok) {
|
|
3725
|
+
throw new Error(`policy registration rejected (${response.status})`);
|
|
3726
|
+
}
|
|
3727
|
+
const receipt = exactObject(
|
|
3728
|
+
await response.json(),
|
|
3729
|
+
["policyCid", "policyRootCid", "enforcementRootCid"],
|
|
3730
|
+
"policy registration response"
|
|
3731
|
+
);
|
|
3732
|
+
if (receipt.policyCid !== input.policyCid || receipt.policyRootCid !== input.policyRoot.cid || receipt.enforcementRootCid !== input.enforcementRoot.cid) {
|
|
3733
|
+
throw new Error("policy registration response binding is invalid");
|
|
3734
|
+
}
|
|
3735
|
+
return {
|
|
3736
|
+
policyCid: input.policyCid,
|
|
3737
|
+
policyRootCid: input.policyRoot.cid,
|
|
3738
|
+
enforcementRootCid: input.enforcementRoot.cid,
|
|
3739
|
+
attestedEnforcerBinding: binding
|
|
3740
|
+
};
|
|
3741
|
+
}
|
|
3600
3742
|
function policyDigestHex(policy) {
|
|
3601
3743
|
const canonicalPolicy = {
|
|
3602
3744
|
...policy,
|
|
@@ -3795,9 +3937,13 @@ function parsePolicySessionUcan(authorization, expectedProofs) {
|
|
|
3795
3937
|
if (expectedProofs !== void 0 && (parsed.payload.prf[0] !== expectedProofs[0] || parsed.payload.prf[1] !== expectedProofs[1]))
|
|
3796
3938
|
throw new Error("policy session UCAN ordered proofs do not match");
|
|
3797
3939
|
const factKeys = Object.keys(fact);
|
|
3798
|
-
|
|
3940
|
+
const hasLegacyFactShape = factKeys.length === POLICY_SESSION_FACT_KEYS.length && factKeys.every((key) => POLICY_SESSION_FACT_KEYS.includes(key)) && POLICY_SESSION_FACT_KEYS.every((key) => key in fact);
|
|
3941
|
+
const hasV4AuditFactShape = factKeys.length === POLICY_SESSION_FACT_KEYS.length + POLICY_SESSION_V4_AUDIT_FACT_KEYS.length && factKeys.every((key) => POLICY_SESSION_FACT_KEYS.includes(key) || POLICY_SESSION_V4_AUDIT_FACT_KEYS.includes(key)) && POLICY_SESSION_FACT_KEYS.every((key) => key in fact) && POLICY_SESSION_V4_AUDIT_FACT_KEYS.every((key) => key in fact);
|
|
3942
|
+
if (!hasLegacyFactShape && !hasV4AuditFactShape)
|
|
3799
3943
|
throw new Error("policy session UCAN fact is incomplete");
|
|
3800
|
-
if (
|
|
3944
|
+
if (hasV4AuditFactShape && (!LOWER_SHA256_HEX.test(fact.credentialIdAuditDigestHex) || !LOWER_SHA256_HEX.test(fact.presentationJtiAuditDigestHex)))
|
|
3945
|
+
throw new Error("policy session UCAN v4 audit facts are invalid");
|
|
3946
|
+
if (fact.profile !== POLICY_SESSION_UCAN_V1_PROFILE || typeof fact.remainingRedelegationDepth !== "number" || !Number.isInteger(fact.remainingRedelegationDepth) || fact.remainingRedelegationDepth < 0 || fact.remainingRedelegationDepth > 8 || parsed.payload.exp - parsed.payload.nbf > 60 || parsed.payload.iss.split("#", 1)[0] !== fact.nodeAudience || parsed.payload.aud !== fact.recipientDid)
|
|
3801
3947
|
throw new Error("policy session UCAN fact is invalid");
|
|
3802
3948
|
return {
|
|
3803
3949
|
authorization,
|
|
@@ -3925,6 +4071,8 @@ var POLICY_V2_DOMAIN = "xyz.tinycloud.policy/policy/v2\0";
|
|
|
3925
4071
|
var POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE = "TinyCloudPolicyCredentialRequirement";
|
|
3926
4072
|
var POLICY_PRESENTATION_V3_SCHEMA = "xyz.tinycloud.policy/presentation/v3";
|
|
3927
4073
|
var POLICY_PRESENTATION_V3_DOMAIN = "xyz.tinycloud.policy/Presentation/v3\0";
|
|
4074
|
+
var POLICY_PRESENTATION_V4_SCHEMA = "xyz.tinycloud.policy/presentation/v4";
|
|
4075
|
+
var POLICY_PRESENTATION_V4_DOMAIN = "xyz.tinycloud.policy/Presentation/v4\0";
|
|
3928
4076
|
function record(value, label) {
|
|
3929
4077
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
3930
4078
|
throw new Error(`${label} must be an object`);
|
|
@@ -4099,6 +4247,97 @@ function envelopeFromVerified(verified) {
|
|
|
4099
4247
|
} = verified;
|
|
4100
4248
|
return envelope;
|
|
4101
4249
|
}
|
|
4250
|
+
function issuedCredentialEnvelopeFromVerified(verified) {
|
|
4251
|
+
return envelopeFromVerified(verified);
|
|
4252
|
+
}
|
|
4253
|
+
async function signPolicyCredentialPresentationV4(value, sign) {
|
|
4254
|
+
const item = record(value, "Policy presentation v4");
|
|
4255
|
+
exactKeys2(item, [
|
|
4256
|
+
"schema",
|
|
4257
|
+
"jti",
|
|
4258
|
+
"challengeId",
|
|
4259
|
+
"nonce",
|
|
4260
|
+
"policyCid",
|
|
4261
|
+
"nodeAudience",
|
|
4262
|
+
"holderDid",
|
|
4263
|
+
"subjectDid",
|
|
4264
|
+
"credentialDigest",
|
|
4265
|
+
"requirementDigest",
|
|
4266
|
+
"descriptorDigest",
|
|
4267
|
+
"requestedCapabilities",
|
|
4268
|
+
"issuedAt",
|
|
4269
|
+
"expiresAt"
|
|
4270
|
+
], "Policy presentation v4");
|
|
4271
|
+
if (item.schema !== POLICY_PRESENTATION_V4_SCHEMA || item.holderDid !== item.subjectDid || !Array.isArray(item.requestedCapabilities)) throw new Error("Policy presentation v4 is invalid");
|
|
4272
|
+
const holderDid = nonEmpty(item.holderDid, "Policy presentation v4 holder DID");
|
|
4273
|
+
didKeyBytes(holderDid);
|
|
4274
|
+
const unsigned = Object.freeze({
|
|
4275
|
+
schema: POLICY_PRESENTATION_V4_SCHEMA,
|
|
4276
|
+
jti: nonEmpty(item.jti, "Policy presentation v4 jti"),
|
|
4277
|
+
challengeId: nonEmpty(item.challengeId, "Policy presentation v4 challenge"),
|
|
4278
|
+
nonce: nonEmpty(item.nonce, "Policy presentation v4 nonce"),
|
|
4279
|
+
policyCid: nonEmpty(item.policyCid, "Policy presentation v4 policy CID"),
|
|
4280
|
+
nodeAudience: nonEmpty(item.nodeAudience, "Policy presentation v4 audience"),
|
|
4281
|
+
holderDid,
|
|
4282
|
+
subjectDid: holderDid,
|
|
4283
|
+
credentialDigest: nonEmpty(item.credentialDigest, "Policy presentation v4 credential digest"),
|
|
4284
|
+
requirementDigest: nonEmpty(item.requirementDigest, "Policy presentation v4 requirement digest"),
|
|
4285
|
+
descriptorDigest: nonEmpty(item.descriptorDigest, "Policy presentation v4 descriptor digest"),
|
|
4286
|
+
// The low-level signer preserves the frozen wire bytes exactly. The
|
|
4287
|
+
// policy-aware builder performs capability normalization and containment.
|
|
4288
|
+
requestedCapabilities: Object.freeze(item.requestedCapabilities),
|
|
4289
|
+
issuedAt: date(item.issuedAt, "Policy presentation v4 issuedAt"),
|
|
4290
|
+
expiresAt: date(item.expiresAt, "Policy presentation v4 expiresAt")
|
|
4291
|
+
});
|
|
4292
|
+
const digest2 = sha2565(new TextEncoder().encode(
|
|
4293
|
+
POLICY_PRESENTATION_V4_DOMAIN + jcsCanonicalize(unsigned)
|
|
4294
|
+
));
|
|
4295
|
+
const signature = await sign(digest2);
|
|
4296
|
+
if (signature.length !== 64 || !ed255193.verify(signature, digest2, didKeyBytes(holderDid))) throw new Error("policy presentation signature is invalid");
|
|
4297
|
+
return Object.freeze({
|
|
4298
|
+
...unsigned,
|
|
4299
|
+
signature: Object.freeze({
|
|
4300
|
+
suite: "Ed25519",
|
|
4301
|
+
signerDid: holderDid,
|
|
4302
|
+
value: encodeBase64Url2(signature)
|
|
4303
|
+
})
|
|
4304
|
+
});
|
|
4305
|
+
}
|
|
4306
|
+
async function buildPolicyCredentialPresentationV4(input) {
|
|
4307
|
+
const policy = validateUnifiedPolicyV2(input.policy, input.policyCid);
|
|
4308
|
+
const requirement = validateCredentialRequirement(input.requirement);
|
|
4309
|
+
const commitment = policy.credentialRequirement;
|
|
4310
|
+
const requirementDigest = await credentialRequirementDigest(requirement);
|
|
4311
|
+
const credentialDigest = await sha256Base64Url(input.credential.credential);
|
|
4312
|
+
if (requirementDigest !== commitment.requirementDigest || input.credential.descriptorDigest !== commitment.descriptorDigest || input.credential.credentialDigest !== credentialDigest || input.credential.issuerDid !== commitment.issuerDid || input.credential.issuerKid !== commitment.issuerKid || jcsCanonicalize(input.credential.profile) !== jcsCanonicalize(commitment.profile) || jcsCanonicalize(input.credential.credentialType) !== jcsCanonicalize(commitment.credentialType)) throw new Error("credential does not match the signed Policy/v2 requirement");
|
|
4313
|
+
const requestedCapabilities = input.requestedCapabilities.map(normalizeUnifiedPolicyCapability);
|
|
4314
|
+
if (requestedCapabilities.length === 0 || requestedCapabilities.some((requested) => !policy.capabilityCeiling.some((authority) => unifiedPolicyCapabilityContains(authority, requested)))) throw new Error("requested capabilities exceed the signed Policy/v2 ceiling");
|
|
4315
|
+
const holderDid = input.credential.holderDid;
|
|
4316
|
+
if (input.challenge.policyCid !== input.policyCid || input.challenge.recipientDid !== holderDid || input.credential.subjectDid !== holderDid || typeof input.challenge.nodeAudience !== "string" || input.challenge.nodeAudience.length === 0 || typeof input.challenge.expiresAt !== "string" || !Number.isFinite(Date.parse(input.challenge.expiresAt))) throw new Error("policy challenge binding is invalid");
|
|
4317
|
+
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
4318
|
+
const expiresAtMs = Math.min(
|
|
4319
|
+
now.getTime() + 6e4,
|
|
4320
|
+
Date.parse(input.challenge.expiresAt),
|
|
4321
|
+
Date.parse(input.credential.expiresAt)
|
|
4322
|
+
);
|
|
4323
|
+
if (expiresAtMs <= now.getTime()) throw new Error("policy challenge is expired");
|
|
4324
|
+
return signPolicyCredentialPresentationV4(Object.freeze({
|
|
4325
|
+
schema: POLICY_PRESENTATION_V4_SCHEMA,
|
|
4326
|
+
jti: input.jti ?? encodeBase64Url2(crypto.getRandomValues(new Uint8Array(16))),
|
|
4327
|
+
challengeId: input.challenge.challengeId,
|
|
4328
|
+
nonce: input.challenge.nonce,
|
|
4329
|
+
policyCid: input.policyCid,
|
|
4330
|
+
nodeAudience: input.challenge.nodeAudience,
|
|
4331
|
+
holderDid,
|
|
4332
|
+
subjectDid: holderDid,
|
|
4333
|
+
credentialDigest,
|
|
4334
|
+
requirementDigest,
|
|
4335
|
+
descriptorDigest: input.credential.descriptorDigest,
|
|
4336
|
+
requestedCapabilities: Object.freeze(requestedCapabilities),
|
|
4337
|
+
issuedAt: rfc3339Seconds(now),
|
|
4338
|
+
expiresAt: rfc3339Seconds(new Date(expiresAtMs))
|
|
4339
|
+
}), input.sign);
|
|
4340
|
+
}
|
|
4102
4341
|
async function buildPolicyCredentialPresentationV3(input) {
|
|
4103
4342
|
const policy = validateUnifiedPolicyV2(input.policy, input.policyCid);
|
|
4104
4343
|
const requirement = validateCredentialRequirement(input.requirement);
|
|
@@ -4185,10 +4424,12 @@ async function admitPolicyCredentialV3(input) {
|
|
|
4185
4424
|
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
4186
4425
|
const challenge = await requestPolicyChallengeV3({
|
|
4187
4426
|
nodeOrigin,
|
|
4427
|
+
policyRuntimePath: input.policyRuntimePath,
|
|
4188
4428
|
policyCid: input.policyCid,
|
|
4189
4429
|
recipientDid: input.credential.holderDid,
|
|
4190
4430
|
requestedCapabilities: input.requestedCapabilities,
|
|
4191
|
-
fetch: fetchFn
|
|
4431
|
+
fetch: fetchFn,
|
|
4432
|
+
signal: input.signal
|
|
4192
4433
|
});
|
|
4193
4434
|
const presentation = await buildPolicyCredentialPresentationV3({
|
|
4194
4435
|
...input,
|
|
@@ -4196,10 +4437,11 @@ async function admitPolicyCredentialV3(input) {
|
|
|
4196
4437
|
challenge
|
|
4197
4438
|
});
|
|
4198
4439
|
const response = await fetchFn(
|
|
4199
|
-
new URL(
|
|
4440
|
+
new URL(`${policyRuntimeBasePath2(input.policyRuntimePath)}/delegations`, nodeOrigin),
|
|
4200
4441
|
{
|
|
4201
4442
|
method: "POST",
|
|
4202
4443
|
redirect: "error",
|
|
4444
|
+
signal: input.signal,
|
|
4203
4445
|
headers: { accept: "application/json", "content-type": "application/json" },
|
|
4204
4446
|
body: JSON.stringify({
|
|
4205
4447
|
policyCid: input.policyCid,
|
|
@@ -4228,8 +4470,74 @@ async function admitPolicyCredentialV3(input) {
|
|
|
4228
4470
|
if (session.cid !== value.sessionCid || session.aud !== input.credential.holderDid || session.fact.policyCid !== input.policyCid || session.fact.recipientDid !== input.credential.holderDid || session.fact.policyDelegationCid !== input.policyRootCid || session.fact.enforcementDelegationCid !== input.enforcementRootCid || jcsCanonicalize(session.att) !== jcsCanonicalize(expectedAttenuation)) {
|
|
4229
4471
|
throw new Error("policy delegation signed binding is invalid");
|
|
4230
4472
|
}
|
|
4473
|
+
input.signal?.throwIfAborted();
|
|
4231
4474
|
return Object.freeze({ challenge, presentation, session });
|
|
4232
4475
|
}
|
|
4476
|
+
function validatePolicyCredentialAdmissionV4Authority(session, expected) {
|
|
4477
|
+
if (session.iss.split("#", 1)[0] !== expected.nodeAudience || session.fact.nodeAudience !== expected.nodeAudience || session.fact.enforcerDid !== expected.enforcerDid) throw new Error("policy delegation authority binding is invalid");
|
|
4478
|
+
}
|
|
4479
|
+
async function admitPolicyCredentialV4(input) {
|
|
4480
|
+
const policy = validateUnifiedPolicyV2(input.policy, input.policyCid);
|
|
4481
|
+
const nodeOrigin = policyNodeOrigin(input.nodeOrigin);
|
|
4482
|
+
const fetchFn = input.fetch ?? globalThis.fetch.bind(globalThis);
|
|
4483
|
+
const challenge = await requestPolicyChallengeV3({
|
|
4484
|
+
nodeOrigin,
|
|
4485
|
+
policyRuntimePath: input.policyRuntimePath,
|
|
4486
|
+
policyCid: input.policyCid,
|
|
4487
|
+
recipientDid: input.credential.holderDid,
|
|
4488
|
+
requestedCapabilities: input.requestedCapabilities,
|
|
4489
|
+
fetch: fetchFn,
|
|
4490
|
+
signal: input.signal
|
|
4491
|
+
});
|
|
4492
|
+
const presentation = await buildPolicyCredentialPresentationV4({
|
|
4493
|
+
...input,
|
|
4494
|
+
policy,
|
|
4495
|
+
challenge
|
|
4496
|
+
});
|
|
4497
|
+
const response = await fetchFn(new URL(`${policyRuntimeBasePath2(input.policyRuntimePath)}/delegations`, nodeOrigin), {
|
|
4498
|
+
method: "POST",
|
|
4499
|
+
redirect: "error",
|
|
4500
|
+
signal: input.signal,
|
|
4501
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
4502
|
+
body: JSON.stringify({
|
|
4503
|
+
policyCid: input.policyCid,
|
|
4504
|
+
challengeId: challenge.challengeId,
|
|
4505
|
+
nonce: challenge.nonce,
|
|
4506
|
+
requirement: validateCredentialRequirement(input.requirement),
|
|
4507
|
+
credential: envelopeFromVerified(input.credential),
|
|
4508
|
+
presentation
|
|
4509
|
+
})
|
|
4510
|
+
});
|
|
4511
|
+
if (!response.ok) throw new Error(`policy delegation rejected (${response.status})`);
|
|
4512
|
+
const value = record(await response.json(), "policy delegation");
|
|
4513
|
+
if (value.admitted !== true || typeof value.sessionCid !== "string" || typeof value.authorization !== "string") throw new Error("policy delegation response is invalid");
|
|
4514
|
+
const session = parsePolicySessionUcan(value.authorization, [
|
|
4515
|
+
input.policyRootCid,
|
|
4516
|
+
input.enforcementRootCid
|
|
4517
|
+
]);
|
|
4518
|
+
const expectedAttenuation = compactAttenuationForPolicyCapabilities(input.requestedCapabilities);
|
|
4519
|
+
validatePolicyCredentialAdmissionV4Authority(session, {
|
|
4520
|
+
nodeAudience: input.expectedNodeAudience,
|
|
4521
|
+
enforcerDid: input.expectedEnforcerDid
|
|
4522
|
+
});
|
|
4523
|
+
if (session.cid !== value.sessionCid || session.aud !== input.credential.holderDid || session.fact.policyCid !== input.policyCid || session.fact.recipientDid !== input.credential.holderDid || session.fact.policyDelegationCid !== input.policyRootCid || session.fact.enforcementDelegationCid !== input.enforcementRootCid || jcsCanonicalize(session.att) !== jcsCanonicalize(expectedAttenuation)) throw new Error("policy delegation signed binding is invalid");
|
|
4524
|
+
const importResponse = await fetchFn(new URL("/delegate", nodeOrigin), {
|
|
4525
|
+
method: "POST",
|
|
4526
|
+
redirect: "error",
|
|
4527
|
+
signal: input.signal,
|
|
4528
|
+
headers: { Authorization: session.authorization }
|
|
4529
|
+
});
|
|
4530
|
+
if (!importResponse.ok) throw new Error(`delegation import rejected (${importResponse.status})`);
|
|
4531
|
+
input.signal?.throwIfAborted();
|
|
4532
|
+
return Object.freeze({ challenge, presentation, session, delegationImported: true });
|
|
4533
|
+
}
|
|
4534
|
+
function policyRuntimeBasePath2(value) {
|
|
4535
|
+
const path = value ?? "/policy/v3";
|
|
4536
|
+
if (!/^\/policy(?:\/[a-z0-9-]+)*$/.test(path)) {
|
|
4537
|
+
throw new Error("policy runtime path is invalid");
|
|
4538
|
+
}
|
|
4539
|
+
return path;
|
|
4540
|
+
}
|
|
4233
4541
|
export {
|
|
4234
4542
|
ATTESTED_ENFORCER_BINDING_V2_SCHEMA,
|
|
4235
4543
|
CONTENT_SOURCE_V1_DOMAIN,
|
|
@@ -4247,6 +4555,8 @@ export {
|
|
|
4247
4555
|
POLICY_ENGINE_RECORD_SCHEMA,
|
|
4248
4556
|
POLICY_PRESENTATION_V3_DOMAIN,
|
|
4249
4557
|
POLICY_PRESENTATION_V3_SCHEMA,
|
|
4558
|
+
POLICY_PRESENTATION_V4_DOMAIN,
|
|
4559
|
+
POLICY_PRESENTATION_V4_SCHEMA,
|
|
4250
4560
|
POLICY_SCHEMA,
|
|
4251
4561
|
POLICY_SESSION_UCAN_V1_PROFILE,
|
|
4252
4562
|
POLICY_STATUS_SCHEMA,
|
|
@@ -4274,7 +4584,9 @@ export {
|
|
|
4274
4584
|
UnsupportedSignatureSuiteError,
|
|
4275
4585
|
W3C_VC_CREDENTIAL_VERIFIER,
|
|
4276
4586
|
admitPolicyCredentialV3,
|
|
4587
|
+
admitPolicyCredentialV4,
|
|
4277
4588
|
buildPolicyCredentialPresentationV3,
|
|
4589
|
+
buildPolicyCredentialPresentationV4,
|
|
4278
4590
|
canonicalizePolicyCapability,
|
|
4279
4591
|
canonicalizeSignedObjectUnsigned,
|
|
4280
4592
|
canonicalizeUnifiedPolicyCapability,
|
|
@@ -4292,6 +4604,7 @@ export {
|
|
|
4292
4604
|
createUnsignedPolicyEngineRecord,
|
|
4293
4605
|
deriveSignedObjectMaterial,
|
|
4294
4606
|
getPolicyRootStatusV3,
|
|
4607
|
+
issuedCredentialEnvelopeFromVerified,
|
|
4295
4608
|
jcsCanonicalize,
|
|
4296
4609
|
mintPolicySessionV3,
|
|
4297
4610
|
normalizeJson,
|
|
@@ -4307,12 +4620,14 @@ export {
|
|
|
4307
4620
|
policyV2DigestHex,
|
|
4308
4621
|
projectUnifiedPolicyCapabilities,
|
|
4309
4622
|
projectUnifiedPolicyCapability,
|
|
4623
|
+
registerPolicyV3,
|
|
4310
4624
|
renewPolicyRootStatusV3,
|
|
4311
4625
|
requestPolicyChallengeV3,
|
|
4312
4626
|
revokePolicyRootV3,
|
|
4313
4627
|
serialize as serializeJcsJson,
|
|
4314
4628
|
signCompactUcanAuthorization,
|
|
4315
4629
|
signCompactUcanRootAuthorization,
|
|
4630
|
+
signPolicyCredentialPresentationV4,
|
|
4316
4631
|
signedObjectIdFor,
|
|
4317
4632
|
toSignedObjectError,
|
|
4318
4633
|
unifiedNativeProjectionHashHex,
|