Skip to content

Commit

Permalink
🔖 1.0.0 done?
Browse files Browse the repository at this point in the history
  • Loading branch information
MeLike2D committed Apr 3, 2021
1 parent 67f002e commit e03d234
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
11 changes: 4 additions & 7 deletions Server/src/main/kotlin/obsidian/server/Obsidian.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand All @@ -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
Expand All @@ -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()

Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions Server/src/main/kotlin/obsidian/server/io/MagmaClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit e03d234

Please sign in to comment.