-
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
Remove didcore generics, update did-exchange #1097
Remove didcore generics, update did-exchange #1097
Conversation
d0fdfcd
to
7d5a064
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## diddoc/remove-generics #1097 +/- ##
======================================================
Coverage 0.05% 0.05%
======================================================
Files 480 481 +1
Lines 24234 24180 -54
Branches 4373 4367 -6
======================================================
Hits 13 13
+ Misses 24220 24166 -54
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. |
5f29bb8
to
9a5e54a
Compare
Is this really ready for review? It doesn't seem to be...? |
@mirgee yes, what am I missing? |
I didn't reworked all of the errors stuff we discussed. I'd like to do that as separate PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some brief comments, flagging the points discussed verbally in a private conversation.
aries/aries_vcx/src/protocols/did_exchange/state_machine/helpers.rs
Outdated
Show resolved
Hide resolved
aries/aries_vcx/src/protocols/did_exchange/state_machine/requester/request_sent/mod.rs
Outdated
Show resolved
Hide resolved
did_core/did_methods/did_peer/src/peer_did/numalgos/numalgo2/mod.rs
Outdated
Show resolved
Hide resolved
7d5a064
to
354362b
Compare
7e5ef51
to
b70fb26
Compare
0343d55
to
bb408ba
Compare
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>
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>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
…only used for destructuring pattern) 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>
bb408ba
to
de15fdd
Compare
354362b
to
4a3a300
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
de15fdd
to
1550c5e
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGETM 👍
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
4668d6d
to
49b3a10
Compare
* 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>
DidDocumentSovError
get_service_of_type
,get_key_agreement_of_type
- this is handy upon using the did doc for didcomm. For example in agent code, weDIDCommV1
typeid
get_key_agreement_of_type
to resolve former "recipient keys", but now using first compatible key fromkey_agreement
sectionDidExchangeRequester<RequestSent>::receive_response
peer_did.to_did_doc()
. Make theto_did_doc
available only locally withinpeer_did
crateEncryptionEnvelope ::create
such that it requires additional argumenttheir_service_id: &Uri
. This is because msg encryption should be intended for specific service, using its routing keys. Without specifying the service,EncryptionEnvelope
would need to make additional assumption about which service to encrypt for.DidDocumentBuilderError
enumeration - merge various decoding error variants into singleKeyDecodingError
ExtraFieldsDidComm*
types insidedid_doc
crate. Replace its custom builders byTypedBuilder
annotations.OneOrList
fromDidDocument
andService
consumers. However this is not entirely possible without giving up on certain properties. In order fordid_peer
to abbraviate and de-abbreviate service back to its original form,did_peer
crates need to work with "representation aware"OneOrList
, rather thanVector
.ServiceDidCommV1
,ServiceDidCommV2
to hold single, hardecoded, value oftypes
. The type itself represents DidCore Service object of particular DidCore servicetype
value, therefore it makes no sense for this object to possibly hold list oftype
values, neither to hold value didcore servicetype
different than the Rust type inherently represents.ServiceDidCommV1
,ServiceDidCommV2
and related structures to separate crate, as these previously resided indid_doc_sov
crate. The main purpose of that crate was previously to fill-in the underlying generics into concrete types. This would no longer be the purpose of the crate - these "concrete type" service types are now rather just supporting structures for particular use-cases (1. building service objects of specific type; 2. converting generalService
of knowntype
to its respective Rust type representation). Hence I see now much less justification to take these out ofdid_doc
crate.id
,did:peer:3.S.*
is valid DID too.id
value, if it was originally set.