From 6d06edda69a50de65cd9efa27f26a4cc6b437f9d Mon Sep 17 00:00:00 2001 From: Janis Eccarius Date: Sun, 21 Jun 2026 21:37:29 +0200 Subject: [PATCH] feat(tournament): remove dynamic server add/remove endpoints Servers are now configured via TOURNAMENT_EXTERNAL_SERVERS env var. POST /api/tournament/servers and DELETE /api/tournament/servers/{id} are removed; only GET (list) remains for the bot's fetchRemoteServers call. Co-Authored-By: Claude Sonnet 4.6 --- .../tournament/config/NativeReflectionConfig.scala | 1 - .../de/nowchess/tournament/dto/ExternalServer.scala | 1 - .../resource/TournamentServerResource.scala | 12 +----------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/modules/tournament/src/main/scala/de/nowchess/tournament/config/NativeReflectionConfig.scala b/modules/tournament/src/main/scala/de/nowchess/tournament/config/NativeReflectionConfig.scala index 70298b3..85d6b5a 100644 --- a/modules/tournament/src/main/scala/de/nowchess/tournament/config/NativeReflectionConfig.scala +++ b/modules/tournament/src/main/scala/de/nowchess/tournament/config/NativeReflectionConfig.scala @@ -33,7 +33,6 @@ import io.quarkus.runtime.annotations.RegisterForReflection classOf[CoreGameResponse], classOf[GameWritebackEventDto], classOf[ExternalTournamentServer], - classOf[RegisterServerRequest], classOf[ExternalTournamentServerList], ), ) diff --git a/modules/tournament/src/main/scala/de/nowchess/tournament/dto/ExternalServer.scala b/modules/tournament/src/main/scala/de/nowchess/tournament/dto/ExternalServer.scala index 616cd5f..bbf5bd7 100644 --- a/modules/tournament/src/main/scala/de/nowchess/tournament/dto/ExternalServer.scala +++ b/modules/tournament/src/main/scala/de/nowchess/tournament/dto/ExternalServer.scala @@ -1,5 +1,4 @@ package de.nowchess.tournament.dto case class ExternalTournamentServer(id: String, label: String, url: String) -case class RegisterServerRequest(label: String, url: String) case class ExternalTournamentServerList(servers: List[ExternalTournamentServer]) diff --git a/modules/tournament/src/main/scala/de/nowchess/tournament/resource/TournamentServerResource.scala b/modules/tournament/src/main/scala/de/nowchess/tournament/resource/TournamentServerResource.scala index 235cacd..6774b51 100644 --- a/modules/tournament/src/main/scala/de/nowchess/tournament/resource/TournamentServerResource.scala +++ b/modules/tournament/src/main/scala/de/nowchess/tournament/resource/TournamentServerResource.scala @@ -1,6 +1,6 @@ package de.nowchess.tournament.resource -import de.nowchess.tournament.dto.{ErrorDto, ExternalTournamentServerList, RegisterServerRequest} +import de.nowchess.tournament.dto.ExternalTournamentServerList import de.nowchess.tournament.service.TournamentServerRegistry import jakarta.annotation.security.RolesAllowed import jakarta.enterprise.context.ApplicationScoped @@ -23,13 +23,3 @@ class TournamentServerResource: @GET def list(): Response = Response.ok(ExternalTournamentServerList(registry.list())).build() - - @POST - def register(req: RegisterServerRequest): Response = - Response.status(201).entity(registry.register(req.label, req.url)).build() - - @DELETE - @Path("/{id}") - def remove(@PathParam("id") id: String): Response = - if registry.remove(id) then Response.noContent().build() - else Response.status(Response.Status.NOT_FOUND).entity(ErrorDto(s"Server $id not found")).build()