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

Conventions around Github (and other?) credentials #87

Open
dominykas opened this issue Sep 22, 2020 · 1 comment
Open

Conventions around Github (and other?) credentials #87

dominykas opened this issue Sep 22, 2020 · 1 comment

Comments

@dominykas
Copy link
Member

I keep hitting this problem, so I may as well post in here for opinions and possibly some sort of effort on a shared convention.

A bunch of tools we build rely on having access to Github. This implies having a Github token. That's all nice - you put it into a GITHUB_TOKEN (or GH_TOKEN) and off you go. That does not work when you need to access public Github and a Github Enterprise instance - in which case you need at least two tokens.

The approaches I've seen in the wild:

  • Provide two tokens via two env vars (e.g. GITHUB_TOKEN and a GITHUB_COM_TOKEN). Renovate takes this approach (although uses different names).
    • The major downsides of this is that the naming can get confusing and it only allows a single non-public GH instance (although I don't know if there's people who regularly access several different GHE instances)
  • "Borrow" credentials from other apps, if available. E.g. on macOS you might have git osx keychain credentials helper installed, or you could be using hub, which has credentials stored in ~/.config/hub.
    • It's probably unethical to do that without asking for user permission first, but the UX is great.
  • Read from .netrc, e.g. https://github.com/travi/octokit-auth-netrc (not exactly the same as above, as my understanding is that .netrc was meant to be shared between apps?)

A nice tool would probably support all of the above? Are there some other options that I've missed?

@wesleytodd
Copy link
Member

Only slightly related, but it might also be helpful if there were best practices or shared approaches we could take for encrypting/decrypting these so they are not just plain text on disk.

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

2 participants