Add the ability to provide credential JSON file to the nomulus tool

This allows us to run nomulus tool programmatically on environments that do not
allow the 3-legged OAuth authentication flow.

The provided JSON file corresponds to a service account, which must have
GAE admin permission and whose client ID must be whitelisted in the config
file.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=226008337
This commit is contained in:
jianglai 2018-12-18 09:25:06 -08:00 committed by Michael Muller
parent 40b05ffb3c
commit 27b6231053
5 changed files with 76 additions and 20 deletions

View file

@ -14,6 +14,7 @@
package google.registry.tools;
import dagger.BindsInstance;
import dagger.Component;
import google.registry.bigquery.BigqueryModule;
import google.registry.config.CredentialModule.LocalCredentialJson;
@ -36,6 +37,8 @@ import google.registry.util.AppEngineServiceUtilsImpl.AppEngineServiceUtilsModul
import google.registry.util.SystemClock.SystemClockModule;
import google.registry.util.SystemSleeper.SystemSleeperModule;
import google.registry.whois.WhoisModule;
import javax.annotation.Nullable;
import javax.inject.Named;
import javax.inject.Singleton;
/**
@ -113,5 +116,12 @@ interface RegistryToolComponent {
@LocalCredentialJson
String googleCredentialJson();
}
@Component.Builder
interface Builder {
@BindsInstance
Builder credentialFilename(@Nullable @Named("credentialFileName") String credentialFilename);
RegistryToolComponent build();
}
}