@orangecheck/agent-core 2.7.0 → 2.7.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/dist/index.mjs CHANGED
@@ -800,11 +800,11 @@ async function verifyRevocation(input) {
800
800
  if (env.delegation_id !== d.id) {
801
801
  return err("E_DELEGATION_MISMATCH", `revocation.delegation_id (${env.delegation_id}) != delegation.id (${d.id})`);
802
802
  }
803
- const holders = d.revocation?.holders ?? ["principal"];
804
- const holderAddrs = /* @__PURE__ */ new Set([d.principal.address]);
805
- if (Array.isArray(holders) && holders.includes("agent")) holderAddrs.add(d.agent.address);
806
- if (!holderAddrs.has(env.signer.address)) {
807
- return err("E_REVOKER_UNAUTHORIZED", `revocation signer ${env.signer.address} not in delegation holders`);
803
+ if (env.signer.address !== d.principal.address && env.signer.address !== d.agent.address) {
804
+ return err(
805
+ "E_REVOKER_UNAUTHORIZED",
806
+ `revocation signer ${env.signer.address} is neither the principal nor the agent`
807
+ );
808
808
  }
809
809
  const canonInput = {
810
810
  address: env.signer.address,
@@ -1187,10 +1187,6 @@ async function verifyRevocationOf(d, rev, input) {
1187
1187
  });
1188
1188
  }
1189
1189
  const v1 = rev;
1190
- const holders = d.revocation?.holders ?? ["principal"];
1191
- if (!Array.isArray(holders) || !holders.includes("agent")) {
1192
- return fail("E_REVOKER_UNAUTHORIZED", "only the federation may revoke this delegation");
1193
- }
1194
1190
  if (v1.kind !== "agent-revocation" || v1.signer?.address !== d.agent.address) {
1195
1191
  return fail("E_REVOKER_UNAUTHORIZED", "a single-address revocation must be signed by the agent");
1196
1192
  }