This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Allow multiple auth providers with the same URL, adjust UI#54289
Merged
Conversation
kopancek
reviewed
Jun 27, 2023
| } | ||
| if configured { | ||
| problems = append(problems, conf.NewSiteProblem("Cannot have more than one auth provider for Azure Dev Ops, only the first one will be used")) | ||
| problems = append(problems, conf.NewSiteProblem(fmt.Sprintf("Cannot have more than one auth provider for Azure Dev Ops with Client ID %q, only the first one will be used", pr.AzureDevOps.ClientID))) |
Contributor
There was a problem hiding this comment.
Suggested change
| problems = append(problems, conf.NewSiteProblem(fmt.Sprintf("Cannot have more than one auth provider for Azure Dev Ops with Client ID %q, only the first one will be used", pr.AzureDevOps.ClientID))) | |
| problems = append(problems, conf.NewSiteProblem(fmt.Sprintf("Cannot have more than one auth provider for Azure Dev Ops with the same Client ID %q, only the first one will be used", pr.AzureDevOps.ClientID))) |
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 58d9a0b...fa897f3.
|
Contributor
sashaostrikov
approved these changes
Jun 28, 2023
sashaostrikov
left a comment
Contributor
There was a problem hiding this comment.
LGTM! Left some comments, none of them are critical
Comment on lines
+96
to
+98
| let accountMap = accumulator[account.serviceID] ?? [] | ||
| accountMap.push(account) | ||
| accumulator[account.serviceID] = accountMap |
Contributor
There was a problem hiding this comment.
Nice try, Mr. Array.
Suggested change
| let accountMap = accumulator[account.serviceID] ?? [] | |
| accountMap.push(account) | |
| accumulator[account.serviceID] = accountMap | |
| let accountArray = accumulator[account.serviceID] ?? [] | |
| accountArray.push(account) | |
| accumulator[account.serviceID] = accountArray |
Contributor
Author
There was a problem hiding this comment.
And I would have gotten away with it too, if it weren't for that meddling kid! - Mr. Array, probably
80f8d7e to
0502adc
Compare
765c02b to
fa897f3
Compare
3 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 17, 2023
(cherry picked from commit 4ae7ee4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the restrictions of having one Auth provider per URL, and instead allows one auth provider for each URL+ClientID combination.
The URL restriction came from the way our old permissions table worked, but with the
user_repo_permissionstable, this restriction no longer applies as permissions are stored against individual external accounts.This has also become an increasingly common ask from customers, and it also eases the transitioning when switching from one auth provider to another, like switching from traditional GitHub OAuth to GitHub App Oauth.
One caveat that remains: Having multiple auth providers for the same URL does not play well with repo-centric permissions syncing, as we cannot from the repo token's perspective determine which user external account a permission should be bound to. There isn't a clean workaround to make this work, and the suggestion is to turn off repo-centric permissions syncing when using multiple auth providers to the same URL.
The idea is to have a follow-up PR that allows us to disable repo-centric permissions syncs for individual code host connections.
Having two auth providers and account connections that both point to github.com:
Some follow-up tasks:
Test plan
Lots of tests updated and adjusted to fit the new criteria.