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

Use cargo-check-external-types to control type leakage in public API #202

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

cpu
Copy link
Member

@cpu cpu commented Oct 18, 2023

Like rustls/rustls#1535, this branch brings the cargo-check-external-types tool to the webpki repo. This will help us catch unintended leaking of types from dependencies into the public API. One such occurrence is caught by the tool and fixed alongside adding it to CI.

This commit replaces the `From<untrusted::EndOfInput>` impl on the
exported `Error` type with a crate-private `der::end_of_input_err`
helper. This prevents `untrusted` from leaking into the webpki API
surface.
This commit adds a CI task to run cargo-check-external-types[0] with the
goal of ensuring we don't unintentionally leak types from deps (e.g.
`untrusted`) in our public API.

[0]: https://github.com/awslabs/cargo-check-external-types
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #202 (2851aa4) into main (5d17ef0) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #202   +/-   ##
=======================================
  Coverage   96.73%   96.73%           
=======================================
  Files          20       20           
  Lines        4749     4749           
=======================================
  Hits         4594     4594           
  Misses        155      155           
Files Coverage Δ
src/crl/types.rs 99.54% <100.00%> (ø)
src/der.rs 99.58% <100.00%> (+<0.01%) ⬆️
src/error.rs 46.55% <ø> (-2.63%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Cargo.toml Show resolved Hide resolved
@cpu cpu added this pull request to the merge queue Oct 18, 2023
Merged via the queue into rustls:main with commit 595ecd5 Oct 18, 2023
30 checks passed
@cpu cpu deleted the cpu-cargo-check-ext-types branch October 18, 2023 21:06
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.

2 participants