Skip to content

Commit

Permalink
Load config correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevgeny committed Mar 2, 2016
1 parent 4a8b478 commit 7cddc91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ import scala.concurrent.Future
trait KeyAuthentication {

object ServerKey {
val serverConfig = ConfigFactory.parseFile(new File("conf/server.conf"))

val key = serverConfig.getString("server.accessKey")
def get: String = key
def param: String = "accessKey"
private val config = ConfigFactory.load("server.conf")
val get = config.getString("io.prediction.server.accessKey")
val param = "accessKey"
}

def withAccessKeyFromFile: RequestContext => Future[Authentication[HttpRequest]] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import spray.io.ServerSSLEngineProvider

trait SSLConfiguration {

private val serverConfig = ConfigFactory.parseFile(new File("conf/server.conf"))
private val serverConfig = ConfigFactory.load("server.conf")

private val keyStoreResource = serverConfig.getString("server.ssl-keystore-resource")
private val password = serverConfig.getString("server.ssl-keystore-pass")
private val keyAlias = serverConfig.getString("server.ssl-key-alias")
private val keyStoreResource = serverConfig.getString("io.prediction.server.ssl-keystore-resource")
private val password = serverConfig.getString("io.prediction.server.ssl-keystore-pass")
private val keyAlias = serverConfig.getString("io.prediction.server.ssl-key-alias")

private val keyStore = {

Expand Down
2 changes: 1 addition & 1 deletion conf/server.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Engine and dashboard Server related configurations
server {
io.prediction.server {

# This access key is used by io.prediction.authentication.KeyAuthentication
# to authenticate Evalutaion Dashboard, and Engine Server /stop and /reload enpoints
Expand Down

0 comments on commit 7cddc91

Please sign in to comment.