Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshidan committed Aug 4, 2024
1 parent add3c7c commit 65f5a61
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 1 addition & 2 deletions bigquery/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,13 @@ impl ClientConfig {
}

fn bigquery_http_auth_config() -> google_cloud_auth::project::Config<'static> {
google_cloud_auth::project::Config::default().with_scopes(&crate::http::bigquery_client::SCOPES)
google_cloud_auth::project::Config::default().with_scopes(&http::bigquery_client::SCOPES)
}

fn bigquery_grpc_auth_config() -> google_cloud_auth::project::Config<'static> {
google_cloud_auth::project::Config::default()
.with_audience(crate::grpc::apiv1::conn_pool::AUDIENCE)
.with_scopes(&crate::grpc::apiv1::conn_pool::SCOPES)
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion bigquery/src/http/bigquery_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ pub(crate) mod test {
}

pub async fn create_client() -> (BigqueryClient, String) {
let tsp = DefaultTokenSourceProvider::new(Config::default().with_scopes(&SCOPES)).await.unwrap();
let tsp = DefaultTokenSourceProvider::new(Config::default().with_scopes(&SCOPES))
.await
.unwrap();
let cred = tsp.source_credentials.clone();
let ts = tsp.token_source();
let client = BigqueryClient::new(
Expand Down
2 changes: 1 addition & 1 deletion foundation/auth/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct Config<'a> {
use_id_token: bool,
}

impl <'a> Config<'a> {
impl<'a> Config<'a> {
pub fn scopes_to_string(&self, sep: &str) -> String {
match self.scopes {
Some(s) => s.iter().map(|x| x.to_string()).collect::<Vec<_>>().join(sep),
Expand Down
4 changes: 2 additions & 2 deletions spanner/tests/change_stream_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ impl TryFromStruct for DataChangeRecord {
async fn create_environment() -> Environment {
let ts = google_cloud_auth::token::DefaultTokenSourceProvider::new(
google_cloud_auth::project::Config::default()
.with_audience(&google_cloud_spanner::apiv1::conn_pool::AUDIENCE)
.with_scopes(&google_cloud_spanner::apiv1::conn_pool::SCOPES)
.with_audience(google_cloud_spanner::apiv1::conn_pool::AUDIENCE)
.with_scopes(&google_cloud_spanner::apiv1::conn_pool::SCOPES),
)
.await
.unwrap();
Expand Down
4 changes: 3 additions & 1 deletion storage/src/http/service_account_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ mod test {
use crate::http::service_account_client::ServiceAccountClient;

async fn client() -> (ServiceAccountClient, String) {
let tsp = DefaultTokenSourceProvider::new(Config::default().with_scopes(&["https://www.googleapis.com/auth/cloud-platform"]))
let tsp = DefaultTokenSourceProvider::new(
Config::default().with_scopes(&["https://www.googleapis.com/auth/cloud-platform"]),
)
.await
.unwrap();
let email = tsp.source_credentials.clone().unwrap().client_email.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions storage/src/http/storage_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1448,8 +1448,8 @@ pub(crate) mod test {

async fn client() -> (StorageClient, String, String) {
let tsp = DefaultTokenSourceProvider::new(Config::default().with_scopes(&SCOPES))
.await
.unwrap();
.await
.unwrap();
let cred = tsp.source_credentials.clone();
let ts = tsp.token_source();
let client = StorageClient::new(
Expand Down

0 comments on commit 65f5a61

Please sign in to comment.