Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b81925

Browse files
committed
feat(oauth2): replace dev flag with oauth2 experiment for controlled rollout
- Add ExperimentOAuth2 constant to enable OAuth2 via experiment flag- Replace dev-only middleware with experiment-based gating- Maintain backward compatibility with dev mode- Allow OAuth2 enablement in production environments via --experimental=oauth2Change-Id: I51e021a21ad385c133783d715e872fb4069f9e66Signed-off-by: Thomas Kosiewski <tk@coder.com>
1 parent7a4b271 commit3b81925

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

‎coderd/apidoc/docs.go‎

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/apidoc/swagger.json‎

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/oauth2.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const (
3737
displaySecretLength=6// Length of visible part in UI (last 6 characters)
3838
)
3939

40-
func (*API)oAuth2ProviderMiddleware(next http.Handler) http.Handler {
40+
func (api*API)oAuth2ProviderMiddleware(next http.Handler) http.Handler {
4141
returnhttp.HandlerFunc(func(rw http.ResponseWriter,r*http.Request) {
42-
if!buildinfo.IsDev() {
42+
if!api.Experiments.Enabled(codersdk.ExperimentOAuth2)&&!buildinfo.IsDev() {
4343
httpapi.Write(r.Context(),rw,http.StatusForbidden, codersdk.Response{
44-
Message:"OAuth2 provideris under development.",
44+
Message:"OAuth2 providerfunctionality requires enabling the 'oauth2' experiment.",
4545
})
4646
return
4747
}

‎codersdk/deployment.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,6 +3341,7 @@ const (
33413341
ExperimentNotificationsExperiment="notifications"// Sends notifications via SMTP and webhooks following certain events.
33423342
ExperimentWorkspaceUsageExperiment="workspace-usage"// Enables the new workspace usage tracking.
33433343
ExperimentWebPushExperiment="web-push"// Enables web push notifications through the browser.
3344+
ExperimentOAuth2Experiment="oauth2"// Enables OAuth2 provider functionality.
33443345
)
33453346

33463347
// ExperimentsKnown should include all experiments defined above.
@@ -3350,6 +3351,7 @@ var ExperimentsKnown = Experiments{
33503351
ExperimentNotifications,
33513352
ExperimentWorkspaceUsage,
33523353
ExperimentWebPush,
3354+
ExperimentOAuth2,
33533355
}
33543356

33553357
// ExperimentsSafe should include all experiments that are safe for

‎docs/reference/api/schemas.md‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎site/src/api/typesGenerated.ts‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp