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

Lab shouldn't store access credentials in .gitconfig #48

Closed
JoeNyland opened this issue Nov 26, 2017 · 6 comments
Closed

Lab shouldn't store access credentials in .gitconfig #48

JoeNyland opened this issue Nov 26, 2017 · 6 comments
Milestone

Comments

@JoeNyland
Copy link

It's not uncommon for users to version control their dotfiles. A common file to version control is ~/.gitconfig.

Lab currently stores and retrieves a users access token from git config. Having my Gitlab access token stored in .gitconfig means that I can no longer version control this file, which it important to me as this file contains shared configuration for all of my projects on my system.

If I understand the documentation for Lab currently, I could add my access credentials to .git/config in each projects repository on my system, but this is a very tedious and cumbersome workaround to the issue.

github/hub Helps it's users in this case by storing access tokens in an application specific config file ~/.config/hub, which is a file that's less likely to be version controlled by users. I think Lab should use a similar solution, or at least provide it as an alternative credential store to the current git config system.

github/hubs implementation is here, if it helps.

@zaquestion
Copy link
Owner

Thanks @JoeNyland, this seems like a fair assessment of current situation and I appreciate that you have specific usecases in mind. I've been talking about adding a config file for a few different things now. I'll move the global credentials in there when the time comes.

@JoeNyland
Copy link
Author

No worries! Ok, that sounds great! 🎉

@zaquestion
Copy link
Owner

@JoeNyland Planning to implement these changes soon and I wanted to offer a possible workaround in the meantime.

It looks like git 1.7.10+ supports sourcing other files for your .git config.
Ref: https://stackoverflow.com/questions/1557183/is-it-possible-to-include-a-file-in-your-gitconfig
I do something similar with my .bashrc by referencing a .bashrc.local.

This works for me using

$ git version
git version 2.11.0
lab version 0.5.2

.gitconfig

[user]
        name = Zaq? Wiedmann
        email = zaquestion@gmail.com
[include]
        path = .gitconfig.local

.gitconfig.local

[gitlab]
        host = https://gitlab.com
        user = lab-testing

@JoeNyland
Copy link
Author

Oh right, cool! I'll give that a go. Thanks!

zaquestion added a commit that referenced this issue Dec 18, 2017
[#48] (config) support lab.hcl config and move credentials into it.
@nkprince007
Copy link
Contributor

I think this has been solved. Closing it.

@zaquestion
Copy link
Owner

Not quite, it'll go out in 0.8.0

@zaquestion zaquestion reopened this Dec 19, 2017
@zaquestion zaquestion added this to the 0.8.0 milestone Dec 20, 2017
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

No branches or pull requests

3 participants