-
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
Return empty credentials from bitbucket URL with username #466
Conversation
Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
@@ -147,6 +148,14 @@ public String getHostName() { | |||
return "https://" + HOSTNAME; | |||
} | |||
|
|||
@Override | |||
public Optional<String> getCredentials() { | |||
if (!isNullOrEmpty(username) && super.getUrl().getUserInfo().equals(username)) { |
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.
What if username
is a PAT ?
How do we handle this case?
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.
PAT is not supposed to be here. We don't support repository URL with PAT but we do support devfile url with PAT. The devfile url e.g. https://<PAT>@bitbucket.org/ivinokur/public/raw/HEAD/devfile.yaml
will not be handled by the BitbucketUrl
because it doesn't meet the regex pattern rules. It is handled by the DefaultFactoryUrl
which doesn't have this check.
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.
added a javadoc description
Build 3.6 :: server_3.x/139: Console, Changes, Git Data |
Build 3.6 :: sync-to-downstream_3.x/2755: Console, Changes, Git Data |
Build 3.6 :: push-latest-container-to-quay_3.x/1969: Console, Changes, Git Data |
Build 3.6 :: get-sources-rhpkg-container-build_3.x/2589: server : 3.x :: Build 51418654 : quay.io/devspaces/server-rhel8:3.6-26 |
Build 3.6 :: server_3.x/139: Upstream sync done; /DS_CI/sync-to-downstream_3.x/2755 triggered |
Build 3.6 :: update-digests_3.x/2528: Console, Changes, Git Data |
Build 3.6 :: update-digests_3.x/2528: No new images detected: nothing to do! |
What does this PR do?
Override the
getCredentials()
method in theBitbucketUrl
class to intercept bitbucket URL with username e.g.https://user@bitbucket.org/eclipse/che
. Return empty credentials for such urls.Screenshot/screencast of this PR
What issues does this PR fix or reference?
https://issues.redhat.com/browse/CRW-4095
How to test this PR?
chectl server:deploy -p=minikube -i=quay.io/ivinokur/che-server:next
https://ivinokur@bitbucket.org/ivinokur/public.git
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.