From a2aab6818198fd5a32eca9231e9620aab590c512 Mon Sep 17 00:00:00 2001 From: Joseph Cosentino Date: Wed, 13 Sep 2023 14:55:43 -0700 Subject: [PATCH] chore: decrease min server cert validity (#402) --- .../clientdevices/auth/certificate/CertificatesConfig.java | 2 +- .../clientdevices/auth/certificate/CertificatesConfigTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfig.java b/src/main/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfig.java index 146c593b1..883fb2161 100644 --- a/src/main/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfig.java +++ b/src/main/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfig.java @@ -15,7 +15,7 @@ public class CertificatesConfig { private static final Logger LOGGER = LogManager.getLogger(CertificatesConfig.class); static final int MAX_SERVER_CERT_EXPIRY_SECONDS = 60 * 60 * 24 * 10; // 10 days - static final int MIN_SERVER_CERT_EXPIRY_SECONDS = 60 * 60 * 24 * 2; // 2 days + static final int MIN_SERVER_CERT_EXPIRY_SECONDS = 60; // 1 minute static final int MAX_CLIENT_CERT_EXPIRY_SECONDS = 60 * 60 * 24 * 10; // 10 days static final int MIN_CLIENT_CERT_EXPIRY_SECONDS = 60; // 1 minute static final int DEFAULT_SERVER_CERT_EXPIRY_SECONDS = 60 * 60 * 24 * 7; // 7 days diff --git a/src/test/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfigTest.java b/src/test/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfigTest.java index f12937b36..ad05ae3a6 100644 --- a/src/test/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfigTest.java +++ b/src/test/java/com/aws/greengrass/clientdevices/auth/certificate/CertificatesConfigTest.java @@ -53,7 +53,7 @@ public void GIVEN_largeServerCertValidity_WHEN_getServerCertValiditySeconds_THEN @Test public void GIVEN_smallServerCertValidity_WHEN_getServerCertValiditySeconds_THEN_returnsMinExpiry() { - configurationTopics.lookup(CertificatesConfig.PATH_SERVER_CERT_EXPIRY_SECONDS).withValue(60 * 60 * 24); // 1 day + configurationTopics.lookup(CertificatesConfig.PATH_SERVER_CERT_EXPIRY_SECONDS).withValue(30); assertThat(certificatesConfig.getServerCertValiditySeconds(), is(equalTo(CertificatesConfig.MIN_SERVER_CERT_EXPIRY_SECONDS))); }