Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling request-presentation message #532

Closed
standlove opened this issue Nov 10, 2021 · 12 comments
Closed

Error handling request-presentation message #532

standlove opened this issue Nov 10, 2021 · 12 comments

Comments

@standlove
Copy link

standlove commented Nov 10, 2021

Hi,

Can you help check why it cannot handle this request-presentation message? Thanks.

 DEBUG  DEBUG: Agent Galaxy S10e received message
 INFO  INFO: Received message with type 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation' from connection undefined (undefined) {
  "@id": "98622f3d-b6e0-4550-81a5-eda643a69cff",
  "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation",
  "request_presentations~attach": [
    {
      "@id": "libindy-request-presentation-0",
      "mime-type": "application/json",
      "data": {
        "base64": "eyJuYW1lIjoidmVyaWZpZWQtZW1haWwiLCJ2ZXJzaW9uIjoiMS4wIiwibm9uY2UiOiIzMzM3NTI1Njk1NjU5MzAzNzY5NjYzOTc4NzY1NjM5NzE2NjYyOTYiLCJyZXF1ZXN0ZWRfYXR0cmlidXRlcyI6eyIwX0VtcGxveWVlX05hbWVfdXVpZCI6eyJuYW1lIjoiRW1wbG95ZWVfTmFtZSIsInJlc3RyaWN0aW9ucyI6W3siaXNzdWVyX2RpZCI6IkNSa3RQVzloNmI3QXVua2ljc3lmazEifV19LCIwX0VtcGxveWVlX0lEX3V1aWQiOnsibmFtZSI6IkVtcGxveWVlX0lEIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfQmFzZV9Mb2NhdGlvbl9JZF91dWlkIjp7Im5hbWUiOiJCYXNlX0xvY2F0aW9uX0lkIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfTWFuYWdlcl9FbWFpbF9JZF91dWlkIjp7Im5hbWUiOiJNYW5hZ2VyX0VtYWlsX0lkIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfTG9jYWxfQ29udGFjdF9FbWFpbF9JZF91dWlkIjp7Im5hbWUiOiJMb2NhbF9Db250YWN0X0VtYWlsX0lkIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfQnVzaW5lc3NfVW5pdF91dWlkIjp7Im5hbWUiOiJCdXNpbmVzc19Vbml0IiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX19LCJyZXF1ZXN0ZWRfcHJlZGljYXRlcyI6eyIwX0FnZV9HRV91dWlkIjp7InBfdHlwZSI6Ij49IiwicF92YWx1ZSI6IjE4IiwibmFtZSI6IkFnZSIsInJlc3RyaWN0aW9ucyI6W3siaXNzdWVyX2RpZCI6IkNSa3RQVzloNmI3QXVua2ljc3lmazEifV19fX0="
      }
    }
  ],
  "comment": null,
  "~service": {
    "recipientKeys": [
      "ABkRURBAf2zjUCnsqt4MxBqmrR9fZe7eyEbvKSWiqHfE"
    ],
    "routingKeys": null,
    "serviceEndpoint": "http://vcauthprovider.southindia.azurecontainer.io:5679"
  }
}
 DEBUG  DEBUG: Processing presentation request with id 98622f3d-b6e0-4550-81a5-eda643a69cff
 ERROR  ERROR: Error handling message with type https://didcomm.org/present-proof/1.0/request-presentation {
  "message": {
    "@type": "https://didcomm.org/present-proof/1.0/request-presentation",
    "@id": "98622f3d-b6e0-4550-81a5-eda643a69cff",
    "request_presentations~attach": [
      {
        "@id": "libindy-request-presentation-0",
        "mime-type": "application/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9XX19LCJyZXF1ZXN0ZWRfcHJlZGljYXRlcyI6eyIwX0FnZV9HRV91dWlkIjp7InBfdHlwZSI6Ij49IiwicF92YWx1ZSI6IjE4IiwibmFtZSI6IkFnZSIsInJlc3RyaWN0aW9ucyI6W3siaXNzdWVyX2RpZCI6IkNSa3RQVzloNmI3QXVua2ljc3lmazEifV19fX0="
        }
      }
    ],
    "comment": null,
    "~service": {
      "recipientKeys": [
        "ABkRURBAf2zjUCnsqt4MxBqmrR9fZe7eyEbvKSWiqHfE"
      ],
      "routingKeys": null,
      "serviceEndpoint": "http://vcauthprovider.southindia.azurecontainer.io:5679"
    }
  }
}

@berendsliedrecht
Copy link
Contributor

Hi!

This error is a bit too ambiguous for me (we should probably look into that).

  1. Do you have any additional logs?
  2. Which functions did you specifically call?

@standlove
Copy link
Author

Hi, @blu3beri

I have updated above to include the full logs in the metro.

I'm trying to scan a verifiable credential qrcode (which encodes this URL: http://vcauthprovider.southindia.azurecontainer.io:80/url/e10ae70a-cb57-4504-b7c7-bf8a12fc59f6).

Thanks for checking.

@standlove
Copy link
Author

hmm...

It's probably because the p_value in the message is of string type instead of int type ...

{
  "name": "verified-email",
  "version": "1.0",
  "nonce": "69245620800716388305155147225575492730",
  "requested_attributes": {
    "0_Employee_Name_uuid": {
      "name": "Employee_Name",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    },
    "0_Employee_ID_uuid": {
      "name": "Employee_ID",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    },
    "0_Base_Location_Id_uuid": {
      "name": "Base_Location_Id",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    },
    "0_Manager_Email_Id_uuid": {
      "name": "Manager_Email_Id",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    },
    "0_Local_Contact_Email_Id_uuid": {
      "name": "Local_Contact_Email_Id",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    },
    "0_Business_Unit_uuid": {
      "name": "Business_Unit",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    }
  },
  "requested_predicates": {
    "0_Age_GE_uuid": {
      "p_type": ">=",
      "p_value": "18",
      "name": "Age",
      "restrictions": [
        {
          "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
        }
      ]
    }
  }
}

@TimoGlastra
Copy link
Contributor

#533 Once this PR is merged and released could you try again @standlove ?

@standlove
Copy link
Author

Hi, @TimoGlastra

Got this error. The predicateValue must be number in protocol?

 ERROR  ERROR: Error handling message with type https://didcomm.org/present-proof/1.0/request-presentation {
  "message": {
    "@type": "https://didcomm.org/present-proof/1.0/request-presentation",
    "@id": "b609bd99-ebb3-463e-b795-f357d3b85335",
    "request_presentations~attach": [
      {
        "@id": "libindy-request-presentation-0",
        "mime-type": "application/json",
        "data": {
          "base64": "eyJuYW1lIjoidmVyaWZpZWQtZW1haWwiLCJ2ZXJzaW9uIjoiMS4wIiwibm9uY2UiOiIyNjMyODE3MTE0OTE5MzczNjA2NTQwNDgwMDgyNjM5MTcwNDQyNTYiLCJyZXF1ZXN0ZWRfYXR0cmlidXRlcyI6eyIwX0VtcGxveWVlX05hbWVfdXVpZCI6eyJuYW1lIjoiRW1wbG95ZWVfTmFtZSIsInJlc3RyaWN0aW9ucyI6W3siaXNzdWVyX2RpZCI6IkNSa3RQVzloNmI3QXVua2ljc3lmazEifV19LCIwX0VtcGxveWVlX0lEX3V1aWQiOnsibmFtZSI6IkVtcGxveWVlX0lEIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfQmFzZV9Mb2NhdGlvbl9JZF91dWlkIjp7Im5hbWUiOiJCYXNlX0xvY2F0aW9uX0lkIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfTWFuYWdlcl9FbWFpbF9JZF91dWlkIjp7Im5hbWUiOiJNYW5hZ2VyX0VtYWlsX0lkIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfTG9jYWxfQ29udGFjdF9FbWFpbF9JZF91dWlkIjp7Im5hbWUiOiJMb2NhbF9Db250YWN0X0VtYWlsX0lkIiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX0sIjBfQnVzaW5lc3NfVW5pdF91dWlkIjp7Im5hbWUiOiJCdXNpbmVzc19Vbml0IiwicmVzdHJpY3Rpb25zIjpbeyJpc3N1ZXJfZGlkIjoiQ1JrdFBXOWg2YjdBdW5raWNzeWZrMSJ9XX19LCJyZXF1ZXN0ZWRfcHJlZGljYXRlcyI6eyIwX0FnZV9HRV91dWlkIjp7InBfdHlwZSI6Ij49IiwicF92YWx1ZSI6IjE4IiwibmFtZSI6IkFnZSIsInJlc3RyaWN0aW9ucyI6W3siaXNzdWVyX2RpZCI6IkNSa3RQVzloNmI3QXVua2ljc3lmazEifV19fX0="
        }
      }
    ],
    "comment": null,
    "~service": {
      "recipientKeys": [
        "ABkRURBAf2zjUCnsqt4MxBqmrR9fZe7eyEbvKSWiqHfE"
      ],
      "routingKeys": null,
      "serviceEndpoint": "http://vcauthprovider.southindia.azurecontainer.io:5679"
    }
  },
  "error": [
    {
      "target": {
        "name": "verified-email",
        "version": "1.0",
        "nonce": "263281711491937360654048008263917044256",
        "requested_attributes": {
          "0_Employee_Name_uuid": {
            "name": "Employee_Name",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          },
          "0_Employee_ID_uuid": {
            "name": "Employee_ID",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          },
          "0_Base_Location_Id_uuid": {
            "name": "Base_Location_Id",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          },
          "0_Manager_Email_Id_uuid": {
            "name": "Manager_Email_Id",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          },
          "0_Local_Contact_Email_Id_uuid": {
            "name": "Local_Contact_Email_Id",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          },
          "0_Business_Unit_uuid": {
            "name": "Business_Unit",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          }
        },
        "requested_predicates": {
          "0_Age_GE_uuid": {
            "p_type": ">=",
            "p_value": "18",
            "name": "Age",
            "restrictions": [
              {
                "issuer_did": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          }
        }
      },
      "value": {},
      "property": "requestedPredicates",
      "children": [
        {
          "target": {},
          "value": {
            "predicateType": ">=",
            "predicateValue": "18",
            "name": "Age",
            "restrictions": [
              {
                "issuerDid": "CRktPW9h6b7Aunkicsyfk1"
              }
            ]
          },
          "property": "0_Age_GE_uuid",
          "children": [
            {
              "target": {
                "predicateType": ">=",
                "predicateValue": "18",
                "name": "Age",
                "restrictions": [
                  {
                    "issuerDid": "CRktPW9h6b7Aunkicsyfk1"
                  }
                ]
              },
              "value": "18",
              "property": "predicateValue",
              "children": [],
              "constraints": {
                "isInt": "predicateValue must be an integer number"
              }
            }
          ]
        }
      ]
    }
  ]
}

@TimoGlastra
Copy link
Contributor

Do you know if this an error on our side? Or that it is allowed to use string?

@TimoGlastra
Copy link
Contributor

Seems like ACA-Py also specifies that it must be an integer:

value = fields.Integer(strict=True, description="Predicate threshold value")

@standlove
Copy link
Author

Ok.

The Trinsic Wallet app allows it to be string (the qrcode above works in it).

That's why I asked ...

@TimoGlastra
Copy link
Contributor

@ianco @swcurran what do you think? Should we allow string values for predicate values?

@ianco
Copy link

ianco commented Nov 11, 2021

@ianco @swcurran what do you think? Should we allow string values for predicate values?

I thought it was a constraint with Indy SDK that the predicate values must be integer.

@swcurran
Copy link
Contributor

My understanding is this. Predicates are based on the encoded value of the credential, which is always an integer. If the data (aka the "raw value") is an integer, so is the encoded value; if it is a string (or any non-integer), the encode value is a hash of the raw value. So the only way to do a predicate on a raw value that is a string is for the hash algorithm to produce a sortable integer, and we're not using such an encoding. As such, I don't see how it is possible to do predicates on anything other than integer raw values -- at least not without changing the encoding scheme being used.

Am I wrong in my understanding?

@TimoGlastra
Copy link
Contributor

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants