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

Fix path processing logic in addToMdocRequest #880

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vanhoanHoang
Copy link

@vanhoanHoang vanhoanHoang commented Jan 13, 2025

Description

Currently by requesting an iso/mdoc from the Wallet resulting a wallet succesfully sending a mdoc. The received mdoc on Verifier side however does not contain any attributes requested in the presentation request. This is due to the processing logic in the addToMdocRequest function (here)

Currently, this line splits the namespace concatenated with the requested attribute using a . as the delimiter. However, for namespaces that already contain a . (such as those in mdl), this causes the claim and the namespace to be incorrectly split and then added to the MDocRequestBuilder. In case of org.iso.18013.5.1, only org is set to be the namespace. This is leading to incorrect behavior, as the full path isn't being processed as expected.

The following is one of the presentation_definition , which requests first_name in the mdl. The mdl contains given_name, family_name and other attributes:

{
   "id":"fccd9c29-c2e7-4110-b792-a87cb81c55ef",
   "input_descriptors":[
      {
         "id":"org.iso.18013.5.1.mDL",
         "purpose":"authenticate user via MDOC",
         "format":{
            "mso_mdoc":{
               "alg":[
                  "EdDSA",
                  "RSA"
               ]
            }
         },
         "constraints":{
            "fields":[
               {
                  "path":[
                     "$.docType"
                  ],
                  "filter":{
                     "pattern":"org.iso.18013.5.1.mDL",
                     "type":"string"
                  },
                  "intent_to_retain":false
               },
               {
                  "path":[
                     "$['org.iso.18013.5.1']['given_name']"
                  ],
                  "filter":{
                     "pattern":".*",
                     "type":"string"
                  },
                  "intent_to_retain":true
               }
            ]
         }
      }
   ]
}

Type of Change

  • [x ] bug fix - change which fixes an issue

Checklist

  • [x ] code cleanup and self-review

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

Successfully merging this pull request may close these issues.

1 participant