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

Login command using device auth flow #14

Merged
merged 14 commits into from
Jul 26, 2024
Merged

Login command using device auth flow #14

merged 14 commits into from
Jul 26, 2024

Conversation

eikek
Copy link
Member

@eikek eikek commented Jul 19, 2024

Adds a login command using the device flow. The token is stored on disk in the "application folder" which is picked for each system according to the desktop standard.

The http client uses this token if it is available to do requests. After login has run successfully, private projects (with public repos :)) can be cloned with the clone command.

The access token can also be specified as an environment variable RENKU_CLI_ACCESS_TOKEN. In that case, the result from the login command will be ignored.

The openidconnect dependency is nice to use for this task, but one of its dependencies (rsa) has an open vulnerability, see here. This one has been added to the ignore list (of cargo audit and cargo deny).

eikek added 4 commits July 24, 2024 15:15
Still WIP…!
- token is stored on disk
- login can be done at once or in steps (might be interesting for scripts)
- output is not yet done
Instead of the login command, the access token can be specified via an
env var
@eikek eikek force-pushed the login branch 2 times, most recently from 9eb6003 to 558fcd7 Compare July 26, 2024 08:21
@eikek eikek added the enhancement New feature or request label Jul 26, 2024
@eikek eikek marked this pull request as ready for review July 26, 2024 08:52
@eikek eikek requested review from a team as code owners July 26, 2024 08:52
@eikek eikek requested review from Panaetius and olevski July 26, 2024 08:53
src/cli/cmd/login.rs Outdated Show resolved Hide resolved
src/httpclient.rs Outdated Show resolved Hide resolved
src/httpclient/auth.rs Outdated Show resolved Hide resolved
src/httpclient/cache.rs Outdated Show resolved Hide resolved
@eikek eikek requested a review from Panaetius July 26, 2024 14:41
@eikek eikek merged commit c2fe052 into main Jul 26, 2024
5 checks passed
@eikek eikek deleted the login branch July 26, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants