bcgov / TheOrgBook

A public repository of verifiable claims about organizations. A key component of the Verifiable Organization Network.
http://von.pathfinder.gov.bc.ca
Apache License 2.0
78 stars 66 forks source link

Liquor License Fails / Proof requests don't work as expected when there are multiple credentials of the same type #296

Closed swcurran closed 6 years ago

swcurran commented 6 years ago

When an entity requests a Proof Request and there are multiple credentials of the same type for the same subject, the Proof Request process fails. This is manifest in two places right now:

  1. A Proof Request from Permitify to support getting a subsequent permit.
  2. When a Proof Request is processed by the "Verify Credential" button.

Likely, we need to add a way to invoke one of three variations on the Proof Request within TOB:

At minimum, the default should be implemented as soon as possible to fix our hanging issues in demoing TOB.

swcurran commented 6 years ago

@nrempel - can you please look up this sooner than later? Problem is that when clicking the "Verify" button, the process fails if there is more than one Credential of a given type. Since we are on a specific credential, it should just return that one. Sample: https://devex-von-test.pathfinder.gov.bc.ca/en/org/89/cert/552

Also a problem when doing a proof request for Permitify and there are multiple credentials that might the criteria. Sample: https://devex-von-test.pathfinder.gov.bc.ca/en/org/89/cert/552

nrempel commented 6 years ago

I'll look at this right away.

nrempel commented 6 years ago

This is caused by an error raised inside of von_agent.

Traceback (most recent call last):
  File "/home/indy/api/proofRequestProcesser.py", line 234, in __ConstructProof
    requested_claims
  File "/home/indy/.pyenv/versions/3.6.3/lib/python3.6/site-packages/von_agent/agents.py", line 1233, in create_proof
    raise ClaimsFocus('Proof request requires unique claims per attribute; violators: {}'.format(x_uuids))
von_agent.error.ClaimsFocus

The related code is here: https://github.com/PSPC-SPAC-buyandsell/von_agent/blob/master/von_agent/agents.py#L1111.

The error is raised because there are multiple claims the wallet that satisfy the proof request:

{
  "attrs": {
    "effective_date": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "postal_code": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "legal_entity_id": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "address_line_1": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "addressee": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "restaurant_name": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "coverage_description": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "address_line_2": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "end_date": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "country": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "city": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ],
    "province": [
      {
        "referent": "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
        "attrs": {
          "postal_code": "V3W 4E3",
          "address_line_2": "",
          "restaurant_name": "Bertram Chophouse",
          "effective_date": "1525980406",
          "city": "Surrey",
          "address_line_1": "884 King George Hwy",
          "end_date": "1557516406",
          "coverage_description": "All Employees",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "addressee": "Brian Bertram",
          "country": "CA",
          "province": "BC"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      },
      {
        "referent": "claim::06fd746b-d16e-490c-a9b4-b3e9ede1a384",
        "attrs": {
          "postal_code": "V3W 4E3",
          "country": "CA",
          "legal_entity_id": "6a937d9f-86dc-40e8-9c18-42515de9825d",
          "effective_date": "1525982101",
          "address_line_1": "884 King George Hwy",
          "coverage_description": "asd",
          "city": "Surrey",
          "restaurant_name": "ads",
          "end_date": "1557518101",
          "province": "BC",
          "address_line_2": "",
          "addressee": "Brian Bertram"
        },
        "schema_key": {
          "name": "restaurant_clearance_letter.worksafe_bc",
          "version": "1.0.31",
          "did": "2ADJkgDwr97c6i1Ps3qcdx"
        },
        "issuer_did": "2ADJkgDwr97c6i1Ps3qcdx",
        "revoc_reg_seq_no": null
      }
    ]
  },
  "predicates": {}
}

This data is returned directly from the wallet. Each proof request field has two claims that satisfy the request. As far as I know this shouldn't be an issue because we also specify which claim to use in requested_claims:

{
   "self_attested_attributes": {},
   "requested_attrs": {
     "effective_date": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "postal_code": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "legal_entity_id": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "address_line_1": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "addressee": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "restaurant_name": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "coverage_description": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "address_line_2": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "end_date": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "country": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "city": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ],
     "province": [
       "claim::893c3ecf-c779-4287-9907-26c67d8b7adb",
       true
     ]
   },
   "requested_predicates": {}
 }

The following indy-sdk function is invoked after processing in von_agent: https://github.com/hyperledger/indy-sdk/blob/master/wrappers/python/indy/anoncreds.py#L768.

@sklump I can't remember, but we must have a reason we're guarding here. Do you recall?

swcurran commented 6 years ago

Definitely need a way to handle this outside of VON-Agent. I guess will be resolved by the future tag-aware wallet, where the calling into VON-Agent can include tags to identify the precise credential of interest. @sklump should we deal with this now or wait? For demo purposes, we can revise the data to not issue multiple credentials of the same type.

Future stuff: I've been thinking that there are likely use cases where an Agent with Business Rules/a person should be able to respond to a Proof Request with an array of Proofs. I'm assuming that support would be done at the VON-Agent/Agent-2-Agent protocol level.

nrempel commented 6 years ago

Maybe I'm missing something, but as far as I can see there should be nothing stopping von_agent from managing the case where multiple credentials come through in the list of valid credentials since requested_credentials specifies a unique claim uuid for each attr.

In any case, I've added a shim to modify the wallet results to only include the credentials of interest and it solved the issue.

The current build on dev no longer experiences this issue.

Example: https://devex-von-dev.pathfinder.gov.bc.ca/en/org/1/cert/32

sklump commented 6 years ago

It is as designed. Only one attr per cred def is permitted in a proof in Indy-ask. You may apply filtration via the utils.

sklump commented 6 years ago

Also, there is filtration as an option on get_creds() I believe.

nrempel commented 6 years ago

Gotcha, probably a side effect of TOB still using a custom filter method from the good ol days. It sounds like once we move to use von_agent filter helpers it should just work (tm)

I'll add it to my list for the v2 upgrade.

Either way, it works for now 👍🏻

sklump commented 6 years ago

The test code shows filtration before via get_creds(), or afterward via display/prune. Ping me when you get there, revocation touches this stuff too.