From 6384d5313773f2ba4b19b54b563a2902d801b909 Mon Sep 17 00:00:00 2001 From: zencircle Date: Fri, 1 Nov 2024 14:22:35 -0400 Subject: [PATCH] remove additional runtimes, add persistance files for keyspaces to analytics and modified-lar, make keyspaces default configs --- .../scala/hmda/auth/OAuth2Authorization.scala | 2 +- .../src/main/resources/application.conf | 21 ++++++------------- hmda/src/main/resources/application-dev.conf | 1 - .../resources/application-kubernetes.conf | 7 ++++++- hmda/src/main/resources/application.conf | 6 ++++++ hmda/src/main/scala/hmda/HmdaPlatform.scala | 8 +------ .../src/main/resources/application.conf | 19 ++++++----------- 7 files changed, 26 insertions(+), 38 deletions(-) diff --git a/common/src/main/scala/hmda/auth/OAuth2Authorization.scala b/common/src/main/scala/hmda/auth/OAuth2Authorization.scala index 549754ae94..667bcc4f0e 100644 --- a/common/src/main/scala/hmda/auth/OAuth2Authorization.scala +++ b/common/src/main/scala/hmda/auth/OAuth2Authorization.scala @@ -118,7 +118,7 @@ class OAuth2Authorization(logger: Logger, tokenVerifier: TokenVerifier) { } protected def withLocalModeBypass(thunk: => Directive1[VerifiedToken]): Directive1[VerifiedToken] = - if (runtimeMode == "dev" || runtimeMode == "dev-keyspace" || runtimeMode == "dev-keyspace-sigv4" || runtimeMode == "docker-compose" || runtimeMode == "kind") { + if (runtimeMode == "dev" || runtimeMode == "docker-compose" || runtimeMode == "kind") { provide(VerifiedToken()) } else { thunk } diff --git a/hmda-analytics/src/main/resources/application.conf b/hmda-analytics/src/main/resources/application.conf index 3cc1f5c774..b526acfef2 100644 --- a/hmda-analytics/src/main/resources/application.conf +++ b/hmda-analytics/src/main/resources/application.conf @@ -1,4 +1,9 @@ -include "persistence.conf" +// Apache Cassandra with PlainTextAuthProvider +//include "persistence.conf" +// AWS Keyspace with PlainTextAuthProvider +//include "persistence-keyspace.conf" +// AWS Keyspace with SigV4AuthProvider +include "persistence-keyspace-sigv4.conf" akka { loglevel = info @@ -38,20 +43,6 @@ cassandra-snapshot-store { authentication.password = ${?CASSANDRA_CLUSTER_PASSWORD} } -kafka { - hosts = "localhost:9092" - hosts = ${?KAFKA_CLUSTER_HOSTS} - idle-timeout = 5 - idle-timeout = ${?KAFKA_IDLE_TIMEOUT} - ssl { - truststore.location="" - truststore.location = ${?KAFKA_SSL_LOCATION} - truststore.password="" - truststore.password = ${?KAFKA_SSL_PASSWORD} - endpoint="" - endpoint = ${?KAFKA_SSL_ENDPOINT} - } -} hmda { analytics { diff --git a/hmda/src/main/resources/application-dev.conf b/hmda/src/main/resources/application-dev.conf index f83a7c57d4..e3866274d1 100644 --- a/hmda/src/main/resources/application-dev.conf +++ b/hmda/src/main/resources/application-dev.conf @@ -1,4 +1,3 @@ -include "persistence.conf" include "application.conf" diff --git a/hmda/src/main/resources/application-kubernetes.conf b/hmda/src/main/resources/application-kubernetes.conf index 7351495c16..012af0b8e9 100644 --- a/hmda/src/main/resources/application-kubernetes.conf +++ b/hmda/src/main/resources/application-kubernetes.conf @@ -1,4 +1,9 @@ -include "persistence.conf" +// Apache Cassandra with PlainTextAuthProvider +//include "persistence.conf" +// AWS Keyspace with PlainTextAuthProvider +//include "persistence-keyspace.conf" +// AWS Keyspace with SigV4AuthProvider +include "persistence-keyspace-sigv4.conf" include "hmda.conf" include "cors.conf" diff --git a/hmda/src/main/resources/application.conf b/hmda/src/main/resources/application.conf index 040fbe33e8..8171f3f27f 100644 --- a/hmda/src/main/resources/application.conf +++ b/hmda/src/main/resources/application.conf @@ -1,4 +1,10 @@ +// Apache Cassandra with PlainTextAuthProvider //include "persistence.conf" +// AWS Keyspace with PlainTextAuthProvider +//include "persistence-keyspace.conf" +// AWS Keyspace with SigV4AuthProvider +include "persistence-keyspace-sigv4.conf" + include "hmda.conf" include "cors.conf" include "edits.conf" diff --git a/hmda/src/main/scala/hmda/HmdaPlatform.scala b/hmda/src/main/scala/hmda/HmdaPlatform.scala index 7e890d1dae..4d97b40a4b 100644 --- a/hmda/src/main/scala/hmda/HmdaPlatform.scala +++ b/hmda/src/main/scala/hmda/HmdaPlatform.scala @@ -55,12 +55,6 @@ object HmdaPlatform extends App { case "kind" => ConfigFactory.parseResources("application-kind.conf").resolve() - case "dev-keyspace" => - ConfigFactory.parseResources("application-dev-keyspace.conf").resolve() - - case "dev-keyspace-sigv4" => - ConfigFactory.parseResources("application-dev-keyspace.conf").resolve() - case "kubernetes" => log.info(s"HOSTNAME: ${System.getenv("HOSTNAME")}") log.info(s"HOSTADDRESS: " + InetAddress.getLocalHost().getHostAddress()) @@ -83,7 +77,7 @@ object HmdaPlatform extends App { AkkaManagement(system).start() } - if (runtimeMode == "dev" || runtimeMode == "dev-keyspace" || runtimeMode == "dev-keyspace-sigv4") { + if (runtimeMode == "dev") { CassandraUtil.startEmbeddedCassandra() AkkaManagement(system).start() implicit val embeddedKafkaConfig: EmbeddedKafkaConfig = EmbeddedKafkaConfig( diff --git a/modified-lar/src/main/resources/application.conf b/modified-lar/src/main/resources/application.conf index 10fbceb1a1..1e761fe3b5 100644 --- a/modified-lar/src/main/resources/application.conf +++ b/modified-lar/src/main/resources/application.conf @@ -1,4 +1,9 @@ -include "persistence.conf" +// Apache Cassandra with PlainTextAuthProvider +//include "persistence.conf" +// AWS Keyspace with PlainTextAuthProvider +//include "persistence-keyspace.conf" +// AWS Keyspace with SigV4AuthProvider +include "persistence-keyspace-sigv4.conf" akka { loglevel = info @@ -46,18 +51,6 @@ cassandra-snapshot-store { authentication.password = ${?CASSANDRA_CLUSTER_PASSWORD} } -kafka { - hosts = "localhost:9092" - hosts = ${?KAFKA_CLUSTER_HOSTS} - ssl { - truststore.location="" - truststore.location = ${?KAFKA_SSL_LOCATION} - truststore.password="" - truststore.password = ${?KAFKA_SSL_PASSWORD} - endpoint="" - endpoint = ${?KAFKA_SSL_ENDPOINT} - } -} aws { access-key-id = ""