Skip to content

Conversation

@vinokurig
Copy link
Contributor

@vinokurig vinokurig commented Nov 20, 2024

What does this PR do?

Do not encode access token for git-credentials secrets

Screenshot/screencast of this PR

What issues does this PR fix or reference?

https://issues.redhat.com/browse/CRW-4560

How to test this PR?

The fix resolves a problem that can not be reproduced permanently. Since the fix changes the oauth logic, we need to test all possible oauth related cases.

PR Checklist

As the author of this Pull Request I made sure that:

Release Notes

This fix resolves a bug when project is not cloned if a personal access token, generated from bitbucket server, contains special characters.

Reviewers

Reviewers, please comment how you tested the PR when approving it.

@openshift-ci
Copy link

openshift-ci bot commented Nov 20, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vinokurig

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

scmUrl.getProtocol(),
getUsernameSegment(personalAccessToken),
URLEncoder.encode(personalAccessToken.getToken(), UTF_8),
personalAccessToken.getToken(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to know why previously it was done in that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added a long time ago by @mshaposhnik, I don't think we can find the reason.

Copy link
Contributor

@mshaposhnik mshaposhnik Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey guys,
it was done so cuz sometimes tokens may contain symbols which are disallowed or bad to use in URL's (like @, :, # etc)
see https://serverfault.com/a/1001324

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mshaposhnik for the explanation, looks like we would need to find a better solution

@vinokurig vinokurig closed this Nov 21, 2024
@vinokurig vinokurig deleted the CRW-4560 branch April 15, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants