mirror of
https://github.com/google/nomulus.git
synced 2025-07-20 09:46:03 +02:00
Remove November 1 check (#859)
This commit is contained in:
parent
e3d400958c
commit
700d612ff9
2 changed files with 0 additions and 81 deletions
|
@ -336,10 +336,7 @@ public class RegistrarSettingsAction implements Runnable, JsonActionRunner.JsonA
|
||||||
*/
|
*/
|
||||||
private boolean validateCertificate(String existingCertificate, String certificateString) {
|
private boolean validateCertificate(String existingCertificate, String certificateString) {
|
||||||
if ((existingCertificate == null) || !existingCertificate.equals(certificateString)) {
|
if ((existingCertificate == null) || !existingCertificate.equals(certificateString)) {
|
||||||
// TODO(sarhabot): remove this check after November 1, 2020
|
|
||||||
if (tm().getTransactionTime().isAfter(DateTime.parse("2020-11-01T00:00:00Z"))) {
|
|
||||||
certificateChecker.validateCertificate(certificateString);
|
certificateChecker.validateCertificate(certificateString);
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -376,84 +376,6 @@ class RegistrarSettingsActionTest extends RegistrarSettingsActionTestCase {
|
||||||
(builder, s) -> builder.setClientCertificate(s, clock.nowUtc()));
|
(builder, s) -> builder.setClientCertificate(s, clock.nowUtc()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
void testUpdate_clientCertificateWithViolationsBeforeNovemberSucceeds() {
|
|
||||||
// TODO(sarahbot): remove this test after November 1, 2020.
|
|
||||||
clock.setTo(DateTime.parse("2018-07-02T00:00:00Z"));
|
|
||||||
doTestUpdate(
|
|
||||||
Role.OWNER,
|
|
||||||
Registrar::getClientCertificate,
|
|
||||||
CertificateSamples.SAMPLE_CERT,
|
|
||||||
(builder, s) -> builder.setClientCertificate(s, clock.nowUtc()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testUpdate_otherFieldsWhenClientCertificateWithViolationsAlreadyExistedSucceeds() {
|
|
||||||
// TODO(sarahbot): remove this test after November 1, 2020.
|
|
||||||
|
|
||||||
// The frontend will always send the entire registrar entity back for an update, so the checks
|
|
||||||
// on the certificate should only run if a new certificate is being uploaded. All other updates
|
|
||||||
// after November 1st should still succeed even if a bad certificate is stored.
|
|
||||||
|
|
||||||
// Set a bad certificate before checks on uploads are enforced
|
|
||||||
clock.setTo(DateTime.parse("2018-07-02T00:00:00Z"));
|
|
||||||
Registrar existingRegistrar = loadRegistrar(CLIENT_ID);
|
|
||||||
existingRegistrar =
|
|
||||||
existingRegistrar
|
|
||||||
.asBuilder()
|
|
||||||
.setClientCertificate(CertificateSamples.SAMPLE_CERT, clock.nowUtc())
|
|
||||||
.build();
|
|
||||||
persistResource(existingRegistrar);
|
|
||||||
|
|
||||||
// Update the other registrar fields after enforcement begins should succeed
|
|
||||||
clock.setTo(DateTime.parse("2020-11-02T00:00:00Z"));
|
|
||||||
Map<String, Object> args = Maps.newHashMap(loadRegistrar(CLIENT_ID).toJsonMap());
|
|
||||||
args.put("url", "test.url");
|
|
||||||
args.put("phoneNumber", "+1.1234567890");
|
|
||||||
Map<String, Object> response =
|
|
||||||
action.handleJsonRequest(
|
|
||||||
ImmutableMap.of(
|
|
||||||
"op", "update",
|
|
||||||
"id", CLIENT_ID,
|
|
||||||
"args", args));
|
|
||||||
|
|
||||||
assertThat(response).containsEntry("status", "SUCCESS");
|
|
||||||
assertMetric(CLIENT_ID, "update", "[OWNER]", "SUCCESS");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testUpdate_clientCertificateWithViolationsAlreadyExistedSucceeds() {
|
|
||||||
// TODO(sarahbot): remove this test after November 1, 2020.
|
|
||||||
|
|
||||||
// The frontend will always send the entire registrar entity back for an update, so the checks
|
|
||||||
// on the certificate should only run if it is a new certificate
|
|
||||||
|
|
||||||
// Set a bad certificate before checks on uploads are enforced
|
|
||||||
clock.setTo(DateTime.parse("2018-07-02T00:00:00Z"));
|
|
||||||
Registrar existingRegistrar = loadRegistrar(CLIENT_ID);
|
|
||||||
existingRegistrar =
|
|
||||||
existingRegistrar
|
|
||||||
.asBuilder()
|
|
||||||
.setClientCertificate(CertificateSamples.SAMPLE_CERT, clock.nowUtc())
|
|
||||||
.build();
|
|
||||||
persistResource(existingRegistrar);
|
|
||||||
|
|
||||||
// Update with the same certificate after enforcement starts
|
|
||||||
clock.setTo(DateTime.parse("2020-11-02T00:00:00Z"));
|
|
||||||
Map<String, Object> args = Maps.newHashMap(loadRegistrar(CLIENT_ID).toJsonMap());
|
|
||||||
args.put("clientCertificate", CertificateSamples.SAMPLE_CERT);
|
|
||||||
Map<String, Object> response =
|
|
||||||
action.handleJsonRequest(
|
|
||||||
ImmutableMap.of(
|
|
||||||
"op", "update",
|
|
||||||
"id", CLIENT_ID,
|
|
||||||
"args", args));
|
|
||||||
|
|
||||||
assertThat(response).containsEntry("status", "SUCCESS");
|
|
||||||
assertMetric(CLIENT_ID, "update", "[OWNER]", "SUCCESS");
|
|
||||||
assertNoTasksEnqueued("sheet");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testUpdate_clientCertificateWithViolationsFails() {
|
void testUpdate_clientCertificateWithViolationsFails() {
|
||||||
clock.setTo(DateTime.parse("2020-11-02T00:00:00Z"));
|
clock.setTo(DateTime.parse("2020-11-02T00:00:00Z"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue