ADR-0131: Keycloak sign-in in the Windows engineering client
Foundation / checks (ecs) (push) Successful in 2m21s
Foundation / checks (deploy) (push) Successful in 4m1s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 7m21s
Foundation / checks (network) (push) Canceled after 9m43s
Foundation / checks (checks) (push) Canceled after 9m49s
Foundation / checks (postgres) (push) Canceled after 9m43s
Foundation / checks (client) (push) Canceled after 9m48s

Sign In / Register opens the system browser (PKCE S256, loopback 127.0.0.1:47600)
and keeps the refresh token in Windows Credential Manager. The client then fetches
a 10-minute grant from grants.aeternalisgames.com and connects to the cellular DEV
region. It renews the grant about a minute before expiry through SessionRefresh,
and again after a lost connection. Sign Out closes the session and revokes the
login at the broker and at Keycloak. Grant replies are cross-checked against the
grant record before use. The manual grant-bundle path stays for developers.

The bounded JSON reader moves to evo_json (evo::serialization), shared by the
broker and the client. Adds the client-auth tests. Completes work started in
another session: main.cpp wiring, refresh expiry tracking, no requests for a
superseded session, and clang-tidy and Windows header-order fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-15 15:31:33 -04:00
co-authored by Claude Opus 5.5
parent dec34f39e4
commit 2a5c0d0e22
22 changed files with 1622 additions and 72 deletions
+50 -12
View File
@@ -121,18 +121,48 @@ void launcher(const PanelView& v, FormBuffers& form, PanelActions& a) {
"server, not an ecosystem, not authoritative.");
ImGui::Separator();
ImGui::TextUnformatted("Connect to a dev region");
ImGui::BeginDisabled(!v.remote_available || phase == LaunchPhase::connecting);
ImGui::InputText("Endpoint (host:port)", form.endpoint.data(), form.endpoint.size());
ImGui::InputText("Server name", form.server_name.data(), form.server_name.size());
ImGui::InputText("Dev CA file", form.authority.data(), form.authority.size());
ImGui::InputText("Grant bundle file", form.grants.data(), form.grants.size());
bool cellular_trial = v.cellular_trial;
if (ImGui::Checkbox("Cellular play (v10)", &cellular_trial))
a.cellular_trial = cellular_trial;
const bool start = phase == LaunchPhase::choosing && ImGui::Button("Connect", {px(160), 0});
ImGui::InputText("Region CA file", form.authority.data(), form.authority.size());
ImGui::BeginDisabled(!v.remote_available || !v.auth.supported || v.auth.busy ||
phase == LaunchPhase::connecting);
if (ImGui::Button(v.auth.signed_in ? "Play in DEV" : "Sign in / Register", {-1, px(34)})) {
a.sign_in = !v.auth.signed_in;
a.auth_connect = v.auth.signed_in;
}
ImGui::EndDisabled();
if (start)
a.connect = true;
if (v.auth.busy) {
ImGui::TextWrapped(
"%s",
v.auth.phase == client::AuthPhase::signing_out ? "Signing out..."
: v.auth.phase == client::AuthPhase::renewing
? "Renewing your connection..."
: "Complete sign-in in your browser, then return here. Connecting is automatic.");
if (v.auth.phase == client::AuthPhase::signing_in && ImGui::Button("Cancel sign-in"))
a.cancel_sign_in = true;
} else if (v.auth.signed_in && ImGui::SmallButton("Sign out"))
a.sign_out = true;
if (v.auth.error) {
ImGui::PushStyleColor(ImGuiCol_Text, amber);
const auto text = client::auth_error_text(*v.auth.error);
ImGui::PushTextWrapPos(0.0F);
ImGui::TextUnformatted(text.data(), text.data() + text.size());
ImGui::PopTextWrapPos();
ImGui::PopStyleColor();
}
ImGui::TextWrapped(
"Your password stays in the system browser. Windows Credential Manager stores your login.");
if (ImGui::CollapsingHeader("Manual connection (developer grants)")) {
ImGui::BeginDisabled(!v.remote_available || phase == LaunchPhase::connecting);
ImGui::InputText("Endpoint (host:port)", form.endpoint.data(), form.endpoint.size());
ImGui::InputText("Server name", form.server_name.data(), form.server_name.size());
ImGui::InputText("Grant bundle file", form.grants.data(), form.grants.size());
bool cellular_trial = v.cellular_trial;
if (ImGui::Checkbox("Cellular play (v10)", &cellular_trial))
a.cellular_trial = cellular_trial;
const bool start = phase == LaunchPhase::choosing && ImGui::Button("Connect", {px(160), 0});
ImGui::EndDisabled();
if (start)
a.connect = true;
}
if (!v.remote_available)
ImGui::TextColored(amber, "Remote mode needs a build with EVO_BUILD_NETWORK.");
if (v.form_error)
@@ -150,7 +180,8 @@ void launcher(const PanelView& v, FormBuffers& form, PanelActions& a) {
if (ImGui::Button("Cancel", {px(120), 0}))
a.cancel = true;
}
ImGui::TextDisabled("Files are read when you connect; nothing is saved.");
ImGui::TextWrapped("The region CA is still required to verify the game server. Manual grant "
"files are only read when connecting.");
ImGui::End();
}
@@ -168,6 +199,13 @@ void banner(const PanelView& v, PanelActions& a) {
ImGui::SameLine();
if (ImGui::SmallButton("Controls"))
a.open_controls = true;
if (v.auth.signed_in) {
ImGui::SameLine();
ImGui::BeginDisabled(v.auth.busy);
if (ImGui::SmallButton("Sign out"))
a.sign_out = true;
ImGui::EndDisabled();
}
} else {
ImGui::TextColored(v.remote && v.remote->phase == "connected" ? green : amber,
"DEV REGION - %s%s", v.remote ? v.remote->phase.c_str() : "?",