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

did:tdw resolver #3237

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Conversation

jamshale
Copy link
Contributor

@jamshale jamshale commented Sep 16, 2024

  • Uses the trustdidweb-py library to implement the resolver.
  • Plugs the resolve endpoint and library into the base_resolver class for caching and future other resolution.

@jamshale
Copy link
Contributor Author

There's going to be an update to the spec so I'm not going to work on this until it gets approved and the library gets updated.

@jamshale jamshale closed this Sep 19, 2024
@swcurran
Copy link
Contributor

I don’t think the update to the spec will impact what is in this PR. AFAIK, it is making a call to a library. The call will not be impacted by the spec change, which is just some details around the DID Log format.

OK to leave if you think best — just noting that the spec change should not impact this.

@jamshale
Copy link
Contributor Author

OK. Sounds good. I can continue on this. I'm kind of blocked by bot getting it published. There's a pr in trustdidweb-py repo to do it but hasn't got completed yet.

@jamshale jamshale reopened this Sep 20, 2024
@jamshale jamshale marked this pull request as ready for review September 20, 2024 20:32
@jamshale jamshale changed the title [WIP] Did tdw resolver did:tdw resolver Sep 23, 2024
class DidTdwResolveResponse(OpenAPISchema):
"""Response schema for create DID endpoint."""

did_doc = fields.Dict(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about just returning the diddoc dict here instead of inside this key.

@swcurran
Copy link
Contributor

Just as a matter of interest — if the DID to be resolved was a DID URL, could/should this code return the object that is referenced instead of the DIDDoc? For example if what was to be resolved was did:tdw:1234567:example.com/whois, the resulting object would be a Verifiable Presentation. Or maybe did:tdw:1234567:example.com/OCA/ocabundle.json?

@jamshale
Copy link
Contributor Author

Maybe that does make sense. After verifying and resolving the did it could get the response from the endpoint and return that. The way it is now, that responsibility would fall on the controller.

@swcurran
Copy link
Contributor

Perhaps not needed yet, but I think we want that in the future. It gives the controller the choice, without having to get its hands dirty with the rules of DIDs and DID Resolution. Either it gets a valid object back that it can use, or it gets an error that something is broken with its request.

@dbluhm
Copy link
Contributor

dbluhm commented Sep 23, 2024

Perhaps not needed yet, but I think we want that in the future. It gives the controller the choice, without having to get its hands dirty with the rules of DIDs and DID Resolution.

I am all for continuing to push for controller simplicity and keeping the controllers concerns focused on business logic and not DID and Key minutia (except in circumstances where business requirements dictate being picky about those things).

I think there's a place for a dereference endpoint alongside the resolve endpoint. Having it be separate would help the caller be certain they won't unintentionally get a did document when they expected a verification method or vice versa.

It is notable however that I don't think there's generally a reason for the controller to resolve/dereference DIDs and DID URLs directly. The only time I've done this from a controller was when working around bugs or features not yet supported in ACA-Py. Which is perhaps a fair reason to justify their existence alone but, all going well, I think it would generally be unnecessary to call them.

aries_cloudagent/did/tdw/routes.py Outdated Show resolved Hide resolved
aries_cloudagent/did/tdw/tdw_manager.py Outdated Show resolved Hide resolved
aries_cloudagent/did/tdw/tests/test_routes.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Sep 24, 2024

@PatStLouis
Copy link
Contributor

+1 for what @dbluhm is suggesting, we should have a resolve endpoint that will return a did document and use a de reference endpoint for any other resources represented by a did url.

@jamshale are you planning to do any verification as part of the resolving?

Did log processing is part of the resolving section in the spec.

@jamshale
Copy link
Contributor Author

jamshale commented Oct 8, 2024

@PatStLouis The library does the verification. I haven't gone over the spec with the code in detail, but basic testing seemed to be correct.

@PatStLouis
Copy link
Contributor

Sounds good, I wasn't aware how much of the process the library was covering. This is great!

@jamshale
Copy link
Contributor Author

jamshale commented Nov 16, 2024

Removed the did url usage in the resolver.

I think a did url dereference ticket should be created next as a separate task. Maybe with a similar pattern to the resolver.

@jamshale jamshale requested a review from dbluhm November 18, 2024 16:11
dbluhm
dbluhm previously approved these changes Nov 18, 2024
Copy link
Contributor

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I agree with Jamie that we can worry about dereferencing next as a separate change.

@dbluhm
Copy link
Contributor

dbluhm commented Nov 18, 2024

@jamshale heads up on the conflict in the poetry.lock

Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Copy link

sonarcloud bot commented Nov 18, 2024

@jamshale jamshale requested a review from ianco November 18, 2024 19:30
@jamshale jamshale merged commit f5c49b0 into openwallet-foundation:main Nov 18, 2024
10 checks passed
ff137 added a commit to didx-xyz/acapy that referenced this pull request Nov 21, 2024
commit cb5bc32f8d0462d3b7e8b8b9f57cec0aae93c6e9
Author: ff137 <ff137@proton.me>
Date:   Tue Nov 12 13:01:19 2024 +0200

    loud_sound: Expand logging for Ledger Configuration

    Signed-off-by: ff137 <ff137@proton.me>

commit 855fea2d19a752f63b5a15ed3965f521952238c8
Author: ff137 <ff137@proton.me>
Date:   Tue Nov 12 11:04:16 2024 +0200

    bug: Fix registering and loading of modules

    Signed-off-by: ff137 <ff137@proton.me>

commit 3a852195048d398c5ff63bbdb60c74c8e0ae6631
Author: ff137 <ff137@proton.me>
Date:   Mon Nov 11 10:53:30 2024 +0200

    art: Enable trace logs for remaining modules

    Signed-off-by: ff137 <ff137@proton.me>

commit 597aff574eacda773fb58a05f15993259f060f2b
Author: ff137 <ff137@proton.me>
Date:   Mon Nov 11 10:22:45 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit 888f68190e3f8f24d511f5f3b727149757408402
Author: ff137 <ff137@proton.me>
Date:   Mon Nov 11 10:22:16 2024 +0200

    loud_sound: Log a warning if resource not found, instead of passing

    Signed-off-by: ff137 <ff137@proton.me>

commit 33a633259675acab118b08c3e6574ee097f9cba9
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 21:37:52 2024 +0200

    loud_sound: Expand logging for ClassLoader

    Signed-off-by: ff137 <ff137@proton.me>

commit 0cc1cae8163187617a95534d77b99e2683d26ac5
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 20:58:12 2024 +0200

    bug: Handle case that load_module return type is Optional

    Signed-off-by: ff137 <ff137@proton.me>

commit 33dc62fe6472c0d9109d347cd50747481275c651
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 20:15:18 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit 6ea5fe7d07ab9e575fdf9fe88ae9490f08e6794e
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 18:37:06 2024 +0200

    white_check_mark: Modify log assertion to be more robust

    Signed-off-by: ff137 <ff137@proton.me>

commit 0abdad40e13cb69cb1338173f6ddabfc1937bd81
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 17:31:20 2024 +0200

    test_tube: Debug log assertion test failing sporadically

    Filter the logs being read by module name, and add short sleep to allow log handlers to flush

    Signed-off-by: ff137 <ff137@proton.me>

commit 09707b891a4cd3f97e5577237a90a4070b6e1922
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 17:17:42 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit eca18b04bde3c7b4b069010ee589cfeb01d28c36
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 17:06:32 2024 +0200

    white_check_mark: Reset the logging states before and after TestLoggingUtils is run

    Signed-off-by: ff137 <ff137@proton.me>

commit 49507fac6f7fe2de5c9ce0cb3b3f7df680e77a6b
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 16:03:20 2024 +0200

    white_check_mark: Add unit tests for adding trace level functionality

    Signed-off-by: ff137 <ff137@proton.me>

commit fededd2562529089c4cb2f9a5e4b8e3a5bcc7b7b
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 15:22:01 2024 +0200

    loud_sound: Expand logging for Conductor start and stop

    Signed-off-by: ff137 <ff137@proton.me>

commit ba354f46af8c52de7e4d0293f9946acbd637c44e
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 15:14:10 2024 +0200

    art: Update newly added logs to be trace level instead of debug

    Signed-off-by: ff137 <ff137@proton.me>

commit 2c14ed7ffb654e23feecbb7f92e5962b3a97dfdd
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 15:08:53 2024 +0200

    art: Update newly added logs to be trace level instead of debug

    Signed-off-by: ff137 <ff137@proton.me>

commit ef734ebc7dca4b975fb5718aa716a94c34a600a4
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 15:00:22 2024 +0200

    art: Add Logger

    Signed-off-by: ff137 <ff137@proton.me>

commit 315da25a57b262bd60e2cf0ec8db7128a5bff99b
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 15:00:11 2024 +0200

    art: Ensure trace level can only be added once

    Signed-off-by: ff137 <ff137@proton.me>

commit 64b7b55d5c8cc3f6b2c85bd3a7484c41af5eee0e
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 14:59:43 2024 +0200

    sparkles: Add custom trace log level

    Signed-off-by: ff137 <ff137@proton.me>

commit 2e238e1885cffe15b9023b61684a2723764c8b67
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 14:17:10 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit 649b1f71da81c5c2a856fbf5ac128156aedda722
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 14:15:39 2024 +0200

    white_check_mark: Fix test by adding __name__ to mock object

    Signed-off-by: ff137 <ff137@proton.me>

commit a7954d668aa288db22dd5ba0f6cfa434032870ef
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 13:55:19 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit 507b0a9a589b137a8206e860a3412dab53ef85d3
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 13:51:54 2024 +0200

    Revert ":art: Rename method and remove redundant main call"

    This reverts commit 2f6526d.

    Signed-off-by: ff137 <ff137@proton.me>

commit 80e4d2311eec2303f55e9519c9969c753a6e7537
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 13:37:00 2024 +0200

    white_check_mark: Fix test by using assertLogs instead of capturing stdout

    Signed-off-by: ff137 <ff137@proton.me>

commit 09bd5d287c54f611fb362f79479caba3a2493771
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 13:30:26 2024 +0200

    art: Correct to uphold previous "Module doesn't exist" log behaviour

    Signed-off-by: ff137 <ff137@proton.me>

commit a4d51a248cc8f5192a7623848dd85681e7e84413
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 13:05:40 2024 +0200

    loud_sound: Expand logging for Conductor setup

    Signed-off-by: ff137 <ff137@proton.me>

commit 21237b9f451e33293b27849b25a73a8493316dad
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:58:06 2024 +0200

    art: Replace almost all print statements with info logs

    Signed-off-by: ff137 <ff137@proton.me>

commit 1a7ec30b895c6e898337927a842ac04524e88a12
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:38:00 2024 +0200

    art: Replace print statements with info logs

    Signed-off-by: ff137 <ff137@proton.me>

commit fd6f669b957355321b159a7192a3b5a1433b7aa5
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:26:40 2024 +0200

    loud_sound: Add debug logging to post_process_routes

    Signed-off-by: ff137 <ff137@proton.me>

commit 9d10b1f00fdba13de564b1d36dda34a3d59c49cd
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:26:17 2024 +0200

    loud_sound: Add debug logging to register_protocol_events

    Signed-off-by: ff137 <ff137@proton.me>

commit 884facc0ce41ded0cf07923a6f0589a26f74bf7b
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:25:52 2024 +0200

    loud_sound: Add debug logging to register_admin_routes

    Signed-off-by: ff137 <ff137@proton.me>

commit ec1c69012b5a0577816343ec7e9f87aac2b9fc47
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:25:30 2024 +0200

    loud_sound: Add debug logging to load_protocols

    Signed-off-by: ff137 <ff137@proton.me>

commit 526c2e7825770c4aad054df34b2050ff93a5bc94
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:24:10 2024 +0200

    loud_sound: Add debug logging to load_protocol_version

    Signed-off-by: ff137 <ff137@proton.me>

commit b4fe36e16e92230527415ededd70191d0b49c4ef
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 12:23:58 2024 +0200

    loud_sound: Add debug logging to init_context

    Signed-off-by: ff137 <ff137@proton.me>

commit d04bf3f2140730c9258c98010649500360f95eec
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 11:45:36 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit 6630df8bfb5e9f58459f09c7b16fb7c52c6a4eee
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 11:42:34 2024 +0200

    art: Deduplicate registering list of plugins

    Signed-off-by: ff137 <ff137@proton.me>

commit 5c236509ee1153841c9fc086761e045ff95e6611
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 7 11:42:14 2024 +0200

    loud_sound: Add debug logging to Context Builder

    Signed-off-by: ff137 <ff137@proton.me>

commit 26e272a4c8d4cf8f065fd8cff3ef85ca1d3ed283
Author: ff137 <ff137@proton.me>
Date:   Wed Nov 6 21:08:48 2024 +0200

    art:

    Signed-off-by: ff137 <ff137@proton.me>

commit 3f151399486ba9c99ba3d15e47eb1dd7583159f4
Author: ff137 <ff137@proton.me>
Date:   Wed Nov 6 21:07:22 2024 +0200

    art: Rename method and remove redundant main call

    Signed-off-by: ff137 <ff137@proton.me>

commit b728f948b2780b837f2bde6fd90107dc3311e4ff
Author: ff137 <ff137@proton.me>
Date:   Wed Nov 6 20:36:43 2024 +0200

    art: improve logging in register_package

    Signed-off-by: ff137 <ff137@proton.me>

commit facff607c2daac0b9f075f2fa8388fd54c248cd4
Author: ff137 <ff137@proton.me>
Date:   Wed Nov 6 20:27:33 2024 +0200

    art: Refactor `register_plugin` steps for maintainability

    Signed-off-by: ff137 <ff137@proton.me>

commit 3c7dee8
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Nov 20 16:42:10 2024 +0000

    chore(deps): Bump aiohttp (openwallet-foundation#3342)

    Bumps the pip group with 1 update in the /scenarios directory: [aiohttp](https://github.com/aio-libs/aiohttp).

    Updates `aiohttp` from 3.10.5 to 3.10.11
    - [Release notes](https://github.com/aio-libs/aiohttp/releases)
    - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
    - [Commits](aio-libs/aiohttp@v3.10.5...v3.10.11)

    ---
    updated-dependencies:
    - dependency-name: aiohttp
      dependency-type: indirect
      dependency-group: pip
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: jamshale <31809382+jamshale@users.noreply.github.com>

commit f5c49b0
Author: jamshale <31809382+jamshale@users.noreply.github.com>
Date:   Mon Nov 18 14:40:31 2024 -0800

    did:tdw resolver (openwallet-foundation#3237)

    * did:tdw resolver

    Signed-off-by: jamshale <jamiehalebc@gmail.com>

    * Update unit tests

    Signed-off-by: jamshale <jamiehalebc@gmail.com>

    * Update poetry.lock

    Signed-off-by: jamshale <jamiehalebc@gmail.com>

    ---------

    Signed-off-by: jamshale <jamiehalebc@gmail.com>

commit c18f6d1
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Nov 18 09:05:59 2024 -0800

    chore(deps): Bump pyjwt from 2.9.0 to 2.10.0 (openwallet-foundation#3339)

    Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.9.0 to 2.10.0.
    - [Release notes](https://github.com/jpadilla/pyjwt/releases)
    - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
    - [Commits](jpadilla/pyjwt@2.9.0...2.10.0)

    ---
    updated-dependencies:
    - dependency-name: pyjwt
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 2522877
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Nov 18 08:38:07 2024 -0800

    chore(deps): Bump aiohttp from 3.11.0 to 3.11.2 (openwallet-foundation#3340)

    Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.11.0 to 3.11.2.
    - [Release notes](https://github.com/aio-libs/aiohttp/releases)
    - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
    - [Commits](aio-libs/aiohttp@v3.11.0...v3.11.2)

    ---
    updated-dependencies:
    - dependency-name: aiohttp
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 1d07ede
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Mon Nov 18 08:28:57 2024 -0800

    chore(deps-dev): Bump ruff from 0.7.3 to 0.7.4 (openwallet-foundation#3341)

    Bumps [ruff](https://github.com/astral-sh/ruff) from 0.7.3 to 0.7.4.
    - [Release notes](https://github.com/astral-sh/ruff/releases)
    - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
    - [Commits](astral-sh/ruff@0.7.3...0.7.4)

    ---
    updated-dependencies:
    - dependency-name: ruff
      dependency-type: direct:development
      update-type: version-update:semver-patch
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit a41b4fb
Merge: b7d27fa d84a384
Author: Daniel Bluhm <dbluhm@pm.me>
Date:   Thu Nov 14 15:19:46 2024 -0600

    Merge pull request openwallet-foundation#3338 from didx-xyz/fix-deprecations

    🎨 Fix current test warnings

commit d84a384
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 13:23:00 2024 +0200

    :art: Remove unnecessary asyncio pytest markers

    Resolves unclosed event loop warnings.

    Signed-off-by: ff137 <ff137@proton.me>

commit c65f6ce
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 13:04:38 2024 +0200

    :arrow_up: Upgrade aiohttp to latest release and update lock file

    Signed-off-by: ff137 <ff137@proton.me>

commit 6f967c6
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 13:02:35 2024 +0200

    :art: Filter Pydantic UserWarning in test

    Signed-off-by: ff137 <ff137@proton.me>

commit 70364a4
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 12:59:48 2024 +0200

    :art: Filter Aries RFC 0160 DeprecationWarning in tests

    Signed-off-by: ff137 <ff137@proton.me>

commit 573c208
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 12:51:51 2024 +0200

    :art: Replace deprecated `scope` keyword with `loop_scope`

    Signed-off-by: ff137 <ff137@proton.me>

commit 36e47ce
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 11:25:23 2024 +0200

    :art: Replace deprecated `open_binary` method with `files`

    Signed-off-by: ff137 <ff137@proton.me>

commit d8632ee
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 11:14:27 2024 +0200

    :art: Rename class to resolve PytestCollectionWarning

    Signed-off-by: ff137 <ff137@proton.me>

commit 02019c3
Author: ff137 <ff137@proton.me>
Date:   Thu Nov 14 11:10:57 2024 +0200

    :arrow_up: Upgrade python-dateutil

    Resolves calling deprecated `datetime.utcfromtimestamp` method

    Signed-off-by: ff137 <ff137@proton.me>
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.

5 participants