aries-cloudagent-python icon indicating copy to clipboard operation
aries-cloudagent-python copied to clipboard

did method registry

Open burdettadam opened this issue 2 years ago • 3 comments

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]

burdettadam avatar Sep 21 '22 20:09 burdettadam

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.

dbluhm avatar Sep 22 '22 17:09 dbluhm

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.

dbluhm avatar Sep 22 '22 17:09 dbluhm

@burdettadam can you catch this one up with the latest main branch?

ianco avatar Oct 20 '22 22:10 ianco

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Oct 21 '22 16:10 sonarqubecloud[bot]

Codecov Report

Merging #1955 (797724b) into main (a16347d) will decrease coverage by 0.01%. The diff coverage is 81.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     

codecov-commenter avatar Oct 21 '22 16:10 codecov-commenter

We have a single PR with a related key type registry now, #1986. Closing this one in favor of the new one.

burdettadam avatar Oct 25 '22 15:10 burdettadam