fue icon indicating copy to clipboard operation
fue copied to clipboard

Token caching/GitHub authentication dependent on Mac keychain

Open zpanula opened this issue 7 years ago • 1 comments

The current setup for creating and storing a token, or depending on one existing in the keychain, doesn't work cross-platform. If we skip the keychain checks, github_token doesn't work if a token already exists.

The convenience for Mac users is nice, but is there a way we can find an abstraction for cross-platform keychains, or some other alternative? Not being able to create a token when one exists also makes this difficult. Also, all of the current tests passed despite this critical issue.

Maybe we can scale back to manual token authentication, write more rigorous tests, and make things less platform-dependent?

Personal suggestion for simplifying password input:

def get_secure
  require 'highline'
  cli = HighLine.new
  input = cli.ask("Enter #{username}'s GitHub password (never stored):" { |q| q.echo = false } # alt. q.echo = "*"
  input
end

Cutting out the dependence on stty

Eager to hear your thoughts!

zpanula avatar Aug 31 '18 16:08 zpanula

I am down for anything that works cross platform. In fact I think it would be great to have a cross-platform gem that abstracts asking and storing credentials for anything, and we can start by implementing this here and extracting it next.

For OSX there are a number of libraries that should be able to replace the actual implementation of calling security, https://github.com/fcheung/keychain is an example.

Also #10 and #11.

dblock avatar Aug 31 '18 16:08 dblock