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-exchange PR revival #1046

Merged
merged 2 commits into from
Nov 20, 2023
Merged

Conversation

Patrik-Stas
Copy link
Contributor

@Patrik-Stas Patrik-Stas commented Nov 6, 2023

  • Sync up with changes which happened to main since the original did-exchange PR DID Exchange Protocol #928
    • mainly: messages builder, adoption of generics in favor of trait objects, addressing lint errors
  • support only oob invitation for did-exchange, drop support for others - the protocol is not supposed to handle legacy connection pairwise or connection public invitations
  • implement pub async fn send_message<T>(&self, wallet: &impl BaseWallet, message: &AriesMessage, transport: &T) for did-exchange - this makes this a lot simpler in higher levels, eg. in aries-vcx-agent
  • in mediator agent, remove local oob2did in favor of reusing aries_vcx's oob_invitation_to_legacy_did_doc
  • refactoring: aries_vcx/src/common/ledger/transactions.rs move functions from this file to more appropriate file aries_vcx/src/handlers/out_of_band/receiver.rs and aries_vcx/src/protocols/connection/invitee/mod.rs
  • Remove struct arguments such as ConstructRequestConfig - given we are now using generics rather than trait objects, these objecs would now start involving generics, as you can use syntax such as &impl IndyLedgerRead in struct definition. I have more arguments for the change
  • trimmed integration test workflow revoke_credential_local - first of all, workflows should not do asserts; secondly, the asserts didn't really make sense and was probably originating from lot older code after rounds of refactoring

Next steps:

  • I would like to get this merged as soon as possible, despite seeing more improvements to be made. The merge should followed up by move of aries_vcx into /aries directory - before any new activity for aries_vcx emerges in PRs
  • Main area I've identified that can be improved is how DidExchangeRequester<RequestSent> constructs requests messages - currently there's 2 functions construct_request_pairwise and construct_request_public with different set of arguments and certain assumptions. To keep the interface simple, and given we operate in Aries paradigm, the input should be an OOB Invitation message. Then, this processing function should ideally support variety of DIDs which might appear in the inivtation - for starter: did:peer:4 and did:sov.
  • Separate processing logic from state machines. It should be possible to run did-exchange protocol without being coerced into using state machines. (obivously this is something that applies to our other protocols as well)

@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch from 8d2c6cd to e433820 Compare November 6, 2023 22:26
@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (feature/did-exchange@dcd987c). Click here to learn what that means.

Additional details and impacted files
@@                  Coverage Diff                   @@
##             feature/did-exchange   #1046   +/-   ##
======================================================
  Coverage                        ?   0.05%           
======================================================
  Files                           ?     471           
  Lines                           ?   24009           
  Branches                        ?    4307           
======================================================
  Hits                            ?      13           
  Misses                          ?   23995           
  Partials                        ?       1           
Flag Coverage Δ
unittests-aries-vcx 0.05% <0.00%> (?)

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.

@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch 2 times, most recently from 03c8f44 to 8c2fee1 Compare November 6, 2023 22:47
@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch from 23a4a2b to 266ee29 Compare November 13, 2023 23:17
@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch 2 times, most recently from f4c5b78 to 60fd307 Compare November 15, 2023 15:28
@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch from 14096f3 to 5be1a4c Compare November 15, 2023 23:17
@Patrik-Stas Patrik-Stas marked this pull request as ready for review November 15, 2023 23:42
@Patrik-Stas Patrik-Stas changed the title Feature/did exchange additions Did-exchange PR revival Nov 16, 2023
Signed-off-by: Patrik Stas <[email protected]>
Copy link
Contributor

@mirgee mirgee left a comment

Choose a reason for hiding this comment

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

Just a couple of things I noticed on a quick skim, will do a more detailed review later

agents/rust/aries-vcx-agent/src/agent/init.rs Outdated Show resolved Hide resolved
aries_vcx/src/handlers/out_of_band/receiver.rs Outdated Show resolved Hide resolved
aries_vcx/src/protocols/did_exchange/state_machine/mod.rs Outdated Show resolved Hide resolved
// todo: no unwrap pls
let service = did_document.service().first()?;
// todo: will get cleaned up after service is de-generified
Some(match service {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be performed by ServiceSov

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved as helper to aries agent, will probably look different after de-generification of did document

Copy link
Contributor

Choose a reason for hiding this comment

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

It will look different, but does your idea include abolishment of ServiceSov?

aries_vcx/tests/test_did_exchange.rs Outdated Show resolved Hide resolved
aries_vcx/src/protocols/did_exchange/state_machine/mod.rs Outdated Show resolved Hide resolved
@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch from 5be1a4c to a9829b7 Compare November 16, 2023 16:21
- Generalize did_resolver_sov
- Move methods
- Remove did-exchange send_message method
- Address more code review comments

Signed-off-by: Patrik Stas <[email protected]>
@Patrik-Stas Patrik-Stas force-pushed the feature/did-exchange-additions branch from 36e00a9 to 1439ee2 Compare November 20, 2023 00:29
@mirgee mirgee merged commit 23e2b0f into feature/did-exchange Nov 20, 2023
28 checks passed
@mirgee mirgee deleted the feature/did-exchange-additions branch November 20, 2023 10:27
.base58();
EncryptionEnvelope::create(
wallet,
json!(message).to_string().as_bytes(),
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be better to not use a potentially panicking macro

Patrik-Stas added a commit that referenced this pull request Nov 20, 2023
* Restore did-exchange
* Address code review

Signed-off-by: Patrik Stas <[email protected]>
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.

3 participants