diff --git a/aries_cloudagent/verifier/indy.py b/aries_cloudagent/verifier/indy.py index 1f58971b18..20bc506eb1 100644 --- a/aries_cloudagent/verifier/indy.py +++ b/aries_cloudagent/verifier/indy.py @@ -36,7 +36,7 @@ def __init__(self, ledger: BaseLedger): """ self.ledger = ledger - def non_revoc_intervals(self, pres_req: dict, pres: dict, pop_global: bool): + def non_revoc_intervals(self, pres_req: dict, pres: dict): """ Remove superfluous non-revocation intervals in presentation request. @@ -46,7 +46,6 @@ def non_revoc_intervals(self, pres_req: dict, pres: dict, pop_global: bool): Args: pres_req: presentation request pres: corresponding presentation - pop_global: whether to excise global non-revocation interval if present """ @@ -72,15 +71,15 @@ def non_revoc_intervals(self, pres_req: dict, pres: dict, pop_global: bool): uuid, ) - if pop_global: - if pres_req.pop("non_revoked", None): - LOGGER.warning( - ( - "Amended presentation request (nonce=%s); removed global " - "non-revocation interval; no revocable credentials in proof" - ), - pres_req["nonce"], - ) + if all(spec.get("timestamp") is None for spec in pres["identifiers"]): + pres_req.pop("non_revoked", None) + LOGGER.warning( + ( + "Amended presentation request (nonce=%s); removed global " + "non-revocation interval; no revocable credentials in proof" + ), + pres_req["nonce"], + ) async def pre_verify(self, pres_req: dict, pres: dict) -> (PreVerifyResult, str): """ @@ -239,8 +238,7 @@ async def verify_presentation( rev_reg_entries: revocation registry entries """ - print(f"\n\n## Verifying, input: {json.dumps(presentation)}") - self.non_revoc_intervals(presentation_request, presentation, not rev_reg_defs) + self.non_revoc_intervals(presentation_request, presentation) (pv_result, pv_msg) = await self.pre_verify(presentation_request, presentation) if pv_result != PreVerifyResult.OK: diff --git a/aries_cloudagent/verifier/tests/test_indy.py b/aries_cloudagent/verifier/tests/test_indy.py index 0d89e50b7b..c474ca8799 100644 --- a/aries_cloudagent/verifier/tests/test_indy.py +++ b/aries_cloudagent/verifier/tests/test_indy.py @@ -481,7 +481,7 @@ async def test_non_revoc_intervals(self, mock_verify): ], } - self.verifier.non_revoc_intervals(big_pres_req, big_pres, True) + self.verifier.non_revoc_intervals(big_pres_req, big_pres) assert "non_revoked" not in big_pres_req for spec in big_pres_req["requested_attributes"].values():