didx-xyz / aries-cloudapi-python

Apache License 2.0
12 stars 8 forks source link

Match proof with credentials endpoint only returns 10 credentials #991

Closed wdbasson closed 2 weeks ago

wdbasson commented 3 weeks ago

/tenant/v1/verifier/proofs/{{proofId}}/credentials

Only returns 10 credentials and is not currently configurable.

cl0ete commented 3 weeks ago
    @classmethod
    async def get_credentials_by_proof_id(
        cls, controller: AcaPyClient, proof_id: str
    ) -> List[IndyCredPrecis]:
        bound_logger = logger.bind(body={"proof_id": proof_id})
        pres_ex_id = pres_id_no_version(proof_id=proof_id)

        try:
            bound_logger.debug("Getting v2 matching credentials from proof id")
            result = await handle_acapy_call(
                logger=bound_logger,
                acapy_call=controller.present_proof_v2_0.get_matching_credentials,
                pres_ex_id=pres_ex_id,
            )
        except CloudApiException as e:
            raise CloudApiException(
                f"Failed to get credentials with proof id `{proof_id}`: {e.detail}",
                e.status_code,
            ) from e

        if result:
            bound_logger.debug("Successfully got matching v2 credentials.")
        else:
            bound_logger.debug("No matching v2 credentials obtained.")
        return result

The get_matching_credentials function can take a count , extra_query, referent and start. We need to add these