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

Problems using the Universal Resolver #3195

Closed
securedimensions opened this issue Aug 25, 2024 · 3 comments
Closed

Problems using the Universal Resolver #3195

securedimensions opened this issue Aug 25, 2024 · 3 comments

Comments

@securedimensions
Copy link

According to this pull request the aries cloud agent v1.0.0 startup parameter --universal-resolver is supposed to include DID resolving via https://dev.uniresolver.io.

There are two issues for me:

(1) Using the --universal-resolver https://dev.uniresolver.io as startup parameter requires to also use the startup parameter --universal-resolver-regex. Otherwise, the agent won't start:

2024-08-25 16:06:31,818 aries_cloudagent.commands.start ERROR Exception during startup:
Traceback (most recent call last):
  File "/usr/src/app/aries_cloudagent/commands/start.py", line 72, in init
    await startup
  File "/usr/src/app/aries_cloudagent/commands/start.py", line 28, in start_app
    await conductor.setup()
  File "/usr/src/app/aries_cloudagent/core/conductor.py", line 128, in setup
    context = await self.context_builder.build_context()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/aries_cloudagent/config/default_context.py", line 78, in build_context
    await self.load_plugins(context)
  File "/usr/src/app/aries_cloudagent/config/default_context.py", line 181, in load_plugins
    await plugin_registry.init_context(context)
  File "/usr/src/app/aries_cloudagent/core/plugin_registry.py", line 207, in init_context
    await plugin.setup(context)
  File "/usr/src/app/aries_cloudagent/resolver/__init__.py", line 56, in setup
    await universal_resolver.setup(context)
  File "/usr/src/app/aries_cloudagent/resolver/default/universal.py", line 66, in setup
    supported_did_regex = await self._get_supported_did_regex()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/aries_cloudagent/resolver/default/universal.py", line 114, in _get_supported_did_regex
    props = await self._fetch_resolver_props()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/aries_cloudagent/resolver/default/universal.py", line 109, in _fetch_resolver_props
    raise ResolverError(
aries_cloudagent.resolver.base.ResolverError: Failed to retrieve resolver properties: <html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.25.4</center>
</body>
</html>

(2) When starting the aries cloud agent 1.0.0 with --universal-resolver --universal-resolver-regex did:web:.* does start the agent but there seem to be no attempt to actually resolve DIDs via the Universal Resolver. The attempt to issue a W3C VC via OpenAPI page fails with the following error:

{
  "message": "Unknown DID: did:web:emc.spacebel.be:organisations:dlr"
}

However, the direct use of https://dev.uniresolver.io/ resolves the DID as follows:

did:web:emc.spacebel.be:organisations:dlr#z6MkwQSWK8dfis9Kp9kWUb4g2pG5iaab92PafzbgL2nN1TS1
{"kty":"OKP","crv":"Ed25519","x":"-93DZ8xtjHPn9VV4eohyXjgE0OWGnQcoJB6y8DEMB4I"}

This is the actual request to issue the W3C VC:

curl -X 'POST' \
  'http://.../vc/credentials/issue' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: ...' \
  -H 'Content-Type: application/json' \
  -d '{
  "credential": {
   "@context": [
      "https://www.w3.org/2018/credentials/v1",
      {
         "data": "iana:enclosure",
         "title": "dct:title",
         "href": "@id",
         "iana": "http://www.iana.org/assignments/relation/",
         "dct": "http://purl.org/dc/terms/",
         "gj": "https://purl.org/geojson/vocab#",
         "owc": "http://www.opengis.net/ont/owc/1.0/",
         "bbox": {
            "@container": "@list",
            "@id": "gj:bbox"
         },
         "links": "@nest"
      }
   ],
   "id": "did:web:emc.spacebel.be:collections:TropForest:items:KO2_OTPF_KO2_MSC_2F_20091107T041750_20091107T041750_017498_E082_N028",
   "type": [
      "VerifiableCredential"
   ],
   "credentialSubject": {
      "id": "did:web:emc.spacebel.be:collections:TropForest:items:KO2_OTPF_KO2_MSC_2F_20091107T041750_20091107T041750_017498_E082_N028",
      "bbox": [
         81.91450641,
         27.91026471,
         82.10769379,
         28.08365828
      ],
      "links": {
         "data": [
            {
               "href": "https://tpm-ds.eo.esa.int/oads/data/Tropforest/KO2_OTPF_KO2_MSC_2F_20091107T041750_20091107T041750_017498_E082_N028.ZIP",
               "title": "Download"
            }
         ]
      }
   },
   "issuer": "did:web:emc.spacebel.be:organisations:dlr",
   "issuanceDate": "2020-08-19T21:41:50Z",
   "proof": {
      "type": "Ed25519Signature2018",
      "proofPurpose": "assertionMethod",
      "verificationMethod": "did:web:emc.spacebel.be:organisations:dlr#z6MkwQSWK8dfis9Kp9kWUb4g2pG5iaab92PafzbgL2nN1TS1"
   }
}
}'

What do I do wrong? Any help is much appreciated...

@rngadam
Copy link
Contributor

rngadam commented Aug 28, 2024

Have you tried specifying the version of the universal resolver?

https://dev.uniresolver.io/1.0

@securedimensions
Copy link
Author

securedimensions commented Aug 29, 2024 via email

@securedimensions
Copy link
Author

Apologies, my fault! I should have tried dev.uniresolver.io before creating an issue. The DID did:web:emc.spacebel.be:organisations:dlr is simply not resolvable.

I've tried with another resolvable DID and it shows that either option to start the agent is vaild and identical:

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

2 participants