Repository navigation
Pluggable Crypto / Update reqwest 0.13 - #707
Conversation
|
Ping? Would be nice to avoid having duplicate reqwest versions in downstream projects. |
|
I've given this another rebase, I think it's more blocked on review/maintainer capacity though? |
|
Maintainers, could someone take a look? Would be nice to avoid duplicate dependencies in downstream applications that are up to date with the rest of the ecosystem (and it's been 5 months since reqwest 0.13 was released). |
Tpt
left a comment
There was a problem hiding this comment.
Not a maintainer but I would love to see this MR get merged.
I allowed myself 3 suggestions.
| - name: Check no crypto crates | ||
| run: | ||
| cargo tree --features gcp-no-crypto,aws-no-crypto,azure-no-crypto,http-no-crypto \ | ||
| | grep -qE '\b(ring|openssl)\b' && { echo "❌ disallowed crate found"; exit 1; } || echo "✅ no disallowed crates" |
There was a problem hiding this comment.
I guess this test should also add aws-lc-rs?
| | grep -qE '\b(ring|openssl)\b' && { echo "❌ disallowed crate found"; exit 1; } || echo "✅ no disallowed crates" | |
| | grep -qE '\b(ring|openssl|aws-lc-rs)\b' && { echo "❌ disallowed crate found"; exit 1; } || echo "✅ no disallowed crates" |
| "user_agent" => Ok(Self::UserAgent), | ||
| _ => Err(super::Error::UnknownConfigurationKey { | ||
| store: "HTTP", | ||
| store: "http-no-crypto", |
There was a problem hiding this comment.
find/replace error?
| store: "http-no-crypto", | |
| store: "HTTP", |
| Ok(_) => Err(Error::MissingKey), | ||
| Err(source) => Err(Error::ReadPem { source }), | ||
| } | ||
| #[cfg(feature = "aws-lc-rs")] |
There was a problem hiding this comment.
hyper-nit (please ignore): moving the cfg switch inside of the function might help ensuring the signature does not diverge between aws-lc and rustls (same for the other functions)
|
Apologies this is still on my list, things have just been extremely busy at work and maintaining this and arrow-rs is no longer my day job 😅. I'll try to take a look this evening. |
| quick-xml = { version = "0.39.0", features = ["serialize", "overlapped-lists"], optional = true } | ||
| rand = { version = "0.10", default-features = false, features = ["std", "std_rng", "thread_rng"], optional = true } | ||
| reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-native-roots", "http2"], optional = true } | ||
| reqwest = { version = "0.13", default-features = false, features = ["http2"], optional = true } |
There was a problem hiding this comment.
Can I request we make a separate PR to upgrade the version of reqwest to 0.13
That way we won't tie the fate of that upgrade to the pluggable crypto stuff (and it will maek the PR easier / faster to review)
There was a problem hiding this comment.
Unfortunately the reqwest upgrade ends up tied to this, because there were changes to the way reqwest handles encryption
|
Given it looks like we will make a new major version anyways I think it would be good to try and update reqwest as well |
kevinjqliu
left a comment
There was a problem hiding this comment.
I think *-custom would be clearer than *-no-crypto.
From a user’s perspective, aws-no-crypto, gcp-no-crypto, and azure-no-crypto sound like the stores can operate without crypto. But these stores may still need crypto for request signing, signed URLs, service-account JWTs, SAS signing, etc.
The feature really means: enable the store without selecting object_store’s default crypto provider.
*-custom better matches that expectation:
aws,gcp,azure,http: normal/default pathaws-custom,gcp-custom,azure-custom,http-custom: advanced path for users who want to choose their own crypto/TLS setupcrypto-aws-lc,crypto-ring: explicit provider choices
Example:
# default path
object_store = { features = ["aws"] }
# custom provider setup
object_store = { features = ["aws-custom", "crypto-ring", "tls-rustls"] }This keeps the existing feature names for normal users, while making the advanced path match the actual use case: customization, not disabling crypto.
|
Create an issue to facilitate with discussion on feature naming |
| default = ["fs"] | ||
| cloud = ["serde", "serde_json", "quick-xml", "hyper", "reqwest", "reqwest/stream", "chrono/serde", "base64", "rand", "ring", "http-body-util", "form_urlencoded", "serde_urlencoded", "tokio"] | ||
| azure = ["cloud", "httparse"] | ||
| cloud-no-crypto = ["serde", "serde_json", "quick-xml", "hyper", "reqwest", "reqwest/stream", "chrono/serde", "base64", "rand","http-body-util", "form_urlencoded", "serde_urlencoded", "tokio"] |
There was a problem hiding this comment.
I think we should align the feature naming here with the optional reqwest work in #724.
Feel free to chime in on the discussion here: #744
Instead of adding a separate *-no-crypto naming pattern, I think *-base can be the common escape hatch for both optional transport and optional crypto:
cloud-base = shared cloud implementation without default reqwest or bundled crypto
aws-base = cloud-base + AWS/S3-specific implementation deps
azure-base = cloud-base + Azure-specific implementation deps
gcp-base = cloud-base + GCS-specific implementation deps
http-base = cloud-base + HTTP-specific implementation deps
reqwest = built-in reqwest HTTP transport
ring = bundled ring crypto provider
aws-lc-rs = bundled aws-lc-rs crypto provider
cloud = cloud-base + reqwest + default crypto provider
compatibility alias for the old cloud behavior
aws = aws-base + reqwest + default crypto provider
azure = azure-base + reqwest + default crypto provider
gcp = gcp-base + reqwest + default crypto provider
http = http-base + reqwest + default crypto provider
That gives users explicit composition:
# S3 implementation only; user provides HTTP connector and crypto provider
object_store = { default-features = false, features = ["aws-base"] }
# S3 implementation + built-in reqwest, but user controls crypto provider
object_store = { default-features = false, features = ["aws-base", "reqwest"] }
# S3 implementation + custom HTTP connector, but object_store provides bundled ring crypto
object_store = { default-features = false, features = ["aws-base", "ring"] }
# S3 implementation + built-in reqwest + explicit aws-lc-rs crypto provider
object_store = { default-features = false, features = ["aws-base", "reqwest", "aws-lc-rs"] }This keeps the default user path simple:
object_store = { features = ["aws"] }while making the advanced cases composable.
The remaining compatibility/default decision is whether the batteries-included features should keep ring as the default crypto provider for compatibility, or intentionally switch to aws-lc-rs.
There was a problem hiding this comment.
The remaining compatibility/default decision is whether the batteries-included features should keep ring as the default crypto provider for compatibility, or intentionally switch to aws-lc-rs.
My suggestion would be to follow reqwest and use aws-lc-rs. This way users of both object_store and reqwest do not end up with two crypto stacks.
|
As others have noted, this is going to conflict / need feature flag alignment with I recommend we try and merge #724 in first, and then merge this one up and clean up the flags / dependencies |
This is actually for users who wants to provide a custom HTTP client instead of |
I feel one difference is that actual customers will have their own Cargo.toml file where they can directly activate the features in the subcrates, so they won't be compiling just the object_store. So therefore I think the new CI check is invalid as it is verifying something that won't actually be done in practice. After some thought, I think a better way to test these features would be to create some targeted examples that are not part of the workspace and demonstrate (and verify they compile, etc) how to do the various usecases. I will file a follow on ticket to track this work |
Yea thats a great idea. I'm happy to move on with the PR as is. I can follow up with documentations on using |
|
Thanks @kevinjqliu -- I filed a ticket to track improved testing: I will also fix the CI and add a comment link |
|
Okay -- hoping for a clean run now |
# Conflicts: # src/azure/builder.rs # src/azure/client.rs # src/azure/credential.rs # src/azure/mod.rs
|
merged up to resolve conflicts |
The merged CPK support (apache#742) computed the encryption key SHA-256 via ring::digest directly, which fails to compile on this branch since azure-base no longer depends on ring. Route it through the CryptoProvider abstraction (DigestAlgorithm::Sha256) instead. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
I am not entirely sure I got all the pluggable crypto hooked up correctly in the azure client, but assuming I can get CI to pass on this PR I am going to merge it in. We can work on improving / testing the pluggable crypto as a follow on PR |
|
I also filed a ticket to track adding more tests / docs for the pluggable crypto feature |
|
Let's get this in and iterate / test on main as this is the most potentially disruptive update. I will start preparing for a release with a version bump and release notes |
|
I had a small follow on doc PR: |
* Clarify aws-lc-rs feature docs and fix CI comment URL Follow-on documentation polish from the review of #707. - Document that the `aws-lc-rs` feature requires the user to also select an aws-lc-rs backend when the built-in `reqwest` transport is not enabled. - Fix the malformed github.com URL in the CI testing-matrix comment. Comment/documentation-only; no code or behavior changes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> * Update src/lib.rs Co-authored-by: Kevin Liu <[email protected]> * fmt --------- Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]> Co-authored-by: Kevin Liu <[email protected]>
NOTE: this is a rebased version of #585
Which issue does this PR close?
Rationale for this change
What changes are included in this PR?
Adds the ability to compile object_store without a dependency on ring, and instead use aws-lc-rs or a user-provided crypto implementation. Also changes the default to aws-lc-rs, which the ecosystem seems to be moving toward as a default.
Also upgrades
reqwestto 0.13, and makes it possible to configure reqwest with any TLS backend by selecting a-no-cryptofeature.Are there any user-facing changes?