-
Notifications
You must be signed in to change notification settings - Fork 787
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
Use gitcredential helpers for git authentication #5463
Comments
@ccojocar ^^ |
I think this is the way to go for git auth. We can implement a custom credentials helper for vault and one for k8s secrets, even though in the case of k8s secrets the Tekton pipeline should pre-configure the git in the build pods from the secret attached to the service account without I would like to have a credential helper which is able to read/write git credentials in/from vault something liken Some examples: It is also possible to query credentials form helper via git. See |
There is second option which might be a bit easier to implement. We could leverage the GIT_ASKPASS env variable. We could set it either where needed or as early as a We could set GIT_ASKPASS to This approach would solve authentication for all cases where The disadvantage of this approach is that it won't work for users using the git CLI directly. There a dedicated k8s-cred-helper is superior, since once configured it will work regardless of whether git is called as part of a |
See discussion around git authentication on this PR as well #5850 (comment) |
Issues go stale after 90d of inactivity. |
Issues go stale after 90d of inactivity. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. |
Stale issues rot after 30d of inactivity. |
Rotten issues close after 30d of inactivity. |
@jenkins-x-bot: Closing this issue. 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 jenkins-x/lighthouse repository. |
Following up on issue #5341 which used a different approach for fixing the problem around
ForkAndPullRepo
inhelpers.go
.The idea is to find a more holistic approach of handling git authentication locally as well as in the pipeline.
To avoid writing anything to disk, git's credential helpers, in particular the cache helper, could be used. The cache helper stores the credentials for a specified time in memory. The credentials never hit the disk. The idea is to add something along this line to
Gitter
:This way, when dealing with repositories which need authentication one can call
CacheCredendials
once with an appropriate timeout and then call other methods of theGitter
interface without having to think about the credentials.As a further step, one can then imagine providing our own credential helper. There is an API for that. This custom credential helper could be a standalone program or a
jx
command. It would then retrieve the credentials from the cluster.This mechanism would also solve the issue around
jx import
adding the API token to the git remote.See also https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
The text was updated successfully, but these errors were encountered: