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

Qs: using .ssh/config instead of github_token #154

Open
amerlyq opened this issue Dec 2, 2015 · 2 comments
Open

Qs: using .ssh/config instead of github_token #154

amerlyq opened this issue Dec 2, 2015 · 2 comments

Comments

@amerlyq
Copy link

amerlyq commented Dec 2, 2015

All my repos have changed local credentials:

[remote "origin"]
    url = ghub:amerlyq/airy
    fetch = +refs/heads/*:refs/remotes/origin/*

And symmetrical part in ~/.ssh/config is

Host ghub
    HostName github.com
    User git
    IdentityFile ~/.ssh/git_rsa

And of course, I have running gpg to provide key passphrase caching through session.
Therefore git_rsa already contains my identity and provides passwordless access.

Is it possible to use git_rsa instead of token?
Is there really still need to provide github token anyway? What I don't understand about this?
How can be changed code to conduct all api transactions through using git_rsa mechanics?

@jaxbot
Copy link
Owner

jaxbot commented Dec 2, 2015

Hi there,

The GitHub token is for accessing the API. Is it possible to access the API using the git_rsa? If so, I can add support for that. API docs are here: https://developer.github.com/v3/

(Sorry, finals week and can't dig into it right this second)

@amerlyq
Copy link
Author

amerlyq commented Dec 2, 2015

I haven't found a way to do this, however it doesn't mean there isn't.
Hoped, you had investigated deeper before.

Ok, therefore currently the only way to use plugin with raw token at work in more secure way is to encrypt token in gpg container and then read through system call.
Something like this (lazy load for NeoBundle):

if neobundle#tap('github-issues.vim')
  let g:gissues_lazy_load = 1
  let g:gissues_async_omni = 1
  " let g:github_upstream_issues = 1
  fun! neobundle#hooks.on_source(bundle)
    "" USE:(encrypt): printf '<token>' | gpg -eo '<path>.gpg'
    let path = expand('~/.cache/airy/gpg/github-token.gpg')
    let cmd = 'gpg --use-agent --quiet --batch --decrypt '.shellescape(l:path)
    let g:github_access_token = system(l:cmd)
  endf
  call neobundle#untap()
endif

However, I somehow caused old bug #120 to resurrect :(
(Edit) Maybe, it related to way how my local credentials defined? See uppermost message.
Hope you look into issue after finals. Good luck!

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