Skip to content

feat: add OAuth2 provider functionality as an experiment #18692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ThomasK33
Copy link
Member

Add OAuth2 Provider Functionality as an Experiment

This PR adds a new experiment flag oauth2 that enables OAuth2 provider functionality in Coder. When enabled, this experiment allows Coder to act as an OAuth2 provider.

The changes include:

  • Added the new ExperimentOAuth2 constant with appropriate documentation
  • Updated the OAuth2 provider middleware to check for the experiment flag
  • Modified the error message to indicate that the OAuth2 provider requires enabling the experiment
  • Added the new experiment to the known experiments list in the SDK

Previously, OAuth2 provider functionality was only available in development mode. With this change, it can be enabled in production environments by activating the experiment.

@ThomasK33 ThomasK33 marked this pull request as ready for review July 1, 2025 13:24
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 3e540ef to 0447dc7 Compare July 1, 2025 13:44
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 95ae97b to 0ea8930 Compare July 1, 2025 13:44
Copy link
Member

@matifali matifali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 0447dc7 to 674964b Compare July 1, 2025 16:50
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 0ea8930 to 86c43d9 Compare July 1, 2025 16:50
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 674964b to de6e6b1 Compare July 1, 2025 16:56
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 86c43d9 to 35540ea Compare July 1, 2025 16:56
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from de6e6b1 to df6f22c Compare July 1, 2025 17:04
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 35540ea to e1f119c Compare July 1, 2025 17:04
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from df6f22c to 60161d7 Compare July 1, 2025 17:18
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch 2 times, most recently from 6d2afc9 to 5865fb5 Compare July 1, 2025 19:54
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch 2 times, most recently from 16a48ef to 06236c5 Compare July 1, 2025 20:14
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from eb2ed15 to 13103fd Compare July 2, 2025 15:53
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 8672a4b to e55d907 Compare July 2, 2025 16:35
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 13103fd to 76e5caf Compare July 2, 2025 16:35
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from e55d907 to 6684a17 Compare July 2, 2025 16:46
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 76e5caf to 9d10302 Compare July 2, 2025 16:47
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 6684a17 to 02bb2fa Compare July 2, 2025 17:01
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 9d10302 to ffbe385 Compare July 2, 2025 17:02
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 02bb2fa to 6dc9330 Compare July 2, 2025 17:16
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from ffbe385 to b4ecd2d Compare July 2, 2025 17:17
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 6dc9330 to b8839e2 Compare July 3, 2025 15:00
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from b4ecd2d to 377a7e8 Compare July 3, 2025 15:00
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from b8839e2 to 7cc9428 Compare July 3, 2025 16:35
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 377a7e8 to b20b977 Compare July 3, 2025 16:35
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 7cc9428 to 3c7a569 Compare July 3, 2025 16:52
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from b20b977 to 15df5c5 Compare July 3, 2025 16:52
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch 2 times, most recently from 74b951f to 2e61d59 Compare July 3, 2025 17:14
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 15df5c5 to 5a4fab9 Compare July 3, 2025 17:14
@ThomasK33 ThomasK33 changed the base branch from thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration to graphite-base/18692 July 3, 2025 17:27
@ThomasK33 ThomasK33 force-pushed the graphite-base/18692 branch from 2e61d59 to 494dccc Compare July 3, 2025 17:27
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 5a4fab9 to cd0cf55 Compare July 3, 2025 17:27
@graphite-app graphite-app bot changed the base branch from graphite-base/18692 to main July 3, 2025 17:28
…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=oauth2

Change-Id: I51e021a21ad385c133783d715e872fb4069f9e66
Signed-off-by: Thomas Kosiewski <[email protected]>
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from cd0cf55 to 9045b65 Compare July 3, 2025 17:28
@ThomasK33 ThomasK33 merged commit 1555154 into main Jul 3, 2025
38 of 40 checks passed
Copy link
Member Author

Merge activity

@ThomasK33 ThomasK33 deleted the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch July 3, 2025 17:44
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants