globocom / huskyCI

Performing security tests inside your CI
https://huskyci.opensource.globo.com
BSD 3-Clause "New" or "Revised" License
572 stars 137 forks source link

Add OAuth2 login functionality into cobra CLI #507

Closed rafaveira3 closed 4 years ago

rafaveira3 commented 4 years ago

Motivation

To have features like vulnerability management (and many others), we need to have some kind of authentication in huskyCI.

If we have a CLI command that will log in users using Github and Gitlab, for instance, we will have the possibility to check which repositories a developer has access to, profile image, and many others.

It would be great if

We have an OAuth2 solution coded in our CLI by implementing a cobra command login.

What we expect

By typing the following command, huskyCI must be able to redirect the authorization request to an OAuth2 provider (Github? ❤️) open a web browser for the user to complete the login, and store the token into a file .huskyci to be used later on.

$ huskyci login
Successfully logged in!

Tips

lzakharov commented 4 years ago

I would like to take it up! I think to use the device flow for the authorization and I need to know the client id (for the first time I can create my own GitHub App).