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:peer:4 integration, bugfix, improvements #1167

Merged
merged 9 commits into from
Apr 1, 2024
Merged

Conversation

Patrik-Stas
Copy link
Contributor

@Patrik-Stas Patrik-Stas commented Mar 25, 2024

  • Use did:peer:4 in didexchange (produce did:peer:4 in outgoing messages for both requester and responder)
    • Still supports counterparty using ptentially did:peer:2 (well, or any other DID method we support)

Additional updates:

  • New get APIs for DidDocument:
    • assertion_method_by_key(&self, id: &str)
    • verification_method_by_id(&self, id: &str)
    • key_agreement_by_id(&self, id: &str)
    • capability_invocation_by_id(&self, id: &str)
    • capability_delegation_by_id(&self, id: &str)
  • New update APIs for DidDocument, generally following pattern:
    • add_authentication(&mut self, method: VerificationMethodKind)
    • add_authentication_object(&mut self, method: VerificationMethod)
    • add_authentication_ref(&mut self, reference: DidUrl)

Fixes

  • Fix bug on contextualize_to_did_doc which causes did:peer:4 to not fully decode

Error handling changes

  • PeerDid<Numalgo4>::short_form(&self) does not return Result, but instead uses expect() which should never happens (see safety note in the code).
  • DidPeer4ConstructionDidDocument::contextualize_to_did_doc(&self, did_peer_4: &PeerDid<Numalgo4>) is now also using panic upon conversion of DID type to URI type. Every DID is URI and therefore this should never panic. If panic occurs, it strictly indicates either:
    • buggy DID parsing (something that is not actually DID was parsed as a DID)
    • buggy URI parsing (something that is URI fails to be parsed as URI)

@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 141 lines in your changes are missing coverage. Please review.

Project coverage is 0.05%. Comparing base (09144f1) to head (20c48fa).

Files Patch % Lines
did_core/did_doc/src/schema/did_doc.rs 0.00% 70 Missing ⚠️
...rc/protocols/did_exchange/state_machine/helpers.rs 0.00% 18 Missing ⚠️
...peer_did/numalgos/numalgo4/construction_did_doc.rs 0.00% 15 Missing ⚠️
aries/aries_vcx/tests/test_did_exchange.rs 0.00% 13 Missing ⚠️
...ods/did_peer/src/peer_did/numalgos/numalgo4/mod.rs 0.00% 10 Missing ⚠️
...change/state_machine/requester/request_sent/mod.rs 0.00% 9 Missing ⚠️
...did_peer/src/peer_did/numalgos/numalgo2/helpers.rs 0.00% 4 Missing ⚠️
...hange/state_machine/responder/response_sent/mod.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #1167      +/-   ##
========================================
- Coverage   0.05%   0.05%   -0.01%     
========================================
  Files        484     484              
  Lines      24184   24203      +19     
  Branches    4484    4490       +6     
========================================
  Hits          13      13              
- Misses     24171   24190      +19     
Flag Coverage Δ
unittests-aries-vcx 0.05% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
@Patrik-Stas Patrik-Stas marked this pull request as ready for review March 25, 2024 13:10
@Patrik-Stas Patrik-Stas changed the title Didechange/didpeer4 did:peer:4 integration, bugfix, improvements Mar 25, 2024
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
@Patrik-Stas Patrik-Stas merged commit 37707bc into main Apr 1, 2024
26 checks passed
@Patrik-Stas Patrik-Stas deleted the didechange/didpeer4 branch April 1, 2024 12:33
GHkrishna pushed a commit to GHkrishna/aries-vcx that referenced this pull request Apr 16, 2024
* did:peer:4 integration, bugfix, improvements (hyperledger#1167)

Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
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.

2 participants