mirror of
https://github.com/google/nomulus.git
synced 2025-07-10 05:03:24 +02:00
Add configurations for Cloud SQL secrets (#266)
This commit is contained in:
parent
401653ad4a
commit
48d8b1274f
15 changed files with 95 additions and 8 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue