Skip to content

Implement Debug w/ detailed manifest for Reader #473

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

Merged
merged 6 commits into from
Jun 10, 2024

Conversation

ok-nick
Copy link
Contributor

@ok-nick ok-nick commented May 30, 2024

Changes in this pull request

  • Add Store field to ManifestStore to open access to all Store methods and allow constructing a ManifestStoreReport on the fly
  • Implement Debug for Reader, providing the user with detailed debug information about the manifest (effectively exposing ManifestStoreReport in the unstable API)

Notes

  • The Reader already implements Display, providing user-friendly information about the manifest, whereas Debug provides detailed info via ManifestStoreReport.
  • How can we expose ManifestStoreReport::dump_tree and ManifestStoreReport::cert_chain in the unstable API?
    • A method for retrieving certificates from the manifest, Manifest::certificates, could be useful

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

@ok-nick ok-nick added the enhancement New feature or request label May 30, 2024
@ok-nick ok-nick requested a review from mauricefisher64 May 30, 2024 19:34
@ok-nick ok-nick changed the title Implement Serialize and custom Debug for Reader Implement Debug w/ detailed manifest for Reader Jun 3, 2024
@ok-nick ok-nick force-pushed the ok-nick/reader_reports branch from 33eb8e7 to 81b428b Compare June 3, 2024 14:13
@ok-nick
Copy link
Contributor Author

ok-nick commented Jun 3, 2024

Adding Store to ManifestStore causes a breaking change since ManifestStore no longer implements UnwindSafe nor RefUnwindSafe. This is because Store contains a trait object, which cannot guarantee unwind safety unless the trait object requires the traits mentioned or we mask it with AssertUnwindSafe. See rust-lang/rust#65717, rust-lang/rust#40628, and rust-lang/rfcs#3260.

@ok-nick ok-nick force-pushed the ok-nick/reader_reports branch from 0931c35 to 34afb35 Compare June 5, 2024 17:36
@ok-nick ok-nick force-pushed the ok-nick/reader_reports branch from 34afb35 to 5cefa62 Compare June 5, 2024 17:38
@ok-nick
Copy link
Contributor Author

ok-nick commented Jun 5, 2024

For now we require TrustHandlerConfig to be UnwindSafe and RefUnwindSafe, but ideally TrustHandlerConfig would either be (1) a generic on Store or (2) each impl is gated behind a feature flag for each platform.

Copy link
Collaborator

@mauricefisher64 mauricefisher64 left a comment

Choose a reason for hiding this comment

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

👍

@mauricefisher64 mauricefisher64 merged commit 2ba7c8b into main Jun 10, 2024
22 checks passed
@mauricefisher64 mauricefisher64 deleted the ok-nick/reader_reports branch June 10, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants