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

Add tls-webpki-roots feature #87

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gcloud-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ doctest = false
[features]
default = ["tls-roots"]
tls-roots = ["tonic/tls-roots"]
tls-webpki-roots = ["tonic/tls-webpki-roots"]
rest = ["bytes"]
ccc-hosted-marketplace-v2 = []
google-actions-sdk-v2 = []
Expand Down Expand Up @@ -458,4 +459,4 @@ tag-prefix=""

[package.metadata.docs.rs]
all-features = false
features = ["rest", "tls-roots"]
features = ["rest", "tls-roots", "tls-webpki-roots"]
6 changes: 3 additions & 3 deletions gcloud-sdk/src/api_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ where
token_scopes
);

#[cfg(feature = "tls-roots")]
#[cfg(any(feature = "tls-roots", feature = "tls-webpki-roots"))]
let channel =
GoogleEnvironment::init_google_services_channel_with_native_roots(google_api_url)
.await?;

#[cfg(not(feature = "tls-roots"))]
#[cfg(not(any(feature = "tls-roots", feature = "tls-webpki-roots")))]
let channel = GoogleEnvironment::init_google_services_channel(google_api_url).await?;

let token_generator =
Expand Down Expand Up @@ -231,7 +231,7 @@ impl GoogleEnvironment {
.domain_name(domain_name)
}

#[cfg(feature = "tls-roots")]
#[cfg(any(feature = "tls-roots", feature = "tls-webpki-roots"))]
pub async fn init_google_services_channel_with_native_roots<S: AsRef<str>>(
api_url: S,
) -> Result<Channel, crate::error::Error> {
Expand Down