server/plugins/Authentication.kt: - Custom Ktor AuthenticationProvider supporting both X-API-Key header and Authorization: Bearer <key> for API-Key validation - ApiKeyPrincipal data class implementing Principal interface - 401 Unauthorized with ErrorResponse body for missing/invalid keys server/plugins/Routing.kt: - Inventory routes wrapped in authenticate(api-key) block - Health endpoint remains public (no auth required) server/src/main/resources/application.conf: - API key configurable via krisenvorrat.apiKey property - Environment variable override via KRISENVORRAT_API_KEY server/tests: - 7 new AuthenticationTest cases (valid bearer, valid X-API-Key, missing key, invalid bearer, invalid X-API-Key, PUT without key, health without key) - All existing ApplicationTest cases updated with bearer auth header Closes #43
74 lines
5 KiB
TOML
74 lines
5 KiB
TOML
[versions]
|
|
agp = "8.7.3"
|
|
kotlin = "2.1.10"
|
|
ksp = "2.1.10-1.0.29"
|
|
coreKtx = "1.15.0"
|
|
junit = "4.13.2"
|
|
junitVersion = "1.2.1"
|
|
espressoCore = "3.6.1"
|
|
lifecycleRuntimeKtx = "2.8.7"
|
|
activityCompose = "1.9.3"
|
|
composeBom = "2025.01.00"
|
|
hilt = "2.54"
|
|
hiltNavigationCompose = "1.2.0"
|
|
room = "2.6.1"
|
|
navigationCompose = "2.8.5"
|
|
kotlinxSerialization = "1.7.3"
|
|
kotlinxCoroutines = "1.9.0"
|
|
mockk = "1.13.13"
|
|
ktor = "3.1.2"
|
|
logback = "1.5.18"
|
|
exposed = "0.58.0"
|
|
h2 = "2.3.232"
|
|
|
|
[libraries]
|
|
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
|
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
|
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
|
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
|
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
|
|
androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycleRuntimeKtx" }
|
|
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
|
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
|
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
|
|
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
|
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
|
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
|
androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
|
androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
|
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
|
|
androidx-material-icons-extended = { group = "androidx.compose.material", name = "material-icons-extended" }
|
|
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
|
hilt-android-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
|
|
androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
|
|
androidx-room-runtime = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
|
|
androidx-room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
|
|
androidx-room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
|
|
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" }
|
|
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
|
|
androidx-room-testing = { group = "androidx.room", name = "room-testing", version.ref = "room" }
|
|
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
|
|
mockk = { group = "io.mockk", name = "mockk", version.ref = "mockk" }
|
|
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" }
|
|
ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" }
|
|
ktor-server-content-negotiation = { group = "io.ktor", name = "ktor-server-content-negotiation", version.ref = "ktor" }
|
|
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
|
|
ktor-server-config-yaml = { group = "io.ktor", name = "ktor-server-config-yaml", version.ref = "ktor" }
|
|
ktor-server-status-pages = { group = "io.ktor", name = "ktor-server-status-pages", version.ref = "ktor" }
|
|
ktor-server-auth = { group = "io.ktor", name = "ktor-server-auth", version.ref = "ktor" }
|
|
ktor-server-call-logging = { group = "io.ktor", name = "ktor-server-call-logging", version.ref = "ktor" }
|
|
ktor-server-test-host = { group = "io.ktor", name = "ktor-server-test-host", version.ref = "ktor" }
|
|
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logback" }
|
|
exposed-core = { group = "org.jetbrains.exposed", name = "exposed-core", version.ref = "exposed" }
|
|
exposed-jdbc = { group = "org.jetbrains.exposed", name = "exposed-jdbc", version.ref = "exposed" }
|
|
h2-database = { group = "com.h2database", name = "h2", version.ref = "h2" }
|
|
|
|
[plugins]
|
|
android-application = { id = "com.android.application", version.ref = "agp" }
|
|
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
|
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
|
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
|
hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
|
|
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
|
|
ktor = { id = "io.ktor.plugin", version.ref = "ktor" }
|