Skip to content

Commit

Permalink
remove additional runtimes, add persistance files for keyspaces to an…
Browse files Browse the repository at this point in the history
…alytics and modified-lar, make keyspaces default configs
  • Loading branch information
zencircle committed Nov 1, 2024
1 parent b2bfc39 commit 6384d53
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 38 deletions.
2 changes: 1 addition & 1 deletion common/src/main/scala/hmda/auth/OAuth2Authorization.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
21 changes: 6 additions & 15 deletions hmda-analytics/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion hmda/src/main/resources/application-dev.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include "persistence.conf"
include "application.conf"


Expand Down
7 changes: 6 additions & 1 deletion hmda/src/main/resources/application-kubernetes.conf
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
6 changes: 6 additions & 0 deletions hmda/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
8 changes: 1 addition & 7 deletions hmda/src/main/scala/hmda/HmdaPlatform.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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(
Expand Down
19 changes: 6 additions & 13 deletions modified-lar/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 = ""
Expand Down

0 comments on commit 6384d53

Please sign in to comment.