mirror of
https://github.com/google/nomulus
synced 2026-09-11 10:36:25 +00:00
Add configurations for Cloud SQL secrets (#266)
This commit is contained in:
@@ -46,6 +46,15 @@ public class KmsKeyringTest {
|
||||
keyring = new KmsKeyring(new FakeKmsConnection());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getCloudSqlPassword() throws Exception {
|
||||
saveCleartextSecret("cloud-sql-password-string");
|
||||
|
||||
String cloudSqlPassword = keyring.getCloudSqlPassword();
|
||||
|
||||
assertThat(cloudSqlPassword).isEqualTo("cloud-sql-password-stringmoo");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_getRdeSigningKey() throws Exception {
|
||||
saveKeyPairSecret("rde-signing-public", "rde-signing-private");
|
||||
|
||||
@@ -91,6 +91,14 @@ public class KmsUpdaterTest {
|
||||
getCiphertext(KmsTestHelper.getPublicKey()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_setCloudSqlPassword() {
|
||||
updater.setCloudSqlPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
"cloud-sql-password-string", "cloud-sql-password-string/foo", getCiphertext("value1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_setIcannReportingPassword() {
|
||||
updater.setIcannReportingPassword("value1").update();
|
||||
|
||||
@@ -56,6 +56,7 @@ public final class FakeKeyringModule {
|
||||
private static final String MARKSDB_LORDN_PASSWORD = "yolo";
|
||||
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";
|
||||
|
||||
@Provides
|
||||
public Keyring get() {
|
||||
@@ -80,6 +81,11 @@ public final class FakeKeyringModule {
|
||||
final String sshPrivate = loadFile(FakeKeyringModule.class, "registry-unittest.id_rsa");
|
||||
|
||||
return new Keyring() {
|
||||
@Override
|
||||
public String getCloudSqlPassword() {
|
||||
return CLOUD_SQL_PASSWORD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PGPPublicKey getRdeStagingEncryptionKey() {
|
||||
return rdeStagingKey.getPublicKey();
|
||||
|
||||
Reference in New Issue
Block a user