-
Notifications
You must be signed in to change notification settings - Fork 43
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
Do not construct provider when validating user ID #3221
Merged
Merged
Conversation
This file contains 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
dmjb
force-pushed
the
gh-delegate-service
branch
4 times, most recently
from
May 1, 2024 12:14
1919211
to
3bfb6c5
Compare
dmjb
force-pushed
the
gh-delegate-service
branch
2 times, most recently
from
May 1, 2024 15:34
4259e81
to
64aa299
Compare
dmjb
added a commit
that referenced
this pull request
May 2, 2024
Relates to #2845 This is part of a change which allows me to avoid some ugly hackery in my draft PR (#3221). Break Project creation/deletion out into a pair of dedicated structs/interfaces. Change the `ProjectFactory` function used in the GitHubProviderService from a method on the controlplane to a function which returns a function. This is needed for some additional cleanup introduced in a future PR.
10 tasks
dmjb
added a commit
that referenced
this pull request
May 2, 2024
Relates to #2845 This is part of a change which allows me to avoid some ugly hackery in my draft PR (#3221). Break Project creation/deletion out into a pair of dedicated structs/interfaces. Change the `ProjectFactory` function used in the GitHubProviderService from a method on the controlplane to a function which returns a function. This is needed for some additional cleanup introduced in a future PR.
dmjb
force-pushed
the
gh-delegate-service
branch
2 times, most recently
from
May 2, 2024 15:02
d68297e
to
4b7c75f
Compare
Relates to #2845 When creating a provider, the code previously inserted the provider into the database and then instantiated it in order to validate that the user ID is correct. Alter the code so that it just instantiates the client and some supporting structures to validate the user ID. This client deliberately does not use the client cache in order to simplify the code. Since this is the first usage of the client for that provider, we will never find a suitable client in the cache anyway.
jhrozek
approved these changes
May 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Relates to #2845
When creating a provider, the code previously inserted the provider into the database and then instantiated it in order to validate that the user ID is correct. Alter the code so that it just instantiates the client and some supporting structures to validate the user ID.
This client deliberately does not use the client cache in order to simplify the code. Since this is the first usage of the client for that provider, we will never find a suitable client in the cache anyway.
This change was relatively small until I went to update the tests. As a result of changing the tests for the oauth handler, I ended up having to make the following changes:
GitHubClientFactory
now instantiates the Github delegates as well as the raw github client struct. This required moving the delegates into the same package as the factory to avoid a circular dependency.Validated locally.
Summary
Provide a brief overview of the changes and the issue being addressed.
Explain the rationale and any background necessary for understanding the changes.
List dependencies required by this change, if any.
Fixes #(related issue)
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: