fix(auth): update InternalAuthFilter to use @ApplicationScoped and add index-dependency configuration
Build & Test (NowChessSystems) TeamCity build failed
Build & Test (NowChessSystems) TeamCity build failed
This commit is contained in:
@@ -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
|
||||||
|
|||||||
+3
-3
@@ -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 = "")
|
||||||
|
|||||||
Reference in New Issue
Block a user