ansible / mazer

Experimental Ansible Galaxy Content Manager
GNU General Public License v3.0
114 stars 18 forks source link

Login Command just like ansible-galaxy #238

Open ironfroggy opened 5 years ago

ironfroggy commented 5 years ago

Feature Request

Use Case

Users need a clear authentication option and, sorry, copying and pasting from a preferences page every single time they invoke the command isn't a clear option. Especially if we expect users to come from ansible-galaxy which has a simple login command. The git log even shows Mazer used to have this command from its inherited codebase, but it was deleted.

Proposed Solution

Incorporate the same login command to Mazer, saving the token to the same location OR to a Mazer config somewhere appropriate.

Alternatives

Just read an authentication token from ~/.ansible_galaxy if one already exists from a login by ansible-galaxy. Users of Mazer almost definitely already have this. You could even just tell them to log in with ansible-galaxy and allow Mazer to share the token.

Implementation

1) Provide a default value for --api-key that just reads from ~/.ansible_galaxy 2) Restore or re-copy the login command to prompt the user for Github credentials and acquire a key from the Galaxy token APIs.