-
Couldn't load subscription status.
- Fork 1.8k
fix(#8940): token-authentication header typo in git resolver #8937
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(#8940): token-authentication header typo in git resolver #8937
Conversation
| token := base64.URLEncoding.EncodeToString([]byte(repo.username + ":" + repo.password)) | ||
| env = append( | ||
| env, | ||
| "GIT_AUTH_HEADER=Authorization: Basic "+token, |
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.
Authorization: Basic .... vs Authorization=Basic ... appears to have been the issue @vdemeester
| } | ||
| } | ||
|
|
||
| func TestGitResolver_HTTPAuth(t *testing.T) { |
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.
WIP regression test here
|
The following is the coverage report on the affected files.
|
|
/kind bug |
acb78f0 to
7deb329
Compare
|
The following is the coverage report on the affected files.
|
7deb329 to
41fdbc9
Compare
|
The following is the coverage report on the affected files.
|
41fdbc9 to
217779c
Compare
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
|
The following is the coverage report on the affected files.
|
cb051af to
63472b1
Compare
The header specified for the git resolver's http auth contained a typo leading to authentication tokens not being properly sent to the remote. Additionally, this change fixes the outdated token-authenticated git resolver example and adds an e2e regression test for authenticated git cloning. Resolves: tektoncd#8940 Resolves: https://issues.redhat.com/browse/SRVKP-8260
63472b1 to
e25050f
Compare
|
The following is the coverage report on the affected files.
|
| scmTokenSecretKey: []byte(base64.StdEncoding.Strict().EncodeToString([]byte(token))), | ||
| scmTokenSecretKey: []byte(token), |
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.
I'm not sure why this was base64 encoded on the application side. When I made the gitea repo private, API auth also broke until I removed this base64 encoding. I think it was mistakenly though to be required, however the base64 encoding looks to be happening server-side after the secret is created.
|
/cc @waveywaves |
|
/retest |
1 similar comment
|
/retest |
|
/lgtm but consider the renaming issue |
|
@chmouel: changing LGTM is restricted to collaborators In response to this:
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/test-infra repository. |
|
|
||
| _, _, err = giteaClient.CreateOrgRepo(scmRemoteOrg, gitea.CreateRepoOption{ | ||
| Name: scmRemoteRepo, | ||
| Private: true, |
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.
👍
|
/approve |
|
@vdemeester, will wait for the last lgtm from you. Once this is in, we will make sure to cherry-pick it to 1.0.x. /cherry-pick release-v1.0.x |
|
@waveywaves: once the present PR merges, I will cherry-pick it on top of release-v1.0.x in a new PR and assign it to you. In response to this:
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/test-infra repository. |
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.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester, waveywaves The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@waveywaves: new pull request created: #8941 In response to this:
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/test-infra repository. |
|
I don't think my comment about renaming field without a migration plan was addressed before merging... (and it doesn't encourage to do any reviews on tektoncd/pipeline tbh) |
|
@chmouel yes, I didn't see it addressed as well. I will see it addressed and also have the necessary change cherry picked as well as required. Guess the comment got glossed over in the interest of getting this fix through. |
@chmouel Sorry for not addressing your comment properly. There is no user action or migration necessary and no fields have changed in this PR. The example's field was corrected, since it was using the |
|
@aThorp96 we need to backport this to versions of tekton where this fix is needed. I have already created a cherry pick for 1.0.x, creating more for 1.1.x and 1.2.x and this is already in 1.3.x. Let me know if you could look into the cherry picks and see if it would be possible for you to review them. Would appreciate it. I can take a look at them later. |
|
/cherry-pick release-v1.1.x |
|
/cherry-pick release-v1.2.x |
|
@waveywaves: new pull request created: #8946 In response to this:
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/test-infra repository. |
|
@waveywaves: #8937 failed to apply on top of branch "release-v1.2.x": In response to this:
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/test-infra repository. |
Changes
The header specified for the git resolver's http auth contained a typo
leading to authentication tokens not being properly sent to the remote.
This change fixes the typo in the header and also ensures the auth
setting is present for all git operations instead of just
clone, since otheroperations such as
fetchmay require remote authentication.Additionally, this change fixes the outdated token-authenticated git
resolver example and adds an e2e regression test for authenticated git
cloning.
Resolves: #8940
Resolves: https://issues.redhat.com/browse/SRVKP-8260
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
/kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes