Allow choice of Keyring to be configured in YAML

This uses a Dagger-provided map of Keyring implementations, with two currently available,
"KMS" and "Dummy". The active keyring is configured in the YAML file, so we no longer
require MOE directives to choose which one to use for internal/external builds.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=216898058
This commit is contained in:
mcilwain 2018-10-12 11:55:23 -07:00 committed by Ben McIlwain
parent 3bb525349f
commit bec7a91cfc
18 changed files with 124 additions and 30 deletions

View file

@ -1021,6 +1021,12 @@ public final class RegistryConfig {
return config.registryPolicy.greetingServerId;
}
@Provides
@Config("activeKeyring")
public static String provideKeyring(RegistryConfigSettings config) {
return config.keyring.activeKeyring;
}
/**
* The name to use for the Cloud KMS KeyRing containing encryption keys for Nomulus secrets.
*
@ -1030,13 +1036,13 @@ public final class RegistryConfig {
@Provides
@Config("cloudKmsKeyRing")
public static String provideCloudKmsKeyRing(RegistryConfigSettings config) {
return config.kms.keyringName;
return config.keyring.kms.keyringName;
}
@Provides
@Config("cloudKmsProjectId")
public static String provideCloudKmsProjectId(RegistryConfigSettings config) {
return config.kms.projectId;
return config.keyring.kms.projectId;
}
@Provides