From 567f51bf08ff63a0038e0127b4f5abc618c8f770 Mon Sep 17 00:00:00 2001 From: Sean Lin Date: Thu, 12 Sep 2019 10:49:53 -0700 Subject: [PATCH] Fix JWT secret file path (#140) --- gradle.properties | 2 +- src/main/java/com/nike/cerberus/ConfigConstants.java | 2 +- src/main/java/com/nike/cerberus/store/ConfigStore.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index a8a11700..7fa3aaf9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ group=com.nike artifactId=cerberus-lifecycle-cli -version=4.11.0 +version=4.11.1 diff --git a/src/main/java/com/nike/cerberus/ConfigConstants.java b/src/main/java/com/nike/cerberus/ConfigConstants.java index 7f24a560..da47e139 100644 --- a/src/main/java/com/nike/cerberus/ConfigConstants.java +++ b/src/main/java/com/nike/cerberus/ConfigConstants.java @@ -33,7 +33,7 @@ public class ConfigConstants { public static final String CERT_PART_PUBKEY = "pubkey.pem"; public static final String CERT_ACME_ACCOUNT_PRIVATE_KEY = "certificates/acme/account-private-key-pkcs1.pem"; public static final String CMS_ENV_CONFIG_PATH = "cms/environment.properties"; - public static final String JWT_SECRETS_PATH = "jwt-secrets.json"; + public static final String CMS_JWT_SECRETS_PATH = "cms/jwt-secrets.json"; public static final String VERSION_PROPERTY = "cli.version"; public static final String CMS_ADMIN_GROUP_KEY = "cms.admin.group"; public static final String ROOT_USER_ARN_KEY = "root.user.arn"; diff --git a/src/main/java/com/nike/cerberus/store/ConfigStore.java b/src/main/java/com/nike/cerberus/store/ConfigStore.java index ee7b36a3..d2eaacdd 100644 --- a/src/main/java/com/nike/cerberus/store/ConfigStore.java +++ b/src/main/java/com/nike/cerberus/store/ConfigStore.java @@ -216,7 +216,7 @@ public Optional getAcmeAccountKeyPair() { * @param activationDelayInSecond Delay in second before the secret can be used to sign JWT */ public void addJwtKey(long activationDelayInSecond) { - Optional jwtKeysFile = storeServiceMap.get(configRegion).get(JWT_SECRETS_PATH); + Optional jwtKeysFile = storeServiceMap.get(configRegion).get(CMS_JWT_SECRETS_PATH); JwtSecretData jwtSecretData; if (jwtKeysFile.isPresent()) { try { @@ -629,7 +629,7 @@ private void saveJwtSecretData(JwtSecretData jwtSecretData) { EnvironmentData environmentData = getDecryptedEnvironmentData(); try { String serializedPlainTextEnvironmentData = configObjectMapper.writeValueAsString(jwtSecretData); - encryptAndSaveObject(JWT_SECRETS_PATH, serializedPlainTextEnvironmentData, environmentData); + encryptAndSaveObject(CMS_JWT_SECRETS_PATH, serializedPlainTextEnvironmentData, environmentData); } catch (JsonProcessingException e) { throw new RuntimeException("Unable to convert JWT secret data to JSON. Aborting save...", e); }