feat: deployment flag to auto handle changed oidc providers (#26419)

An opt-out flag exists as an escape hatch

closes https://linear.app/codercom/issue/PLAT-343/automatically-reset-user-link-for-affected-users-when-idp-provider
This commit is contained in:
Steven Masley
2026-06-16 13:26:04 -07:00
committed by GitHub
parent b6fcb9a30a
commit 0e45ded0ed
9 changed files with 286 additions and 23 deletions
+19
View File
@@ -965,6 +965,8 @@ type OIDCConfig struct {
// situations where the OIDC callback domain is different from the ACCESS_URL
// domain.
RedirectURL serpent.URL `json:"redirect_url" typescript:",notnull"`
AutoRepairLinks serpent.Bool `json:"auto_repair_links" typescript:",notnull"`
}
type TelemetryConfig struct {
@@ -3003,6 +3005,23 @@ func (c *DeploymentValues) Options() serpent.OptionSet {
// So hide it, and only surface it to the small number of users that need it.
Hidden: true,
},
{
Name: "OIDC Auto Repair Links",
Description: "OIDC based users require the IdP issuer and subject in the claims to be static. " +
"If a new provider is configured, this option is required to be 'true'. It will reset any existing users to the " +
"previous provider, and match by email on their next login.",
Required: false,
Default: "true",
Flag: "oidc-repair-links",
Env: "CODER_OIDC_REPAIR_LINKS",
YAML: "oidc-repair-links",
Value: &c.OIDC.AutoRepairLinks,
Group: &deploymentGroupOIDC,
UseInstead: nil,
// This flag should be removed after validation in real deployments. Leaving it
// as a flag as an escape hatch for now.
Hidden: true,
},
// Telemetry settings
telemetryEnable,
{