From b63f49c95aa6ea044ed6cde45e68cd798f06a55a Mon Sep 17 00:00:00 2001 From: bengo <171782+gobengo@users.noreply.github.com> Date: Wed, 1 Nov 2023 14:41:37 -0700 Subject: [PATCH] rm unused fn --- packages/access-client/src/agent-data.js | 36 ------------------------ 1 file changed, 36 deletions(-) diff --git a/packages/access-client/src/agent-data.js b/packages/access-client/src/agent-data.js index 40a3ee011..63b4d924f 100644 --- a/packages/access-client/src/agent-data.js +++ b/packages/access-client/src/agent-data.js @@ -199,39 +199,3 @@ export function getSessionProofs(data) { } return proofs } - -/** - * Given a UCAN, return whether it is a session proof matching some options - * - * @param {Ucanto.Delegation} ucan - * @param {object} options - * @param {Ucanto.DID} [options.issuer] - issuer of session proof - * @param {import('@ucanto/interface').UCANLink} [options.attestedProof] - CID of proof that the session proof attests to - * @param {boolean} [options.allowExpired] - * @returns {boolean} whether the ucan matches the options - */ -export function matchSessionProof(ucan, options) { - if (!isSessionProof(ucan)) { - return false - } - const cap = ucan.capabilities[0] - const matchesRequiredIssuer = - options.issuer === undefined || options.issuer === ucan.issuer.did() - const isExpiredButNotAllowed = !options.allowExpired && isExpired(ucan) - const matchesRequiredProof = - !options.attestedProof || - options.attestedProof.toString() === cap.nb.proof.toString() - if (!isSessionProof(ucan)) { - return false - } - if (isExpiredButNotAllowed) { - return false - } - if (!matchesRequiredIssuer) { - return false - } - if (!matchesRequiredProof) { - return false - } - return true -}