-
Notifications
You must be signed in to change notification settings - Fork 152
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
Implement Message
for EvidenceKind
#3605
Conversation
Previously `EvidenceMessage` was a proxy to decode the `EvidenceKind` enum. This resulted in clients needing to first attempt to decode as `EvidenceMessage` and then fall back to `VerificationReport`. Now the logic of decoding `VerificationReport` versus `DcapEvidence` is wrapped in the `Message` implementation of `EvidenceKind`.
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
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 I have a super clear understanding of how this gets used.
How does this look in a .proto
file or non-Rust code that wants to look at the report?
Use constant of `TAG_DCAP_EVIDENCE` instead of the number `4` directly Co-authored-by: Eran Rundstein <[email protected]>
Sorry, that context wasn't really provided. Where this proposed change comes into play, is in 2 places:
The first use case is temporary and will only need to persist for clients to ease the transition from For watcher, I think it will need to persist indefinitely. It may be that we could migrate the entry in the database similar to what Fog Report is doing, mobilecoin/fog/sql_recovery_db/src/lib.rs Line 1222 in f48e226
Fog report didn't need special logic as it's an ephemeral entry that will be changed on service restart. |
Thanks for the detailed explanation! I like the thought of not having this kind of hack stick around forever, so I think a migration for the watcher to use a oneof field would be beneficial. |
Previously `Message` was implemented for `EvidenceKind`. In order to reduce the possibility that someone tries to use `EvidenceKind` directly in a protobuf message, the encoding and decoding between `VerificationReport` and `DcapEvidence` has been moved to dedicated methods on the `EvidenceKind`.
Previously
EvidenceMessage
was a proxy to decode theEvidenceKind
enum. This resulted in clients needing to first attempt to decode as
EvidenceMessage
and then fall back toVerificationReport
. Now thelogic of decoding
VerificationReport
versusDcapEvidence
is wrappedin the
Message
implementation ofEvidenceKind
.