Publish authenticated session identity through scoped manager challenges #103

Open
smell-of-curry wants to merge 2 commits from feature/managed-session-identity into main

The addon currently depends on an encrypted XUID chat message. This adds an instance-scoped replacement: consume backend-origin engine:identity_challenge messages, bind each to the backend entity and authenticated incoming client name, then publish that incoming connection's XUID to the manager broker. Client-origin challenges are discarded. HTTP delivery is bounded, requires TLS or numeric loopback, rejects redirects, and omits identity payloads and credentials from logs.

Each server has its own publisher configuration. Existing packs retain legacy emission by default; DisableLegacyIdentity can turn it off after an instance upgrades. The new addon never consumes the old message. Production authentication, packet protections and proxy topology remain in place.

Validation: go test ./..., go test -race ./..., CI-pinned golangci-lint and Forgejo checks passed. Tests cover endpoint policy, challenge binding and authenticated-client provenance. An isolated real-account test on BDS 1.26.63.1 passed both initial join and reconnect using this proxy with DisableLegacyIdentity=true. The addon resolved the authenticated XUID despite a bogus persisted XUID property. Direct native identity was tested separately; enforced-allowlist controls did not complete.

Coordinated changes: manager #43, gobds #103, BEH #840. Deploy manager and gobds before restarting real-player servers on the new addon. Keep gobds legacy emission enabled for older packs during rollout; the new addon ignores it. Production retains gobds. Existing XUID database and website keys stay unchanged; no data migration is needed. These PRs do not deploy production or implement Preview downloads, direct connection comments, ports, or hub-list filtering.

The addon currently depends on an encrypted XUID chat message. This adds an instance-scoped replacement: consume backend-origin engine:identity_challenge messages, bind each to the backend entity and authenticated incoming client name, then publish that incoming connection's XUID to the manager broker. Client-origin challenges are discarded. HTTP delivery is bounded, requires TLS or numeric loopback, rejects redirects, and omits identity payloads and credentials from logs. Each server has its own publisher configuration. Existing packs retain legacy emission by default; DisableLegacyIdentity can turn it off after an instance upgrades. The new addon never consumes the old message. Production authentication, packet protections and proxy topology remain in place. Validation: go test ./..., go test -race ./..., CI-pinned golangci-lint and Forgejo checks passed. Tests cover endpoint policy, challenge binding and authenticated-client provenance. An isolated real-account test on BDS 1.26.63.1 passed both initial join and reconnect using this proxy with DisableLegacyIdentity=true. The addon resolved the authenticated XUID despite a bogus persisted XUID property. Direct native identity was tested separately; enforced-allowlist controls did not complete. Coordinated changes: [manager #43](https://git.pokebedrock.com/pokebedrock/bds-manager/pulls/43), [gobds #103](https://git.pokebedrock.com/pokebedrock/gobds/pulls/103), [BEH #840](https://git.pokebedrock.com/pokebedrock/pokebedrock-beh/pulls/840). Deploy manager and gobds before restarting real-player servers on the new addon. Keep gobds legacy emission enabled for older packs during rollout; the new addon ignores it. Production retains gobds. Existing XUID database and website keys stay unchanged; no data migration is needed. These PRs do not deploy production or implement Preview downloads, direct connection comments, ports, or hub-list filtering.
Publish authenticated session identity through manager challenges
Some checks failed
golangci-lint / Lint Dockerfile. (pull_request) Successful in 6s
golangci-lint / lint (pull_request) Failing after 1m2s
7e6bb99396
Satisfy publisher lint checks and document protocol types
All checks were successful
golangci-lint / Lint Dockerfile. (pull_request) Successful in 3s
golangci-lint / lint (pull_request) Successful in 50s
9b237bb54e
bot left a comment

Scoped static review at 9b237bb5 (2026-11-12 ET): inspected the complete original 10-file PR diff plus the exact 7e6bb993→9b237bb5 commit diff after the head moved. The latter is protocol documentation, an equivalent endpoint-validation condition and explicit ignored Close error; no old-head review was published.

No blocking defect identified in this scope. Backend-origin ScriptMessage gating, authenticated incoming-client XUID/name source, backend entity binding, one in-flight publication per session, timeout/cancellation, endpoint TLS/numeric-loopback policy, redirect refusal and log redaction are consistent with the manager challenge model. Client-origin identity packets are consumed without assertion publication. Legacy emission remains enabled unless explicitly disabled.

Not runtime approval: Go is unavailable in this review environment, so I did not rerun go test ./..., lint, CI or the packet/HTTP tests. I read the supplied binding, client-spoof, redirect and endpoint tests; author-reported passing results are separate evidence. Before production, complete the isolated real-account three-service test with legacy emission disabled, stale/reconnected sessions, manager restart and temporarily unavailable broker. Coordinate manager #43 and BEH #840; no merge/deploy/restart authorization is implied.

Scoped static review at 9b237bb5 (2026-11-12 ET): inspected the complete original 10-file PR diff plus the exact 7e6bb993→9b237bb5 commit diff after the head moved. The latter is protocol documentation, an equivalent endpoint-validation condition and explicit ignored Close error; no old-head review was published. No blocking defect identified in this scope. Backend-origin ScriptMessage gating, authenticated incoming-client XUID/name source, backend entity binding, one in-flight publication per session, timeout/cancellation, endpoint TLS/numeric-loopback policy, redirect refusal and log redaction are consistent with the manager challenge model. Client-origin identity packets are consumed without assertion publication. Legacy emission remains enabled unless explicitly disabled. Not runtime approval: Go is unavailable in this review environment, so I did not rerun go test ./..., lint, CI or the packet/HTTP tests. I read the supplied binding, client-spoof, redirect and endpoint tests; author-reported passing results are separate evidence. Before production, complete the isolated real-account three-service test with legacy emission disabled, stale/reconnected sessions, manager restart and temporarily unavailable broker. Coordinate manager #43 and BEH #840; no merge/deploy/restart authorization is implied.
All checks were successful
golangci-lint / Lint Dockerfile. (pull_request) Successful in 3s
golangci-lint / lint (pull_request) Successful in 50s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/managed-session-identity:feature/managed-session-identity
git switch feature/managed-session-identity
Sign in to join this conversation.
No description provided.