Skip to content
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

Configure Git to use bearer token auth mechanism #684

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

michaelsauter
Copy link
Member

@michaelsauter michaelsauter commented Mar 29, 2023

Tekton prepares the creds to be used through basic auth, which fails when the Bitbucket server has basic auth disabled.

Fixes #683

Tasks:

  • Updated design documents in docs/design directory or not applicable
  • Updated user-facing documentation in docs directory or not applicable
  • Ran tests (e.g. make test) or not applicable
  • Updated changelog or not applicable

@michaelsauter michaelsauter self-assigned this Mar 29, 2023
cmd/start/git.go Outdated
)

// gitCheckout encapsulates the steps required to perform a Git checkout
type gitCheckout struct {
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI: everything except this type and its methods is just moved from main.go.

httpProxy string
httpsProxy string
noProxy string
url string
gitFullRef string
sslVerify string
Copy link
Member Author

Choose a reason for hiding this comment

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

FYI: When refactoring I noticed that these two params are currently unused in the checkout so I removed them.

[]string{"config",
fmt.Sprintf("http.%s/info/lfs.extraHeader", opts.bitbucketURL),
fmt.Sprintf("Authorization: Bearer %s", opts.bitbucketAccessToken),
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Those two config settings are the real change here.

Defines if http.sslVerify should be set to `true` or `false` in the global
Git config.
type: string
default: 'true'
Copy link
Member Author

Choose a reason for hiding this comment

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

As the params are not read anymore in the Go binary, we cut them here as well.

@michaelsauter michaelsauter force-pushed the fix/bitbucket-bearer-token branch 3 times, most recently from 1544d5f to 96bc7e6 Compare March 29, 2023 14:02
Tekton prepares the creds to be used through basic auth, which fails
when the Bitbucket server has basic auth disabled.

Fixes #683
@michaelsauter michaelsauter merged commit 96626e4 into master Mar 31, 2023
@michaelsauter michaelsauter deleted the fix/bitbucket-bearer-token branch March 31, 2023 07:34
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.

Git clone fails when basic auth is disabled on Bitbucket
2 participants