Configure client id and client secret in the config file

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=224158599
This commit is contained in:
jianglai 2018-12-05 08:30:23 -08:00
parent 6352b8a01a
commit 5f9aad90fc
10 changed files with 41 additions and 82 deletions

View file

@ -1258,15 +1258,18 @@ 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.
*/
/** OAuth client ID used by the nomulus tool. */
@Provides
@Config("clientSecretFilename")
public static String provideClientSecretFilename(RegistryConfigSettings config) {
return config.registryTool.clientSecretFilename;
@Config("toolsClientId")
public static String provideToolsClientId(RegistryConfigSettings config) {
return config.registryTool.clientId;
}
/** OAuth client secret used by the nomulus tool. */
@Provides
@Config("toolsClientSecret")
public static String provideToolsClientSecret(RegistryConfigSettings config) {
return config.registryTool.clientSecret;
}
@Provides
@ -1551,12 +1554,6 @@ 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.
*