mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 03:58:34 +02:00
Put the path to client_secrets in a config option.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148214513
This commit is contained in:
parent
68bac57da5
commit
acc7d19106
5 changed files with 65 additions and 21 deletions
|
@ -19,6 +19,7 @@ import static google.registry.config.ConfigUtils.makeUrl;
|
|||
import static google.registry.config.YamlUtils.getConfigSettings;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Supplier;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
@ -974,6 +975,17 @@ public final class RegistryConfig {
|
|||
return "/tos";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the OAuth2 client secrets file.
|
||||
*
|
||||
* <p>This is the name of a resource relative to the root of the class tree.
|
||||
*/
|
||||
@Provides
|
||||
@Config("clientSecretFilename")
|
||||
public static String provideClientSecretFilename(RegistryConfigSettings config) {
|
||||
return config.registryTool.clientSecretFilename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the help text to be used by RDAP.
|
||||
*
|
||||
|
@ -1174,6 +1186,12 @@ public final class RegistryConfig {
|
|||
return Duration.standardDays(CONFIG_SETTINGS.get().registryPolicy.contactAutomaticTransferDays);
|
||||
}
|
||||
|
||||
/** Provided for testing. */
|
||||
@VisibleForTesting
|
||||
public static String getClientSecretFilename() {
|
||||
return CONFIG_SETTINGS.get().registryTool.clientSecretFilename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Memoizes loading of the {@link RegistryConfigSettings} POJO.
|
||||
*
|
||||
|
|
|
@ -32,6 +32,7 @@ public class RegistryConfigSettings {
|
|||
public Rdap rdap;
|
||||
public Braintree braintree;
|
||||
public Kms kms;
|
||||
public RegistryTool registryTool;
|
||||
|
||||
/** Configuration options that apply to the entire App Engine project. */
|
||||
public static class AppEngine {
|
||||
|
@ -132,4 +133,9 @@ public class RegistryConfigSettings {
|
|||
public String publicKey;
|
||||
public Map<String, String> merchantAccountIdsMap;
|
||||
}
|
||||
|
||||
/** Configuration options for the registry tool. */
|
||||
public static class RegistryTool {
|
||||
public String clientSecretFilename;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -190,3 +190,8 @@ kms:
|
|||
# The name to use for the Cloud KMS KeyRing which will store encryption keys
|
||||
# for Nomulus secrets.
|
||||
keyringName: nomulus
|
||||
|
||||
# Configuration options relevant to the "nomulus" registry tool.
|
||||
registryTool:
|
||||
# Name of the client secret file used for authenticating with App Engine.
|
||||
clientSecretFilename: /google/registry/tools/resources/client_secret.json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue