Remove turnstile#157
Merged
Merged
Conversation
Fixes #154 Specifically the hardcoded maps part of it
Turnstile creates unnecessary friction for competitors. It has been shown that Turnstile can be bypassed with little effort, so it only harms the good guys. We should remove it and rely on monitoring to detect automation.
There was a problem hiding this comment.
Pull request overview
This PR removes the Turnstile requirement from the private game-match creation endpoint, and adjusts tournament series map selection to be driven by a per-competition settings.tournamentMaps configuration (with integration tests updated to provide that setting and to re-enable coverage around unique map selection).
Changes:
- Removed
@RequireTurnstilefromPOST /api/v1/game-match. - Updated tournament series map selection to read from
Competition.settings["tournamentMaps"]instead of a hard-coded list. - Updated/re-enabled tournament integration tests to set
tournamentMapsin competition settings and validate unique-map behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/bytefight/webserver/gamematch/infra/PrivateGameMatchController.java | Removes Turnstile enforcement on private match creation endpoint. |
| src/main/java/org/bytefight/webserver/tournament/application/TournamentMatchScheduler.java | Switches series map pool source from hard-coded list to Competition.settings.tournamentMaps. |
| src/test/java/org/bytefight/webserver/tournament/TournamentServiceIntegrationTest.java | Ensures competition test fixtures include tournamentMaps in settings. |
| src/test/java/org/bytefight/webserver/tournament/TournamentResultHandlerIntegrationTest.java | Ensures competition test fixtures include tournamentMaps in settings. |
| src/test/java/org/bytefight/webserver/tournament/TournamentMatchSchedulerIntegrationTest.java | Re-enables and updates series map uniqueness test; adds tournamentMaps to fixture settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
43
to
46
| private final GameMatchService gameMatchService; | ||
|
|
||
| @PostMapping | ||
| @RequireTurnstile | ||
| public ResponseEntity<List<GameMatchDto>> createGameMatch( |
Comment on lines
+271
to
+284
| @SuppressWarnings("unchecked") | ||
| private List<String> getTournamentMaps(Competition competition) { | ||
| Map<String, Object> settings = competition.getSettings(); | ||
| Object value = settings == null ? null : settings.get(TOURNAMENT_MAPS_SETTING_KEY); | ||
| if (!(value instanceof List)) { | ||
| throw new IllegalStateException( | ||
| "Competition '" | ||
| + competition.getSlug() | ||
| + "' is missing the required '" | ||
| + TOURNAMENT_MAPS_SETTING_KEY | ||
| + "' setting."); | ||
| } | ||
| return (List<String>) value; | ||
| } |
Comment on lines
233
to
+237
|
|
||
| // Determine the next game number (1-based). | ||
| int nextGameNumber = existingGames.size() + 1; | ||
| Map<String, Object> matchSettings = buildSeriesMatchSettings(existingGames); | ||
| List<String> tournamentMaps = getTournamentMaps(match.getTournament().getCompetition()); | ||
| Map<String, Object> matchSettings = buildSeriesMatchSettings(existingGames, tournamentMaps); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.