fix(admin): accept OAuth callback query strings
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m42s
Foundation / postgres-tools (push) Successful in 1m43s
Foundation / server-image (push) Successful in 5m17s
Foundation / image (push) Successful in 6m2s

This commit is contained in:
aevolution-gitops-bot
2026-10-27 13:37:30 -04:00
parent d851717b7b
commit 4adcc7b638
3 changed files with 10 additions and 4 deletions
@@ -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)
@@ -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
+6 -1
View File
@@ -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