feat: add the CODER_OAUTH2_PROVIDER_ENABLE deployment flag - #29248
feat: add the CODER_OAUTH2_PROVIDER_ENABLE deployment flag#29248BobbyHo wants to merge 3 commits into
Conversation
Add an opt-in deployment flag for Coder's OAuth 2.1 authorization server. The flag is off by default and nothing reads it yet; a follow-up moves the OAuth2 routes and dashboard navigation off the oauth2 experiment and onto this flag. - Add oauth2.provider.enable (--oauth2-provider-enable, CODER_OAUTH2_PROVIDER_ENABLE) under a new Provider group beneath OAuth2, and reword the OAuth2 group so it covers more than GitHub login. - Add oauth2_provider to the build info response so the dashboard can read the provider state without an admin-only config request. - Turn the flag on by default in coderdtest so existing OAuth2 tests keep working once the routes are gated on it. - Regenerate API docs, TypeScript types, the CLI reference, and golden files. Part of PLAT-492.
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
|
/coder-agents-review |
|
Chat: Review in progress (18/18 reviewers complete) | View chat deep-review v0.9.0 | Round 1 | Last posted: Round 1, 7 findings (1 P2, 2 Nit, 4 Note), COMMENT. Review Finding inventoryFinding inventory - PR #29248Findings
Round logRound 1Netero-only first pass: no findings, mechanical floor clean. Panel of 17 (Bisky, Hisoka, Mafu-san, Mafuuu, Pariston, Gon, Leorio, ging-go, ging-ts, Luffy, Nami, Chopper, Kurapika, Komugi, Ryosuke, Kite, Zoro). 1 P2, 3 Note, 2 Nit, 1 Note. No P0/P1. Event COMMENT. Reviewed against d5fcd99..ad2d849. Convergence: 9 reviewers independently raised CRF-1 (flag help text overpromise), 7 at P2. Higher-severity tiebreaker sets P2. No structural, security-exposure, test-authenticity, determinism, or performance defects found (Bisky, Komugi, Gon, ging-go, ging-ts, Nami: no findings). The panel confirms the flag/buildinfo/test-default wiring is correct and proportional; the sole substantive defect is documentation that describes a later PR's behavior as current. About deep-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
There was a problem hiding this comment.
First-of-five for PLAT-492: adds the CODER_OAUTH2_PROVIDER_ENABLE deployment flag, a public build-info field, and a coderdtest default. The wiring is clean and proportional. The flag lives in a new Provider group beside the GitHub login group, the build-info field follows the existing boolean pattern (Telemetry, WorkspaceProxy), and the value is snapshotted once at boot, which is correct for a static flag. Both directions of the new field are tested (TestBuildInfo asserts true under the coderdtest default, TestBuildInfoOAuth2ProviderDisabled asserts false via a mutator), and the generated golden/swagger/typesGenerated/docs are consistent with make gen. Six reviewers found nothing (Netero, Bisky, Gon, ging-go, ging-ts, Komugi, Nami), confirming no structural, mechanical, determinism, or test-authenticity defects.
Severity count: 1 P2, 2 Nit, 4 Note. No P0/P1.
The one substantive issue is convergent: nine reviewers independently flagged that the flag's operator-facing help text (CRF-1) documents behavior this PR does not implement. The description states "Enable the OAuth 2.1 authorization server... When disabled, the OAuth2 endpoints and discovery documents return 404," but nothing in this commit reads OAuth2.Provider.Enable to gate a route; the OAuth2 and discovery routes still gate solely on the oauth2 experiment. Because the flag is not hidden, that text ships now in coder server --help, the CLI reference, the config reference, and the YAML golden. The commit body is honest ("nothing reads it yet"), but the --help reader never sees the commit body. Under the no-follow-up assumption this is a standing operator-facing control whose documented effect is fiction. Not a runtime defect, so P2 rather than higher, but it is the one thing to fix before merge: reword the help to describe current reality (reserved / not yet gating routes) or land the route gate in this PR.
Process note: the PR TL;DR says "Nothing reads it yet, so there is no behavior change." That is imprecise. The PR additively changes the public /api/v2/buildinfo response by adding oauth2_provider. The Implementation Details section discloses this, so it is not concealment, just a TL;DR worth tightening.
Bisky, on the tests: "Not fifty outfits, two honest cases."
🤖 This review was automatically generated with Coder Agents.
Read the build info flag value through api.DeploymentValues like the neighbouring fields, and distinguish OAuth2ProviderConfig from OAuth2ProviderSettings in its doc comment.
Documentation CheckUpdates Needed
Everything else this PR adds is auto-generated from the Go definitions (CLI reference, config reference, swagger, Automated review via Coder Agents |
TL;DR
First of five for PLAT-492. Adds
CODER_OAUTH2_PROVIDER_ENABLE, an opt-in flag for Coder's OAuth 2.1 authorization server. Off by default. Nothing reads it yet, so there is no behavior change.oauth2experiment.oauth2experiment a no-op with a startup warning.coder server --helpand the CLI reference.Implementation Details
The flag
--oauth2-provider-enable,CODER_OAUTH2_PROVIDER_ENABLE, YAMLoauth2.provider.enable. Defaultfalse.Providergroup underOAuth2, beside the GitHub login group. TheOAuth2group description now covers both; it used to describe only GitHub login.Build info
oauth2_providerto/api/v2/buildinfoand the embedded page metadata. The dashboard will read it to show or hide OAuth2 navigation once the next PR stops reporting the experiment. It reveals nothing the discovery endpoint's 200 vs 404 does not.Test default
coderdtest.DeploymentValuesturns the flag on. Every OAuth2 test currently passes the experiment gate through the dev build bypass, and the new gate will have no bypass. Landing the default first means the next PR arrives with the suite already green. A test that wants the provider off passes a mutator.Tests
TestBuildInfoasserts the field is true under the test default.TestBuildInfoOAuth2ProviderDisabledasserts false when a test turns it off.