Skip to content
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 the type of LogEntry.body from String to Body #207

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

Neccolini
Copy link
Contributor

@Neccolini Neccolini commented Feb 2, 2023

Signed-off-by: Neccolini shun11202991@gmail.com

closes #150

Summary

Enable detailed information to be obtained when a LogEntry is retrieved, whereas previously only encoded String was available for the Body information.

Release Note

Documentation

Objective
To enable detailed information of LogEntry.body to be obtained when LogEntry is retrieved.
Change
In conjunction with changing the type of LogEntry.body to Body, I added default trait for Body and the structs and enums on which it depends, using derive macro.
 (Body, Spec, Signature, PublicKey, Data, AlgotithmKind, Hash)
In addition, in entries_api.rs, the use of serde_json::from_str was changed to the newly implemented LogEntry::from_str.
LogEntry::from_str uses HashMap with &str for key and serde_json::Value for value, and body is decoded.
Since a HashMap cannot be directly converted to a LogEntry, it is converted to a String with serde_json::to_string and then converted to a LogEntry with serde_json::from_str.

Signed-off-by: Neccolini <shun11202991@gmail.com>
@Neccolini
Copy link
Contributor Author

Errors in Clippy don't seem to be related to the changes.

https://github.com/sigstore/sigstore-rs/actions/runs/4072911131/jobs/7018309114#step:5:500

Copy link
Member

@flavio flavio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution

@flavio flavio merged commit 91dcdf0 into sigstore:main Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to parse Rekor LogEntry
2 participants