-
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
Changed Proof (Verifier) API for checking presentation status #770
Conversation
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
e8d10eb
to
9bb07b7
Compare
… rename enum variants Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
e79b011
to
a93f463
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
…ved proofStatus from result set) Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
a93f463
to
c57fa7c
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
5cd84f6
to
0a9bf2e
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>
Codecov Report
@@ Coverage Diff @@
## main #770 +/- ##
==========================================
+ Coverage 54.64% 54.69% +0.04%
==========================================
Files 380 381 +1
Lines 36762 36858 +96
Branches 8104 8124 +20
==========================================
+ Hits 20089 20159 +70
- Misses 10690 10702 +12
- Partials 5983 5997 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 10 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…rapper, unify method names 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>
aries_vcx/src/protocols/proof_presentation/verifier/states/finished.rs
Outdated
Show resolved
Hide resolved
aries_vcx/src/protocols/proof_presentation/verifier/states/finished.rs
Outdated
Show resolved
Hide resolved
aries_vcx/src/protocols/proof_presentation/verifier/states/finished.rs
Outdated
Show resolved
Hide resolved
aries_vcx/src/protocols/proof_presentation/verifier/verification_status.rs
Outdated
Show resolved
Hide resolved
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] | ||
pub struct FinishedState { | ||
pub presentation_request: Option<PresentationRequest>, | ||
pub presentation: Option<Presentation>, | ||
pub status: Status, | ||
pub revocation_status: Option<RevocationStatus>, | ||
#[serde( | ||
default = "PresentationVerificationStatus::Unavailable", |
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.
I assume this is why you gave the Unavailable
variant parenthesis? How about we rather implement Default
for PresentationVerificationStatus
and use
#[serde(default, ...)]
here?
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.
I removed empty tuple parameter on Unavailable
because it was causing issue with de/serialization - it ended up being serialized as
{ ... "verification_status": { "Unavailable": []} }
and even failed to be deserialized - not sure but looked like serde bug.
So anyway, I changed, though not exactly as you suggested; instead I refer to function verification_status_unavailable
as default builder in this case. Since it's only local case where we need this default, I think it's not appropriate global default for the enum.
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.
I don't think it's a serde bug. Why would the unit type be present in the Unavailable
variant?
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.
Well I would expect that if a structure is serialized, it would be successfully deserialized back. Perhaps it was related to the custom deserialization?
Anyway, it doesn't matter anymore.
The question now is if you guys are fine with current solution default = "verification_status_unavailable"
af0b1ba
to
3a3a0a7
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
3a3a0a7
to
a4a9e59
Compare
aries_vcx/src/protocols/proof_presentation/verifier/verification_status.rs
Outdated
Show resolved
Hide resolved
aries_vcx/src/protocols/proof_presentation/verifier/states/finished.rs
Outdated
Show resolved
Hide resolved
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
aries_vcx/src/protocols/proof_presentation/verifier/verification_status.rs
Outdated
Show resolved
Hide resolved
aries_vcx/src/protocols/proof_presentation/verifier/states/finished.rs
Outdated
Show resolved
Hide resolved
686b944
to
005fda6
Compare
Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
005fda6
to
3203442
Compare
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.
LGTM
…s undefined Signed-off-by: Patrik Stas <patrik.stas@absa.africa>
so nope, |
Short summary
0.53.0
, however won't be anymore in the subsequent release0.54.0
- simple migration strategy is providedChanges
aries-vcx
fn presentation_status(&self) -> Status
removed - it returned a result as a combination of revocation status and aries state.replaced by new
semantically returning the same result.
Other way to look at it is that
get_revocation_status()
was removed andpresentation_status() / get_presentation_status()
was changed to yield similar result asget_revocation_status
did.Changes
aries-vcx
InternalsRevocationStatus
enum by new enumPresentationVerificationStatus
.PresentationVerificationStatus
is backwards compatible, so there's a mapping of old values such asRevoked
to new valueInvalid
etc.FinishedState
previously maintained the information asOption<RevocationStatus>
whereas now it keepsPresentationVerificationStatus
and the new enum contains variantUnavailable
, so we don't need theOption
. This makes it bit nicer to work with as there's less destructuringnull
or missing value will deserialize toPresentationVerificationStatus::Unavailable
revocation_status
toverification_status
, however also enable deserialization from the originalrevocation_status
to enable backward compatibilityChanges
libvcx_core
aries_vcx
eg.get_revocation_status
get_presentation_verification_status
changed, as this function now simply returns value ofPresentationVerificationStatus
(as opposed to previous convoluted behaviour of that function).Changes
libvcx
, ios+java wrappersvcx_get_proof_msg
so it returns presentation message as the name suggests (removed value ofget_presentation_verification_status
from the result tuple)Migration
This slightly changes format of serialized (Verifier) Proof state machines, however still supports old format for reading in the next release
0.53.0
. The support for reading serialized Proof created before0.53.0
will be dropped in0.54.0
. If you wish to maintain ability to these older state machines, you will need to re-serialize state machine with0.53.0
release, eg. (example in JS)Summary of the API after changes:
Forgetting about the delta, this is the final state:
Verifiers' Proof has 2 main methods to determine state
pub fn get_state(&self) -> VerifierState
- returns the Aries state from enum:pub fn get_verification_status(&self) -> PresentationVerificationStatus
- returns state of presentation verification, which can be one of following variants: