Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xxhZs committed Sep 29, 2024
1 parent 4dfbe7d commit caff755
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/connector/src/sink/big_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,12 @@ impl StorageWriterClient {
}

fn bigquery_grpc_auth_config() -> google_cloud_auth::project::Config<'static> {
google_cloud_auth::project::Config {
audience: Some(google_cloud_bigquery::grpc::apiv1::conn_pool::AUDIENCE),
scopes: Some(&google_cloud_bigquery::grpc::apiv1::conn_pool::SCOPES),
sub: None,
}
let mut auth_config = google_cloud_auth::project::Config::default();
auth_config =
auth_config.with_audience(google_cloud_bigquery::grpc::apiv1::conn_pool::AUDIENCE);
auth_config =
auth_config.with_scopes(&google_cloud_bigquery::grpc::apiv1::conn_pool::SCOPES);
auth_config
}
}

Expand Down
8 changes: 3 additions & 5 deletions src/connector/src/sink/google_pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,9 @@ impl GooglePubSubSinkWriter {
sink_from_name: String,
) -> Result<Self> {
let environment = if let Some(ref cred) = config.credentials {
let auth_config = project::Config {
audience: Some(apiv1::conn_pool::AUDIENCE),
scopes: Some(&apiv1::conn_pool::SCOPES),
sub: None,
};
let mut auth_config = project::Config::default();
auth_config = auth_config.with_audience(apiv1::conn_pool::AUDIENCE);
auth_config = auth_config.with_scopes(&apiv1::conn_pool::SCOPES);
let cred_file = CredentialsFile::new_from_str(cred).await.map_err(|e| {
SinkError::GooglePubSub(
anyhow!(e).context("Failed to create Google Cloud Pub/Sub credentials file"),
Expand Down

0 comments on commit caff755

Please sign in to comment.