-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
#100: Fix retrieval of authentication tokens on Github enterprise hosts #115
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
kennyko
changed the title
100: Fix retrieval of authentication tokens on Github enterprise hosts
#100: Fix retrieval of authentication tokens on Github enterprise hosts
Mar 2, 2020
mc1arke
requested changes
Mar 13, 2020
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.
Thanks for your contribution. Could you add unit tests to cover these changes please?
...mc1arke/sonarqube/plugin/ce/pullrequest/github/v3/RestApplicationAuthenticationProvider.java
Outdated
Show resolved
Hide resolved
...va/com/github/mc1arke/sonarqube/plugin/ce/pullrequest/github/v4/GraphqlCheckRunProvider.java
Outdated
Show resolved
Hide resolved
kennyko
force-pushed
the
issue/100
branch
2 times, most recently
from
March 26, 2020 21:37
f657447
to
7601a40
Compare
@mc1arke are you able to take a look at this pull request again? |
mc1arke
previously approved these changes
Apr 20, 2020
Please squash your commits so we have a single commit for this feature |
kennyko
force-pushed
the
issue/100
branch
4 times, most recently
from
April 20, 2020 16:35
2de0173
to
a77bb62
Compare
Done |
…ise hosts Github.com's API does not contain version numbers in the path for REST endpoints (e.g. api.github.com/endpoint), but Github Enterprise does (e.g. github.company.net/api/v3/endpoint), however neither platforms use version numbers in the Graphql endpoint (e.g. api.github.com/graphql and github.company.net/api/graphql). The plugin was not previously differentiating between the two possible platforms based on the configured base URL, so was using the wrong REST endpoint when performing the authentication request, or was targeting the wrong graphql url if the user configured the URL to end with `v3`. Checking if the configured URL ends with `api` indicates the URL is Github enterprise rather than Github.com, so now had `v3` appended to it for the authentication request. This change will also support GitHub Enterprise URLs with or without a trailing `v3/` in the endpoint.
mc1arke
approved these changes
May 24, 2020
Merged. Thanks for the contribution! |
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.
Updated configuration description to be in line with the documentation on https://docs.sonarqube.org/latest/instance-administration/github-application/
Add support for GitHub Enterprise installations with both a
/v3
in the URL and without.Resolves #100