mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02:00
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:
parent
40b05ffb3c
commit
27b6231053
5 changed files with 76 additions and 20 deletions
|
@ -19,7 +19,7 @@ import com.google.api.client.http.HttpRequestFactory;
|
|||
import com.google.api.client.http.javanet.NetHttpTransport;
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import google.registry.config.CredentialModule.LocalCredential;
|
||||
import google.registry.config.CredentialModule.DefaultCredential;
|
||||
import google.registry.config.RegistryConfig;
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,7 @@ class RequestFactoryModule {
|
|||
|
||||
@Provides
|
||||
static HttpRequestFactory provideHttpRequestFactory(
|
||||
@LocalCredential GoogleCredential credential) {
|
||||
@DefaultCredential GoogleCredential credential) {
|
||||
if (RegistryConfig.areServersLocal()) {
|
||||
return new NetHttpTransport()
|
||||
.createRequestFactory(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue