diff --git a/Server/src/main/kotlin/obsidian/server/Obsidian.kt b/Server/src/main/kotlin/obsidian/server/Obsidian.kt index 251b4d0..64db5ac 100644 --- a/Server/src/main/kotlin/obsidian/server/Obsidian.kt +++ b/Server/src/main/kotlin/obsidian/server/Obsidian.kt @@ -27,7 +27,6 @@ import io.ktor.application.* import io.ktor.auth.* import io.ktor.features.* import io.ktor.http.* -import io.ktor.http.content.* import io.ktor.locations.* import io.ktor.metrics.micrometer.* import io.ktor.request.* @@ -36,7 +35,6 @@ import io.ktor.routing.* import io.ktor.serialization.* import io.ktor.server.cio.* import io.ktor.server.engine.* -import io.ktor.util.pipeline.* import io.ktor.websocket.* import io.micrometer.prometheus.PrometheusConfig import io.micrometer.prometheus.PrometheusMeterRegistry @@ -57,7 +55,7 @@ object Obsidian { addSpec(Bedrock.Config) addSpec(LoggingConfig) } - .from.yaml.file(".obsidianrc", true) + .from.yaml.file("obsidian.yml", true) .from.env() .from.systemProperties() @@ -98,10 +96,9 @@ object Obsidian { pipeline.intercept(AuthenticationPipeline.RequestAuthentication) { context -> val authorization = call.request.authorization() if (!ObsidianConfig.validateAuth(authorization)) { - val cause = when (authorization) { - null -> AuthenticationFailedCause.NoCredentials - else -> AuthenticationFailedCause.InvalidCredentials - } + val cause = + if (authorization == null) AuthenticationFailedCause.NoCredentials + else AuthenticationFailedCause.InvalidCredentials context.challenge("ObsidianAuth", cause) { call.respond(HttpStatusCode.Unauthorized) diff --git a/Server/src/main/kotlin/obsidian/server/io/MagmaClient.kt b/Server/src/main/kotlin/obsidian/server/io/MagmaClient.kt index 7d84531..b63d69c 100644 --- a/Server/src/main/kotlin/obsidian/server/io/MagmaClient.kt +++ b/Server/src/main/kotlin/obsidian/server/io/MagmaClient.kt @@ -65,14 +65,14 @@ class MagmaClient( val links = ConcurrentHashMap<Long, Link>() /** - * Whether this magma client is active + * Resume key */ - private var active: Boolean = false + var resumeKey: String? = null /** - * Resume key + * Whether this magma client is active */ - var resumeKey: String? = null + private var active: Boolean = false /** * Resume timeout @@ -351,7 +351,7 @@ class MagmaClient( } if (lastHeartbeatNonce != nonce) { - logger.warn("A heartbeat was acknowledged but it wasn't the last?") + logger.debug("A heartbeat was acknowledged but it wasn't the last?") return }