@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/README.md +1 -1
- package/dist/index.js +5 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/federation.test.ts +3 -3
- package/src/federation.ts +3 -8
- package/src/revocation-authority.test.ts +17 -15
- package/src/verify.ts +8 -7
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
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
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
|
}
|