-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Remove deprecated auth sources #35272
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
base: main
Are you sure you want to change the base?
Remove deprecated auth sources #35272
Conversation
Entra ID users should use the OIDC oauth2 provider
return nil | ||
} | ||
|
||
var existingAzureProviders []string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make sense to check this in SQL (WHERE provider IN ('…')
)?
providers := make([]Provider, 0, len(gothProviders)) | ||
existAuthSources := getExistingAzureADAuthSources(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existingAzureSources
?
|
||
for _, provider := range gothProviders { | ||
if slices.Contains(azureProviders, provider.Name()) && !slices.Contains(existAuthSources, provider.Name()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that an gothProviders = gothProviders.Remove(existingAzureSources)
?
(Although it will probably look different since the stdlib doesn't seem to support that method…)
authSources, err := db.Find[auth.Source](ctx, auth.FindSourcesOptions{ | ||
LoginType: auth.OAuth2, | ||
}) | ||
if err != nil { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't silently ignore an unknown error.
Entra ID users should use the OIDC oauth2 provider.
They will still be shown if the instance has a previous Azure AD source configured.