-
Notifications
You must be signed in to change notification settings - Fork 83
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
refactor: keep single way to resolve peer dids #1106
refactor: keep single way to resolve peer dids #1106
Conversation
Hi @gmulhearn-anonyome @xprazak2 @nain-F49FF806 Let me know if you'd need some additional context or background. Not posting initially much so you can form opinion independently, without biases. In general it's question of:
|
0343d55
to
bb408ba
Compare
a1618af
to
b6fdc6e
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## diddoc/remove-generics-updates #1106 +/- ##
=================================================================
- Coverage 0.05% 0.05% -0.01%
=================================================================
Files 481 481
Lines 24161 24180 +19
Branches 4365 4367 +2
=================================================================
Hits 13 13
- Misses 24147 24166 +19
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
to be honest, i don't really have strong opinions after looking at this for 15mins. I understand the two options as follows:
IMO it makes sense if but also the problem with |
I like that. There's no logic duplication, both functions still refer to >>resolving<< (in my original-original version I distinguished "resolving" VS "decoding" which behaved little bit different) and for me, importantly, gives the ergonomic API in contexts where users work with PeerDid instances directly. The
and @mirgee what do you say? |
I say if you both like it then proceed, no need to ask me, who am I to stand in the face of majority anyway? :) |
Nice, yea again; I don't feel strongly about any of the options, they all have pros and cons. Personally if I was consuming Aries-vcx and kept having to type out
then I would just make my own helper function/method like PeerDid::resolve and put that code in there |
IMO |
I omitted my arguments or opinion upon starting this thread, which in nutshell is
About the option 3:
You see, in fact the only thing this "DidPeerResolver" does is adding I am opinionated about this not simply because of this particular issue (I could just put helper function to both I am favoring the mentioned variants in order of preference:
I believe we all understand the options, the trade offs and philosophies between the different options so I see no way out than doing this democratically. Please either write yours or say you abstain from the vote. @nain-F49FF806 @xprazak2 if you'd like, feel free to join the battlefield here :-D |
I abstain from the vote then. |
de15fdd
to
1550c5e
Compare
Hi, I took a stroll through
What I think: 1. Method specific resolution is not sufficient, so better to have a general, common resolution interface.What I see is that there is a general expectation of flexibility on reading (/resolving?) side.
So having a general, common interface for resolution makes more sense (but may not be so relevant for generation). The generation code can be modular, and distributed separately for each method. But any resolution is incomplete (in Aries context) without supporting multiple methods. So why separate the resolution logic? This would perhaps indicate to go with something like @mirgee suggests here. 2. did:peer:4 may require a dedicated resolver due to storage requirement.Please correct me if I am mistaken on this. My reading of method 4 makes me think it'll be necessary to have some storage to 'remember' mapping of short -> long form representations of did:peer4. In that case, having the resolver external could be necessary/more ergonomic. Otherwise, we may need to add some storage interface argument to PeerDid's resolve method. Conclusion: I like the convenience of having a Currently, given the above considerations, I would vote for p.s: If we consider separating the generation into a separate crate, then p.p.s: Personally, I am drawn towards
|
b6fdc6e
to
3e04ff0
Compare
Hi @nain-F49FF806 thanks a lot for taking time to go through this! Without previous context and involvement, this is quite a chunk to swallow!
It is a good reminder - for You've expressed favor in both |
@Patrik-Stas Sorry for the ambiguity. I don't feel qualified to distinguish between the two clearly, since I am not currently a user and can't judge the practical benefits of working at the lower level. So I choose to abstain here. In a general though, for external (public) interface, I would prefer simplicity and having one good way to do things (unless there is strong benefit otherwise). |
This reverts commit fbb62bd944ef2880b2ed17cf6277b9267e7a37ee. Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
3e04ff0
to
8eea1ad
Compare
I want to wrap this up so despite your official abstain so:
Thank you all for participation! This PR applies |
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
aries/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/mod.rs
Show resolved
Hide resolved
8eea1ad
to
63dfdf4
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
* Enhancement: find first comptabile key agreement verification method Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Used TypedBulder for didcomm-service data models Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Do not leak DidDocumentBuilder out of did_doc crate Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Refactor construct_request didexchange transition Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reformat Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Rename resolve_their_ddo -> resolve_ddo_from_request Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reorganize typed didcomm service models Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Make encryption envelope api more general and safer Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Change MissingField to wrap 'str rather than String Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reduce use of OneOrList Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove DidDocumentSovError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add negative test cases for verification method Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Do not return DidDocumentBuilderError from JsonWebKey methods Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Multibase wrapper use custom error instead of DidDocumentBuilderError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add todo about using ? with Jwk decoding Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Handle jwk error explicitly Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove now unnecessary serde:error->DidDocumentBuilderError mapping Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Uri wrapper use custom error instead of DidDocumentBuilderError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create custom error for KeyDecoding errors Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove unused InvalidInput error variant Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Use PeerDid resolver in favor of peer_did.to_did_doc Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Typed service object represents service with particular value of types attribute Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix didpeer test, fix did:peer:2 regex validation Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix didpeer regex, fix test test_peer_did_2_encode_decode, fix service id deabbreviation Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add todo note Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix invalid peer did fixture, remove comments Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove forgotten logs Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Use global uri error mapping in aries-vcx Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create DidDocumentLookupError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove getters of DidResolutionOutput in favor of public fields (commonly used for destructuring pattern) Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Replace for cycles by find() Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Tweak send_message to take Url by reference Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Change to_did_doc to to_did_doc_builder Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add source attribute to MultibaseWrapperError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create JsonWebKeyError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Turn KeyDecodingError enum into struct with source err as trait object Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Define peer2 resolution on peer_did itself Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Refactor service_types() Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix formatting Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * refactor: keep single way to resolve peer dids (#1106) Signed-off-by: Patrik Stas <patrik.stas@absa.africa> --------- Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
* Enhancement: find first comptabile key agreement verification method Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Used TypedBulder for didcomm-service data models Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Do not leak DidDocumentBuilder out of did_doc crate Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Refactor construct_request didexchange transition Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reformat Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Rename resolve_their_ddo -> resolve_ddo_from_request Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reorganize typed didcomm service models Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Make encryption envelope api more general and safer Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Change MissingField to wrap 'str rather than String Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reduce use of OneOrList Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove DidDocumentSovError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add negative test cases for verification method Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Do not return DidDocumentBuilderError from JsonWebKey methods Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Multibase wrapper use custom error instead of DidDocumentBuilderError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add todo about using ? with Jwk decoding Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Handle jwk error explicitly Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove now unnecessary serde:error->DidDocumentBuilderError mapping Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Uri wrapper use custom error instead of DidDocumentBuilderError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create custom error for KeyDecoding errors Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove unused InvalidInput error variant Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Use PeerDid resolver in favor of peer_did.to_did_doc Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Typed service object represents service with particular value of types attribute Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix didpeer test, fix did:peer:2 regex validation Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix didpeer regex, fix test test_peer_did_2_encode_decode, fix service id deabbreviation Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add todo note Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix invalid peer did fixture, remove comments Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove forgotten logs Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Use global uri error mapping in aries-vcx Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create DidDocumentLookupError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove getters of DidResolutionOutput in favor of public fields (commonly used for destructuring pattern) Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Replace for cycles by find() Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Tweak send_message to take Url by reference Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Change to_did_doc to to_did_doc_builder Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add source attribute to MultibaseWrapperError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create JsonWebKeyError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Turn KeyDecodingError enum into struct with source err as trait object Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Define peer2 resolution on peer_did itself Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Refactor service_types() Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix formatting Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * refactor: keep single way to resolve peer dids (#1106) Signed-off-by: Patrik Stas <patrik.stas@absa.africa> --------- Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
* Enhancement: find first comptabile key agreement verification method Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Used TypedBulder for didcomm-service data models Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Do not leak DidDocumentBuilder out of did_doc crate Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Refactor construct_request didexchange transition Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reformat Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Rename resolve_their_ddo -> resolve_ddo_from_request Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reorganize typed didcomm service models Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Make encryption envelope api more general and safer Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Change MissingField to wrap 'str rather than String Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Reduce use of OneOrList Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove DidDocumentSovError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add negative test cases for verification method Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Do not return DidDocumentBuilderError from JsonWebKey methods Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Multibase wrapper use custom error instead of DidDocumentBuilderError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add todo about using ? with Jwk decoding Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Handle jwk error explicitly Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove now unnecessary serde:error->DidDocumentBuilderError mapping Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Uri wrapper use custom error instead of DidDocumentBuilderError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create custom error for KeyDecoding errors Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove unused InvalidInput error variant Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Use PeerDid resolver in favor of peer_did.to_did_doc Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Typed service object represents service with particular value of types attribute Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix didpeer test, fix did:peer:2 regex validation Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix didpeer regex, fix test test_peer_did_2_encode_decode, fix service id deabbreviation Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add todo note Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix invalid peer did fixture, remove comments Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove forgotten logs Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Use global uri error mapping in aries-vcx Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create DidDocumentLookupError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Remove getters of DidResolutionOutput in favor of public fields (commonly used for destructuring pattern) Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Replace for cycles by find() Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Tweak send_message to take Url by reference Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Change to_did_doc to to_did_doc_builder Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Add source attribute to MultibaseWrapperError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Create JsonWebKeyError Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Turn KeyDecodingError enum into struct with source err as trait object Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Define peer2 resolution on peer_did itself Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Refactor service_types() Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * Fix formatting Signed-off-by: Patrik Stas <patrik.stas@absa.africa> * refactor: keep single way to resolve peer dids (#1106) Signed-off-by: Patrik Stas <patrik.stas@absa.africa> --------- Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
PR #1097 performed changes to did resolution in did:peer:2 contexts. There's lack of clarity whether these changes should be accepted. This reverts the changes and opens discussion whether the changes in the #1097 should be accepted, or reverted (by merging this PR)