aries-cloudagent-python
aries-cloudagent-python copied to clipboard
did method registry
To support different did methods in plugins we need to support did method pluggability. This PR changes the default methods to be static and registered into a registry of methods at start-up. This allows plugins to define new did methods that can be registered. The bulk of changes in this PR is updating the current code to use a did method registry.
Signed-off-by: Adam Burdett [email protected]
Thought provoking question: If we load a DID from the wallet that was created with a plugged in method but the current instance of ACA-Py does not have the same plugin loaded, should we fail on loading the DID or when we attempt to use the DID?
As currently structured, the DID Method includes info about key types and support for key rotation. This would need to be stored alongside DIDs in order for us to restore a DID without knowing the Method. This doesn't seem favorable so failing to load the DID seems like the right choice.
Also making note of this here: the Indy wallet does not hold a reference to an injection context. This means it is unable to load the set of supported methods from the context. Many of its operations are hard coded for did:sov and did:key. This PR leaves those operations as hard coded to support did:sov and did:key and does not introduce the injection context on the Indy wallet.
@burdettadam can you catch this one up with the latest main branch?
Codecov Report
Merging #1955 (797724b) into main (a16347d) will decrease coverage by
0.01%
. The diff coverage is81.37%
.
@@ Coverage Diff @@
## main #1955 +/- ##
==========================================
- Coverage 93.55% 93.54% -0.02%
==========================================
Files 539 539
Lines 34526 34528 +2
==========================================
- Hits 32300 32298 -2
- Misses 2226 2230 +4
We have a single PR with a related key type registry now, #1986. Closing this one in favor of the new one.