mirror of
https://github.com/google/nomulus.git
synced 2025-07-14 06:55:20 +02:00
Rename DNL and SMDRL "login" to "loginAndPassword"
They are passed around in the format username:password, whereas just saying "login" implies it's just a username and not necessarily also a secret password. Putting password in the variable name makes it obvious what this is and reduces the likelihood of anyone ever logging it or otherwise using it inappropriately. Note that this does not require data migrations as the actual key used to store the data in KMS remains unchanged. This is a follow-up to [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=231253964
This commit is contained in:
parent
0130f91830
commit
f0c677b18b
17 changed files with 65 additions and 62 deletions
|
@ -137,12 +137,12 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbDnlLogin() {
|
||||
public void test_getMarksdbDnlLoginAndPassword() {
|
||||
saveCleartextSecret("marksdb-dnl-login-string");
|
||||
|
||||
String marksdbDnlLogin = keyring.getMarksdbDnlLogin();
|
||||
String marksdbDnlLoginAndPassword = keyring.getMarksdbDnlLoginAndPassword();
|
||||
|
||||
assertThat(marksdbDnlLogin).isEqualTo("marksdb-dnl-login-stringmoo");
|
||||
assertThat(marksdbDnlLoginAndPassword).isEqualTo("marksdb-dnl-login-stringmoo");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -155,12 +155,12 @@ public class KmsKeyringTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_getMarksdbSmdrlLogin() {
|
||||
public void test_getMarksdbSmdrlLoginAndPassword() {
|
||||
saveCleartextSecret("marksdb-smdrl-login-string");
|
||||
|
||||
String marksdbSmdrlLogin = keyring.getMarksdbSmdrlLogin();
|
||||
String marksdbSmdrlLoginAndPassword = keyring.getMarksdbSmdrlLoginAndPassword();
|
||||
|
||||
assertThat(marksdbSmdrlLogin).isEqualTo("marksdb-smdrl-login-stringmoo");
|
||||
assertThat(marksdbSmdrlLoginAndPassword).isEqualTo("marksdb-smdrl-login-stringmoo");
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class KmsUpdaterTest {
|
|||
@Test
|
||||
public void test_setMultipleSecrets() {
|
||||
updater
|
||||
.setMarksdbDnlLogin("value1")
|
||||
.setMarksdbDnlLoginAndPassword("value1")
|
||||
.setIcannReportingPassword("value2")
|
||||
.setJsonCredential("value3")
|
||||
.update();
|
||||
|
@ -110,8 +110,8 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbDnlLogin() {
|
||||
updater.setMarksdbDnlLogin("value1").update();
|
||||
public void test_setMarksdbDnlLoginAndPassword() {
|
||||
updater.setMarksdbDnlLoginAndPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
"marksdb-dnl-login-string", "marksdb-dnl-login-string/foo", getCiphertext("value1"));
|
||||
|
@ -128,8 +128,8 @@ public class KmsUpdaterTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void test_setMarksdbSmdrlLogin() {
|
||||
updater.setMarksdbSmdrlLogin("value1").update();
|
||||
public void test_setMarksdbSmdrlLoginAndPassword() {
|
||||
updater.setMarksdbSmdrlLoginAndPassword("value1").update();
|
||||
|
||||
verifySecretAndSecretRevisionWritten(
|
||||
"marksdb-smdrl-login-string", "marksdb-smdrl-login-string/foo", getCiphertext("value1"));
|
||||
|
|
|
@ -52,9 +52,9 @@ public final class FakeKeyringModule {
|
|||
loadBytes(FakeKeyringModule.class, "pgp-private-keyring-registry.asc");
|
||||
private static final String ICANN_REPORTING_PASSWORD = "yolo";
|
||||
private static final String SAFE_BROWSING_API_KEY = "a/b_c";
|
||||
private static final String MARKSDB_DNL_LOGIN = "dnl:yolo";
|
||||
private static final String MARKSDB_DNL_LOGIN_AND_PASSWORD = "dnl:yolo";
|
||||
private static final String MARKSDB_LORDN_PASSWORD = "yolo";
|
||||
private static final String MARKSDB_SMDRL_LOGIN = "smdrl:yolo";
|
||||
private static final String MARKSDB_SMDRL_LOGIN_AND_PASSWORD = "smdrl:yolo";
|
||||
private static final String JSON_CREDENTIAL = "json123";
|
||||
|
||||
@Provides
|
||||
|
@ -111,8 +111,8 @@ public final class FakeKeyringModule {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getMarksdbSmdrlLogin() {
|
||||
return MARKSDB_SMDRL_LOGIN;
|
||||
public String getMarksdbSmdrlLoginAndPassword() {
|
||||
return MARKSDB_SMDRL_LOGIN_AND_PASSWORD;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,8 +121,8 @@ public final class FakeKeyringModule {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getMarksdbDnlLogin() {
|
||||
return MARKSDB_DNL_LOGIN;
|
||||
public String getMarksdbDnlLoginAndPassword() {
|
||||
return MARKSDB_DNL_LOGIN_AND_PASSWORD;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,7 @@ import org.mockito.Mock;
|
|||
@RunWith(JUnit4.class)
|
||||
public class TmchActionTestCase {
|
||||
|
||||
static final String MARKSDB_LOGIN = "lolcat:attack";
|
||||
static final String MARKSDB_LOGIN_AND_PASSWORD = "lolcat:attack";
|
||||
static final String MARKSDB_URL = "http://127.0.0.1/love";
|
||||
|
||||
@Rule public final AppEngineRule appEngine = AppEngineRule.builder().withDatastore().build();
|
||||
|
|
|
@ -31,7 +31,7 @@ public class TmchDnlActionTest extends TmchActionTestCase {
|
|||
private TmchDnlAction newTmchDnlAction() {
|
||||
TmchDnlAction action = new TmchDnlAction();
|
||||
action.marksdb = marksdb;
|
||||
action.marksdbDnlLogin = Optional.of(MARKSDB_LOGIN);
|
||||
action.marksdbDnlLoginAndPassword = Optional.of(MARKSDB_LOGIN_AND_PASSWORD);
|
||||
return action;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ public class TmchSmdrlActionTest extends TmchActionTestCase {
|
|||
private TmchSmdrlAction newTmchSmdrlAction() {
|
||||
TmchSmdrlAction action = new TmchSmdrlAction();
|
||||
action.marksdb = marksdb;
|
||||
action.marksdbSmdrlLogin = Optional.of("username:password");
|
||||
action.marksdbSmdrlLoginAndPassword = Optional.of("username:password");
|
||||
return action;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue