-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
deps: remove hyper-rustls/ring feature #1717
base: main
Are you sure you want to change the base?
Conversation
066cc7a
to
6f04610
Compare
6f04610
to
467eb1a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1717 +/- ##
=======================================
- Coverage 76.1% 76.1% -0.0%
=======================================
Files 84 84
Lines 7860 7862 +2
=======================================
Hits 5977 5977
- Misses 1883 1885 +2
🚀 New features to boost your workflow:
|
kube-client/src/client/auth/oauth.rs
Outdated
#[cfg(not(any( | ||
all( | ||
feature = "rustls-tls", | ||
any(feature = "ring", feature = "aws-lc-rs", feature = "webpki-roots") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we need (when using rustls);
- one of
aws-lc-rs
orring
webpki-roots
optional, but orthogonal to this choice (so probably does not need to be checked here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my previous comment.
let's try adding cfg-if to make it a bit clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can avoid this extra change and dependency, and keep all logic as we had it before by introducing the new compile error up to top level (257 in oidc.rs).
#[cfg(all(feature = "rustls-tls", not(any(feature = "ring", feature = "aws-lc-rs"))))]
compile_error!("At least one of ring or aws-lc-rs feature must be enabled to use rustls-tls feature");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mostly because the way it's indented now is also quite big and hard to extend, and we want to just bail out as soon as possible anyway.
besides, oidc.rs isn't even the client that is used for most things (that one comes from config_ext.rs + builder.rs and does the selection in tls.rs (which does not do this same if-else on providers).
467eb1a
to
e0f4a9a
Compare
no reason to include the "ring" crate if aws-lc-rs is being used. add a new "ring" feature (enabled by default, to avoid breaking existing users), that will enable hyper-rustls/ring only if needed. Signed-off-by: Eliad Peller <[email protected]>
e0f4a9a
to
375899d
Compare
Motivation
no reason to include the "ring" crate if aws-lc-rs is being used.
Solution
features are only additive, so they can't be removed once it's added (by any sub-crate).
avoid adding extra features that might not be used (e.g. in case of aws-lc-rs).
in order to make it optional we can add a new "ring" feature to the default features, so it can be avoided with
default-features = false
. however, i think letting the configure it as needed is a better approach.please update if you do prefer to add a new default feature-flag (or some other approach) and i'll adjust the patch.