-
Notifications
You must be signed in to change notification settings - Fork 29
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
pb-rust: Serde via prost + pbjson #95
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jleightcap
force-pushed
the
jl/pb-rust-protobuf
branch
2 times, most recently
from
July 19, 2023 18:39
bdb34ca
to
1af18d6
Compare
Encoding use sigstore_protobuf_specs::dev::sigstore::common::v1::HashOutput;
fn main() {
let ho = HashOutput { algorithm: 0i32, digest: vec![1u8] };
let serialized = serde_json::to_string(&ho).unwrap();
println!("{}", serialized);
} Serializes, $ cargo run
{"algorithm":0,"digest":[1]} |
Signed-off-by: Jack Leightcap <jack.leightcap@trailofbits.com>
jleightcap
force-pushed
the
jl/pb-rust-protobuf
branch
from
July 19, 2023 18:46
c8529b0
to
bb8c256
Compare
|
Signed-off-by: Jack Leightcap <jack.leightcap@trailofbits.com>
Signed-off-by: Jack Leightcap <jack.leightcap@trailofbits.com>
jleightcap
force-pushed
the
jl/pb-rust-protobuf
branch
from
July 19, 2023 21:37
025999d
to
b7d905d
Compare
kommendorkapten
previously approved these changes
Jul 20, 2023
Converting to draft, as Prost seems to have assumptions leading to miscellaneous serialization issues for protobuf. |
Signed-off-by: Jack Leightcap <jack.leightcap@trailofbits.com>
Summarizing issues with protobuf compilation/serialization:
|
Superseded by #118 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
sigstore-rs requires the serialization of compiled strcutures/enums, currently via Serde.
protoc_rust
types do not implementSerialize
/Deserialize
.protoc_rust
provides JSON support via internal reflection, however this approach is incompatible with existing sigstore-rs Serde derives, and proved incomplete with google.api (specificallygoogle.api.field_behavior
).prost
is an alternative builder to compile from.proto
. It has JSON serialization support via Serde.pb-json
provides Serde derives forgoogle.api
.Release Note
Documentation