From 4adcc7b638d7e69805f6179dcc7a1a39741326da Mon Sep 17 00:00:00 2001 From: aevolution-gitops-bot Date: Tue, 27 Oct 2026 13:37:30 -0400 Subject: [PATCH] fix(admin): accept OAuth callback query strings --- deploy/kubernetes/region/dev/kustomization.yaml | 3 ++- deploy/kubernetes/region/dev/region-values.yaml | 4 ++-- src/server/ops_http.cpp | 7 ++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/deploy/kubernetes/region/dev/kustomization.yaml b/deploy/kubernetes/region/dev/kustomization.yaml index ac81c9b..2db25db 100644 --- a/deploy/kubernetes/region/dev/kustomization.yaml +++ b/deploy/kubernetes/region/dev/kustomization.yaml @@ -14,7 +14,8 @@ components: images: - name: aevolution-server newName: registry.aeternalisgames.com/aeternalis/aevolution-server - digest: sha256:1dd1ea052376c2c5daf2b0a910b1a5972474c836672f9cb61b32ecae58dabfd1 + # Admin OAuth callback fix: accept bounded routes with longer PKCE query strings. + digest: sha256:c7347c2d7aa2ea0e5d00665da81cd7d710b109e4e306dd7e09562463d33a5d8f patches: - path: region-values.yaml # The Git tuning files for the provision Job's liquid (rules 12) and revamp (rules 13) diff --git a/deploy/kubernetes/region/dev/region-values.yaml b/deploy/kubernetes/region/dev/region-values.yaml index bbfc2da..2645d5c 100644 --- a/deploy/kubernetes/region/dev/region-values.yaml +++ b/deploy/kubernetes/region/dev/region-values.yaml @@ -18,7 +18,7 @@ spec: env: - {name: REGION_WORLD, value: "100"} - {name: REGION_ID, value: "16"} - - {name: REGION_BUILD, value: 1dd1ea052376c2c5daf2b0a910b1a5972474c836672f9cb61b32ecae58dabfd1} + - {name: REGION_BUILD, value: c7347c2d7aa2ea0e5d00665da81cd7d710b109e4e306dd7e09562463d33a5d8f} - {name: REGION_PROFILE, value: cellular} # The whole world's catalog: dev world 100 has only this region. - {name: REGION_LIFE_ROUTES, value: "16=void.aeternalisgames.com:7400=void.aeternalisgames.com"} @@ -37,7 +37,7 @@ spec: env: - {name: REGION_WORLD, value: "100"} - {name: REGION_ID, value: "16"} - - {name: REGION_BUILD, value: 1dd1ea052376c2c5daf2b0a910b1a5972474c836672f9cb61b32ecae58dabfd1} + - {name: REGION_BUILD, value: c7347c2d7aa2ea0e5d00665da81cd7d710b109e4e306dd7e09562463d33a5d8f} # Region 16 (rules 13): cellular-v10, 60 x 60 mm at 20 C, taken through one empty tick, # the durable upgrades to rules 11 with light, the liquid upgrade from the mounted # tuning file (whose region size must match) and the revamp upgrade from the mounted diff --git a/src/server/ops_http.cpp b/src/server/ops_http.cpp index 520d137..81d7010 100644 --- a/src/server/ops_http.cpp +++ b/src/server/ops_http.cpp @@ -147,6 +147,11 @@ void OpsServer::respond_api(Connection& c, const ApiHandler& handler) { } const auto method = line.substr(0, first); const auto path = line.substr(first + 1, second - first - 1); + // The route is bounded separately from the query. OAuth authorization-code callbacks + // carry state, session_state, and code parameters that legitimately make the request + // target longer than the route limit; AdminApi strips the query before routing. + const auto query = path.find('?'); + const auto route = path.substr(0, query); std::string_view authorization; bool has_body = false; // Header lines up to the blank line; names are case-insensitive. @@ -173,7 +178,7 @@ void OpsServer::respond_api(Connection& c, const ApiHandler& handler) { } if (method != "GET" && method != "POST") response = {405, "method not allowed\n"}; - else if (path.empty() || path.front() != '/' || path.size() > 256 || !printable(path) || + else if (route.empty() || route.front() != '/' || route.size() > 256 || !printable(path) || has_body) response = {400, "bad request\n"}; else