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

password from a pipe or a non-terminal #12

Open
gilleslamiral opened this issue Apr 2, 2018 · 3 comments
Open

password from a pipe or a non-terminal #12

gilleslamiral opened this issue Apr 2, 2018 · 3 comments

Comments

@gilleslamiral
Copy link

Hi,

I hope gts is meant to be run also without a end-user ready to type a password at each run.

The syntax documented as username:password no longer works.
The code main() has:

    pw = getpass.getpass('Password:')

I suggest to replace it with:

    if sys.stdin.isatty():
        pw = getpass.getpass('Password:')
    else:
        print 'Password:'
        pw = sys.stdin.readline().rstrip()

This way it'll be possible to use:

{ sleep 1; cat secret.nchah ; } | gts 'nchah' 'github-traffic-stats' 'save_csv'

Otherwise I'm open to any other suggestion to avoid a user typing the password at each request.
Thanks in advance!

@AnthonyBloomer
Copy link
Collaborator

This is a good suggestion. It would be good if we only have to authenticate once similar to how heroku-cli works for example.

@nchah
Copy link
Owner

nchah commented Apr 6, 2018

+1 to this idea. Other users may have implemented their own workarounds to avoid typing in the pw each time, but this looks like a good option to support. I can add this in next week when I have some time, or feel free to start up a PR. : )

@gilleslamiral
Copy link
Author

Thanks!

I've patched mine so it's ok. Just glad I'll won't have to next time!

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