mirror of
https://github.com/google/nomulus
synced 2026-02-10 23:10:39 +00:00
Add Cloud SQL configs for nomulus tool (#288)
We will use a different user for nomulus tool to connect to Cloud SQL. This PR added corresponding configurations for that.
This commit is contained in:
@@ -55,6 +55,15 @@ public class KmsKeyringTest {
|
||||
assertThat(cloudSqlPassword).isEqualTo("cloud-sql-password-stringmoo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getToolsCloudSqlPassword() throws Exception {
|
||||
saveCleartextSecret("tools-cloud-sql-password-string");
|
||||
|
||||
String toolsCloudSqlPassword = keyring.getToolsCloudSqlPassword();
|
||||
|
||||
assertThat(toolsCloudSqlPassword).isEqualTo("tools-cloud-sql-password-stringmoo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getRdeSigningKey() throws Exception {
|
||||
saveKeyPairSecret("rde-signing-public", "rde-signing-private");
|
||||
|
||||
@@ -99,6 +99,16 @@ public class KmsUpdaterTest {
|
||||
"cloud-sql-password-string", "cloud-sql-password-string/foo", getCiphertext("value1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_setToolsCloudSqlPassword() {
|
||||
updater.setToolsCloudSqlPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
"tools-cloud-sql-password-string",
|
||||
"tools-cloud-sql-password-string/foo",
|
||||
getCiphertext("value1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_setIcannReportingPassword() {
|
||||
updater.setIcannReportingPassword("value1").update();
|
||||
|
||||
@@ -57,6 +57,7 @@ public final class FakeKeyringModule {
|
||||
private static final String MARKSDB_SMDRL_LOGIN_AND_PASSWORD = "smdrl:yolo";
|
||||
private static final String JSON_CREDENTIAL = "json123";
|
||||
private static final String CLOUD_SQL_PASSWORD = "cloudsqlpw";
|
||||
private static final String TOOLS_CLOUD_SQL_PASSWORD = "toolscloudsqlpw";
|
||||
|
||||
@Provides
|
||||
public Keyring get() {
|
||||
@@ -86,6 +87,11 @@ public final class FakeKeyringModule {
|
||||
return CLOUD_SQL_PASSWORD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getToolsCloudSqlPassword() {
|
||||
return TOOLS_CLOUD_SQL_PASSWORD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PGPPublicKey getRdeStagingEncryptionKey() {
|
||||
return rdeStagingKey.getPublicKey();
|
||||
|
||||
Reference in New Issue
Block a user