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

optional feature to use aws-lc-rs rustls feature #1568

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

mcluseau
Copy link
Contributor

@mcluseau mcluseau commented Sep 6, 2024

Motivation

Fix #1562 .

Solution

Add a aws-lc-rs option feature and initialize the default CryptoProvider when building a kube::Client from a kube::Config.

Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

Thanks a lot for doing this. Looks very sensible. Quick comments. Needs DCO update anyway.

@mcluseau mcluseau force-pushed the fix-1562 branch 3 times, most recently from fd4887d to 559ebde Compare September 6, 2024 09:39
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

minor suggestion

@clux
Copy link
Member

clux commented Sep 6, 2024

All looks good to me, but the --all-features lib tests are complaining, not sure why all features is not calling the provider setup.

@clux clux added the changelog-add changelog added category for prs label Sep 6, 2024
@clux clux added this to the 0.94.0 milestone Sep 6, 2024
@mcluseau
Copy link
Contributor Author

mcluseau commented Sep 6, 2024

All looks good to me, but the --all-features lib tests are complaining, not sure why all features is not calling the provider setup.

oidc test is not using Client::try_from, so it's not getting the automatic aws-lc-rs (which is as I intended). I've added the manual setup.

@mcluseau mcluseau force-pushed the fix-1562 branch 4 times, most recently from 17cb1a6 to e48f338 Compare September 6, 2024 13:06
@mcluseau
Copy link
Contributor Author

mcluseau commented Sep 6, 2024

upon inspection of the error in kube-client::api::tests::entry_create_missing_object, I realized rustls::crypto::CryptoProvider::install_default sets the value of a once_cell::sync::OnceCell, so it only fails if a value is already there. Which means it's not an error for this usecase. Commented about that, removed the error I created.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.4%. Comparing base (4f78137) to head (893ec15).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1568     +/-   ##
=======================================
- Coverage   75.4%   75.4%   -0.0%     
=======================================
  Files         80      80             
  Lines       7290    7284      -6     
=======================================
- Hits        5495    5489      -6     
  Misses      1795    1795             
Files with missing lines Coverage Δ
kube-client/src/client/auth/oidc.rs 56.5% <100.0%> (+0.3%) ⬆️
kube-client/src/client/builder.rs 59.3% <100.0%> (+1.1%) ⬆️

... and 4 files with indirect coverage changes

@mcluseau
Copy link
Contributor Author

mcluseau commented Sep 6, 2024

I've added OpenSSL to the allowed licenses, we should be ok on every test here :)

@clux
Copy link
Member

clux commented Sep 6, 2024

I wouldn't worry about the deny failure, that should be from duplicate dependencies (transitively through the tree) and it's often flagging up things that's hard to do things about. The explicit license allow here I don't think is necessary.

@mcluseau
Copy link
Contributor Author

mcluseau commented Sep 6, 2024

OpenSSL appeared in aws-lc-rs-sys's Cargo.toml

error[rejected]: failed to satisfy license requirements
  ┌─ registry+https://github.com/rust-lang/crates.io-index#[email protected]:4:44
  │
4 │ license = "ISC AND (Apache-2.0 OR ISC) AND OpenSSL"
  │            ────────────────────────────────━━━━━━━
  │            │                               │
  │            │                               rejected: license is not explicitly allowed
  │            license expression retrieved via Cargo.toml `license`
  │
  ├ OpenSSL - OpenSSL License:
  ├   - FSF Free/Libre
  ├ aws-lc-sys v0.20.1

@clux
Copy link
Member

clux commented Sep 6, 2024

OpenSSL appeared in aws-lc-rs-sys's Cargo.toml

ew, i see :(

yeah, then your change makes sense here then.

@mcluseau
Copy link
Contributor Author

mcluseau commented Sep 6, 2024

here we are, only the duplicate dep error you mentioned remains :)

@clux
Copy link
Member

clux commented Sep 6, 2024

If you have time to make a ignore for it to make the branch green you could just list rustls-native-certs in the deny.toml and it should clean up :-)

@mcluseau
Copy link
Contributor Author

mcluseau commented Sep 6, 2024

applied, local test ok now!

$ grep deny justfile 
deny:
  cargo deny --workspace --all-features check bans licenses sources
[nwrk:~/git/gh/kube-rs/kube] fix-1562(+3/-2) ± cargo deny --workspace --all-features check bans licenses sources
warning[license-not-encountered]: license was not encountered
   ┌─ /home/nwrk/git/github/kube-rs/kube/deny.toml:30:6
   │
30 │     "Unicode-3.0",
   │      ━━━━━━━━━━━ unmatched license allowance

bans ok, licenses ok, sources ok

Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

TYVM!

@clux clux merged commit b7bdab9 into kube-rs:main Sep 6, 2024
16 checks passed
@mcluseau mcluseau deleted the fix-1562 branch September 6, 2024 15:03
@clux clux changed the title optional feature to use aws-lc-rs rustls feature optional feature to use aws-lc-rs rustls feature Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TLS auth with EcdsaP521 works with openssl but not with rustls
2 participants