-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix behavior for unexisting files for public repositories #243
Conversation
Signed-off-by: Max Shaposhnik <mshaposh@redhat.com>
Signed-off-by: Max Shaposhnik <mshaposh@redhat.com>
Signed-off-by: Max Shaposhnik <mshaposh@redhat.com>
Signed-off-by: Max Shaposhnik <mshaposh@redhat.com>
String clientId = Files.readString(Path.of(clientIdPath)); | ||
String clientSecret = Files.readString(Path.of(clientSecretPath)); | ||
final String clientId = Files.readString(Path.of(clientIdPath)).trim(); | ||
final String clientSecret = Files.readString(Path.of(clientSecretPath)).trim(); |
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 this enhancement !
|
||
@Override | ||
protected boolean isPublicRepository(GithubUrl remoteFactoryUrl) { | ||
try { |
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 works but this method should be added to GithubApiClient directly no ?
https://github.com/eclipse-che/che-server/blob/21edcc0cdac7add1b6e705c8fe0118b2e150d0da/wsmaster/che-core-api-factory-github/src/main/java/org/eclipse/che/api/factory/server/github/GithubApiClient.java
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.
Now it's just a small helper, which if moved to ApiClient should be expanded to have POJO for response, support authentication etc. so i stick to simpler variant.
…e#243) Signed-off-by: Max Shaposhnik <mshaposh@redhat.com>
…ipse-che#243) Signed-off-by: Sergii Kabashniuk <skabashniuk@redhat.com>
…es (eclipse-che#243) Signed-off-by: Sergii Kabashniuk <skabashniuk@redhat.com>
Signed-off-by: Max Shaposhnik mshaposh@redhat.com
What does this PR do?
Added check for unexisting files if the're hosted in the public repo. In this case a
404
response returned instead of OAuth login request.Fixed OAuth credentials reading from file
Screenshot/screencast of this PR
What issues does this PR fix or reference?
eclipse-che/che#20994
eclipse-che/che#21014
How to test this PR?
Setup Che, configure OAuth, create factory from public repo with devfile v2.0 but some missing files like
/.che/che-theia-plugins.yaml
. 401 was returned on this file previously, and factory failed. After fix 404 is returned, andfactory is launched successfully.
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.