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

Open
wants to merge 1 commit into
base: thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration
Choose a base branch
from

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.

Copy link
Member Author

ThomasK33 commented Jul 1, 2025

@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/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 991aeb7 to 7a4b271 Compare July 2, 2025 12:25
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 51f84ce to 3b81925 Compare July 2, 2025 12:25
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 7a4b271 to 5496826 Compare July 2, 2025 12:44
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 3b81925 to 7c1857a Compare July 2, 2025 12:44
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 5496826 to 3df9b80 Compare July 2, 2025 13:58
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 7c1857a to 2406fe7 Compare July 2, 2025 13:58
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from 3df9b80 to e32fba8 Compare July 2, 2025 14:06
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 2406fe7 to 10bed55 Compare July 2, 2025 14:06
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from e32fba8 to d74cf24 Compare July 2, 2025 14:13
@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 91acaec to 46dec9a Compare July 2, 2025 14:41
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch from d74cf24 to 152aa40 Compare July 2, 2025 14:41
@ThomasK33 ThomasK33 force-pushed the thomask33/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch from 46dec9a to eb2ed15 Compare July 2, 2025 15:08
@ThomasK33 ThomasK33 force-pushed the thomask33/06-30-feat_mcp_implement_mcp_http_server_with_toolsdk_integration branch 2 times, most recently from e69fe1c to 8672a4b Compare July 2, 2025 15:53
@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
…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 <tk@coder.com>
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants