fix(auth): update InternalAuthFilter to use @ApplicationScoped and add index-dependency configuration
Build & Test (NowChessSystems) TeamCity build failed

This commit is contained in:
2026-05-05 06:49:45 +02:00
parent 847b13202c
commit 6e0fd9523e
3 changed files with 9 additions and 5 deletions
@@ -3,6 +3,10 @@ quarkus:
port: 8080 port: 8080
application: application:
name: nowchess-core name: nowchess-core
index-dependency:
security:
group-id: de.nowchess
artifact-id: security
redis: redis:
hosts: redis://${REDIS_HOST:localhost}:${REDIS_PORT:6379} hosts: redis://${REDIS_HOST:localhost}:${REDIS_PORT:6379}
max-pool-wait-time: 500ms max-pool-wait-time: 500ms
@@ -41,7 +41,7 @@ class InternalAuthFilterHttpTest:
.body("{}") .body("{}")
.when() .when()
.post("/api/board/game") .post("/api/board/game")
.then() .`then`()
.statusCode(401) .statusCode(401)
@Test @Test
@@ -53,7 +53,7 @@ class InternalAuthFilterHttpTest:
.body("{}") .body("{}")
.when() .when()
.post("/api/board/game") .post("/api/board/game")
.then() .`then`()
.statusCode(401) .statusCode(401)
@Test @Test
@@ -62,6 +62,6 @@ class InternalAuthFilterHttpTest:
RestAssured.`given`() RestAssured.`given`()
.when() .when()
.get("/api/board/game/nonexistent") .get("/api/board/game/nonexistent")
.then() .`then`()
.statusCode(404) .statusCode(404)
// scalafix:on // scalafix:on
@@ -1,6 +1,6 @@
package de.nowchess.security package de.nowchess.security
import jakarta.inject.Singleton import jakarta.enterprise.context.ApplicationScoped
import jakarta.ws.rs.container.{ContainerRequestContext, ContainerRequestFilter} import jakarta.ws.rs.container.{ContainerRequestContext, ContainerRequestFilter}
import jakarta.ws.rs.core.Response import jakarta.ws.rs.core.Response
import jakarta.ws.rs.ext.Provider import jakarta.ws.rs.ext.Provider
@@ -9,7 +9,7 @@ import scala.compiletime.uninitialized
@Provider @Provider
@InternalOnly @InternalOnly
@Singleton @ApplicationScoped
class InternalAuthFilter extends ContainerRequestFilter: class InternalAuthFilter extends ContainerRequestFilter:
@ConfigProperty(name = "nowchess.internal.secret", defaultValue = "") @ConfigProperty(name = "nowchess.internal.secret", defaultValue = "")