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

Manage git authentication for remote git https projects #13611

Closed
sunix opened this issue Jun 21, 2019 · 6 comments
Closed

Manage git authentication for remote git https projects #13611

sunix opened this issue Jun 21, 2019 · 6 comments
Labels
area/plugins kind/enhancement A feature request - must adhere to the feature request template. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. severity/P2 Has a minor but important impact to the usage or development of the system.

Comments

@sunix
Copy link
Contributor

sunix commented Jun 21, 2019

Description

In this proposal, I give an example using Github, but could be gitlab or anyother git providers.
In this proposal, I give an example using che.openshift.io, but could be any Che instance.

This is a proposal to simply manage github https authentication in Che for pushing changes.

The goal is to implement the flow where a user, using che.openshift.io would have almost nothing to do to be able to work on a github project and push his changes

  1. User starts a workspace (from a devfile or ...) containing github projects (https)

  2. User is redirected and is asked to loggin in che.openshift.io. che.openshift.io would ask for authorisation through Github OAuth to have push rights. Che gets a OAuth token and store that to keycloak. Retrieve that token with keycloak token exchange and store in the user preferences or cache it.

  3. For each github https projects and on each wanted containers set github token/oauth. Would be done automatically by Che-theia after clone and at startup for existing project. Something like:

    git config --global credential.helper 'cache --timeout=3600'
    cd /projects/myproject
    # Note that the push dry-run is just there to cache the username and password
    git push https://<gh-username>:<github-token-oauth>@github.com/user/myproject --dry-run
  4. User uses the theia user interface to commit and push (would need to fix push in theia) or the command line ... without having to enter his credentials everytime or setup any ssh keys.

Resources:

https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage
https://help.github.com/en/articles/caching-your-github-password-in-git
https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line#creating-a-token

Value for the users and customers

Users won't have to do anything else than authorising github oauth. This would be done with the web standards. The default https repos provided by github could be used (for logged user, by default, github suggests https clone URL when no ssh keys has been uploaded).

@sunix sunix added the kind/enhancement A feature request - must adhere to the feature request template. label Jun 21, 2019
@sunix sunix changed the title Proposal: Implement Che-theia github token, sso and https repos Proposal: manage authentification while pushing for github https projects Jun 21, 2019
@sunix sunix changed the title Proposal: manage authentification while pushing for github https projects Proposal: manage git authentication for remote github https projects Jun 23, 2019
@sunix sunix changed the title Proposal: manage git authentication for remote github https projects Manage git authentication for remote git https projects Nov 21, 2019
@sunix sunix added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Nov 22, 2019
@tsmaeder
Copy link
Contributor

As I understand it, the current state is no worse than what we would have to do on your own laptop.

@tsmaeder tsmaeder added team/ide area/editor/theia Issues related to the che-theia IDE of Che severity/P2 Has a minor but important impact to the usage or development of the system. and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Nov 28, 2019
@azatsarynnyy azatsarynnyy added area/plugins and removed area/editor/theia Issues related to the che-theia IDE of Che labels Feb 5, 2020
@azatsarynnyy
Copy link
Member

relabeled to area/plugins as it's related to git plugin

@sunix
Copy link
Contributor Author

sunix commented Feb 17, 2020

As I understand it, the current state is no worse than what we would have to do on your own laptop.

@tsmaeder It is a lot worse than on your own laptop:

  • if you use https, you would have to set manually your git credential store and would loose it after restart or if you create a new workspace
  • Ssh is not solving the problems: it requires the enduser to magically add a git ssh remote ... we could do it automatically though. I don't think this is done.

Maybe #15421 would be part of the solution.

@che-bot
Copy link
Contributor

che-bot commented Aug 21, 2020

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 21, 2020
@ericwill ericwill added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 21, 2020
@l0rd
Copy link
Contributor

l0rd commented Dec 17, 2021

Should be addressed by #20583

@l0rd
Copy link
Contributor

l0rd commented Jan 23, 2023

Implemented a long time ago. Closing.

@l0rd l0rd closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/plugins kind/enhancement A feature request - must adhere to the feature request template. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. severity/P2 Has a minor but important impact to the usage or development of the system.
Projects
None yet
Development

No branches or pull requests

7 participants