aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

Requested predicates are ignored when resolving matching credentials for a presentation request

Open etschelp opened this issue 1 year ago • 0 comments

Version: 0.7.4 Endpoint: GET present-proof/records/{pres_ex_id}/credentials exchange version 1 and 2 Wallet-Type: askar only

Given I have a very simple schema with a single attribute called number, and I have three credentials in my wallet with values: 1, 3, 6. and I receive the following presentation request:

    "presentation_request": {
        "nonce": "262805305178458819661878",
        "name": "Some Number < 5",
        "version": "1.0",
        "requested_attributes": {},
        "requested_predicates": {
            "give-me-some-number-less-than": {
                "name": "number",
                "p_value": 5,
                "p_type": "<",
                "restrictions": [
                    {
                        "schema_id": "M6Mbe3qx7vB4wpZF4sBRjt:2:some-number:1.0"
                    }
                ]
            }
        }
    }

present-proof/records/{pres_ex_id}/credentials will return the following matches: 1, 3, 6

Expected result: 1, 3

I have tested this with other conditions as well, and it seems like predicates are simply ignored and what is returned are all wallet items that match the schema. Sending the presentation with a wrong value will fail though with a predicate does not match exception.

etschelp avatar Jul 18 '22 09:07 etschelp