-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rustls dependency optional by introducing "service_account" feature
Now, service_account code must be (implicitly) enabled. Asked for in feature #168
- Loading branch information
Showing
5 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
// Copyright (c) 2016 Google Inc ([email protected]). | ||
// | ||
// Refer to the project root for licensing information. | ||
#[cfg(feature = "service_account")] | ||
use crate::service_account::ServiceAccountKey; | ||
use crate::types::{ApplicationSecret, ConsoleApplicationSecret}; | ||
|
||
|
@@ -39,6 +40,7 @@ pub fn parse_application_secret<S: AsRef<[u8]>>(secret: S) -> io::Result<Applica | |
|
||
/// Read a service account key from a JSON file. You can download the JSON keys from the Google | ||
/// Cloud Console or the respective console of your service provider. | ||
#[cfg(feature = "service_account")] | ||
pub async fn read_service_account_key<P: AsRef<Path>>(path: P) -> io::Result<ServiceAccountKey> { | ||
let key = tokio::fs::read(path).await?; | ||
parse_service_account_key(key) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters