-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add Bitbucket Server Urls validation by pattern match #761
Conversation
t -> { | ||
String scheme = t.contains("git@") ? "ssh" : uri.getScheme(); | ||
String host = uri.getHost() + (uri.getPort() > 0 ? ":" + uri.getPort() : ""); | ||
patterns.add(Pattern.compile(format(t, scheme, host))); |
Check failure
Code scanning / CodeQL
Regular expression injection High
user-provided value
/retest |
1 similar comment
/retest |
/retest |
@vinokurig: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
So...the
And |
@vinokurig , @artaleks9 : Eclipse Che Next with quay.io/eclipse/che-server@sha256:aa1eed8f02e62b505b792e1adda90538f7a9283a2ce0439ad40149c64d38a7c2 built from this PR as che-server has successfully started workspace from gogs server Git public repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dmytro-ndp, tolusha, vinokurig The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Build 3.20 :: server_3.x/381: Console, Changes, Git Data |
What does this PR do?
When we validate a Bitbucket Server url but neither oauth nor Personal Access Token is set up, we do a test Bitbucket Server Api request and if we get response with status 200 or 401 unauthorized, it means that the url is a Bitbucket Server url. The problem is that other unsupported git providers may also return such response on the test request. To make the check more specific, additionally test the url to match the Bitbucket Server url pattern.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
fixes eclipse-che/che#23303
How to test this PR?
see eclipse-che/che#23303
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
completedRelease Notes
Reviewers
Reviewers, please comment how you tested the PR when approving it.