Repository navigation
Refuse local development behind a TLS terminator and document sign-in - #367
Merged
Merged
Conversation
added 2 commits
October 5, 2026 09:40
The local development profile serves requests without a credential as the operator. Configuration validation refused it with TLS enabled, payments enabled or a non-loopback bind host, but accepted it together with server.behind_tls_terminator, the shape of a dispatcher published through a reverse proxy. Refuse that combination when the configuration is read; enabled providers and the public authentication URL already require TLS or the terminator, so this one case also excludes them. Private error diagnostics now also redact the callback's code and state query values, and the CSRF header they redact is the X-Debuglet-CSRF header this API uses rather than a differently named one. Tests cover the refusal, the redaction, a GitHub token endpoint answering 503 and a cancelled GitHub sign-in (both leave no account or session), and linking a CILogon identity to a GitHub-created account through the real provider callbacks, including the refusal of a subject owned by another account. GitHub issues #226, #223 and #221.
Add the account, session and provider sign-in section to the threat model: boundaries, credential lifetimes and scopes, the protections against login CSRF, code interception, forged tokens, provider mix-up, open redirects, session fixation and device-login phishing, the linking and recovery rules, what is logged, and the local development profile's requirements. Add two operations sections: provider registration ownership, renewal and callback changes, including credential rotation through the configuration update; and provider-side incidents (leaked client secret, rotated or compromised signing key, outage, compromised provider account). State in the deployment guide that a second dispatcher is unsupported and not detected at startup, and that restart and restore are the supported recovery. GitHub issues #221, #227 and #122.
ctfbruce
marked this pull request as ready for review
October 5, 2026 07:58
3 tasks
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.
The local development profile serves requests without a credential as the operator. Configuration validation refused it with TLS enabled, payments enabled or a non-loopback bind host, but accepted it together with
server.behind_tls_terminator, which is the shape of a dispatcher published through a reverse proxy. That combination is now refused when the configuration is read; enabled providers and the public authentication URL already require TLS or the terminator, so this one case also excludes them.Private error diagnostics now redact the sign-in callback's
codeandstatequery values as well, and the CSRF header they redact is theX-Debuglet-CSRFheader this API uses; the previous name matched no request header.New tests cover the refusal, the redaction, a GitHub token endpoint answering 503 and a cancelled GitHub sign-in (both leave no account or session), and linking a CILogon identity to a GitHub-created account through the real provider callbacks, including the refusal of a subject owned by another account. No handler behaviour changed for those cases.
Documentation: the threat model gains an accounts, sessions and provider sign-in section (boundaries, lifetimes and scopes, the protections against login CSRF, code interception, forged tokens, provider mix-up, open redirects, session fixation and device-login phishing, the linking and recovery rules, what is logged, and the local development profile's requirements). The authentication guide gains sections on provider registration ownership, renewal and callback changes, including credential rotation through the configuration update as delivered by #364, and on provider-side incidents. The deployment guide states that a second dispatcher is unsupported and not detected at startup, and that restart and restore are the supported recovery.
References #226, #223, #221, #227 and #122. The rotation paragraph describes the configuration update after #364; merge that first. Real-provider staging acceptance is not performed by this change.
Validation: base reproduction shows the terminator row and the three retained sentinels failing; on the fixed tree gofmt and vet are clean and the targeted tests pass under the race detector, as do the complete
internal/dispatcher/transport/api,cmd/dispatcherandinternal/dispatcher/configpackages. Candidate CI on the pushed head is linked below once it completes.