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.

@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 from e1f119c to 6d2afc9 Compare July 1, 2025 17:18
…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/07-01-feat_oauth2_replace_dev_flag_with_oauth2_experiment_for_controlled_rollout branch 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 from 60161d7 to 16a48ef Compare July 1, 2025 19:54
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