-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add external types CI check + config #183
Commits on Dec 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 21471c9 - Browse repository at this point
Copy the full SHA 21471c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0aab261 - Browse repository at this point
Copy the full SHA 0aab261View commit details -
key_pair: consistent inter-member whitespace
Previously this file had some places where members of a type were separated by whitespace, and some places where they weren't. In my experience it's more common to use whitespace here, and I think it reads better, so this commit standardizes on that (at least within key_pair.rs).
Configuration menu - View commit details
-
Copy full SHA for 8672d84 - Browse repository at this point
Copy the full SHA 8672d84View commit details -
error: add ExternalError extension trait
This trait offers a way to convert errors from dependencies into `rcgen::Error` instances without manually mapping the error in each instance, or leaking the error type into the public API with a `From<x> for Error` impl.
Configuration menu - View commit details
-
Copy full SHA for 28272ad - Browse repository at this point
Copy the full SHA 28272adView commit details -
error: avoid leaking ring::error::KeyRejected into api
Having `From<ring::error::KeyRejected>` defined on the public `Error` type means that the `*ring*` type leaks into rcgen's public API, complicating semver incompatible updates. This commit takes the simple approach of using the crate-internal `ExternalError` trait to convert from the `*ring*` error type to our generic rcgen `Error::RingKeyRejected` type as needed. This allows the `From` impl on `Error` to be removed, fixing the type leak.
Configuration menu - View commit details
-
Copy full SHA for b2d5e68 - Browse repository at this point
Copy the full SHA b2d5e68View commit details -
error: avoid leaking ring::error::Unspecified into api
Having `From<ring::error::Unspecified>` defined on the public `Error` type means that the `*ring*` type leaks into rcgen's public API, complicating semver incompatible updates. This commit updates the sites that previously used this trait to instead use a crate internal `ExternalError` trait implementation to map to the generic rcgen `Error::RingUnspecified` err. This allows the `From` impl on `Error` to be removed, fixing the type leak.
Configuration menu - View commit details
-
Copy full SHA for c584880 - Browse repository at this point
Copy the full SHA c584880View commit details -
error: avoid leaking pem::PemError into api
Having `From<pem::PemError>` defined on the public `Error` type means that the `pem` type leaks into rcgen's public API, complicating semver incompatible updates. This commit updates the sites that previously used this trait to use the crate internal `ExternalError` extension trait to map the `PemError` err to the generic rcgen `Error::PemError` err. Additionally, the `rcgen::Error::PemError` variant is changed to hold a `String` with the `pem::PemError` error string instead of the type itself. This allows the `From` impl on `Error` to be removed, fixing the type leak.
Configuration menu - View commit details
-
Copy full SHA for a53aa2f - Browse repository at this point
Copy the full SHA a53aa2fView commit details -
ci: add cargo-check-external-types, config
This commit adds configuration and a CI task for checking that no types from dependencies are accidentally leaked through the Rcgen public API unintentionally. The previous commits in this branch fixed the `*ring*` type leaks, so our configuration only has two white-listed types as of this branch: 1. `time::offset_date_time::OffsetDateTime` It's unclear whether usage of that type should be adjusted, so for now we explicitly allow-list it in the cargo-check-external-types config. We can deal with this type (or not) in the future. 2. `zeroize::Zeroize` We could probably avoid leaking this type by implementing `Drop` and calling `zeroize` on fields directly from the `drop` impl. In the meantime we add this type to the allow list.
Configuration menu - View commit details
-
Copy full SHA for 796ccc7 - Browse repository at this point
Copy the full SHA 796ccc7View commit details -
Cargo: rcgen v0.11.3 -> v0.12.0
This commit bumps the rcgen version from `0.11.3` to `0.12.0` to reflect there are breaking changes in `main`.
Configuration menu - View commit details
-
Copy full SHA for 17b0b50 - Browse repository at this point
Copy the full SHA 17b0b50View commit details -
This commit adds `cargo-semver-checks`[0] to CI. This tool helps detect when semver incompatible changes are being made without properly incrementing the `Cargo.toml` version. Note that this is necessary, but not sufficient, for ensuring semver compatibility. This tool is helpful, but not perfect, and can miss some breakages. [0]: https://github.com/obi1kenobi/cargo-semver-checks
Configuration menu - View commit details
-
Copy full SHA for 11f31a2 - Browse repository at this point
Copy the full SHA 11f31a2View commit details