mirror of
https://github.com/google/nomulus.git
synced 2025-08-11 12:09:39 +02:00
Use @DefaultCredential for Cloud API access in GAE
This change completes the switch to @DefaultCredential for all use cases in GAE. Impacted modules: - IcannReporting - CreateCdnsTld command - LoadSnapshot command. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213511730
This commit is contained in:
parent
9bcd5579ef
commit
961e5cc7c7
20 changed files with 184 additions and 226 deletions
|
@ -16,6 +16,8 @@ package google.registry.tools;
|
|||
|
||||
import com.beust.jcommander.ParametersDelegate;
|
||||
import google.registry.bigquery.BigqueryConnection;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Provider;
|
||||
|
||||
/** A {@link Command} that uses the bigquery client API. */
|
||||
abstract class BigqueryCommand implements Command {
|
||||
|
@ -28,9 +30,12 @@ abstract class BigqueryCommand implements Command {
|
|||
/** Connection object for interacting with the Bigquery API. */
|
||||
private BigqueryConnection bigquery;
|
||||
|
||||
@Inject Provider<BigqueryConnection.Builder> bigQueryConnectionBuilderProvider;
|
||||
|
||||
@Override
|
||||
public void run() throws Exception {
|
||||
try (BigqueryConnection autoClosingBigquery = bigqueryParameters.newConnection()) {
|
||||
try (BigqueryConnection autoClosingBigquery =
|
||||
bigqueryParameters.newConnection(bigQueryConnectionBuilderProvider.get())) {
|
||||
bigquery = autoClosingBigquery;
|
||||
runWithBigquery();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue