Skip to content

Adapt VSCE token share mechanism in src-cli

Created by: eseliger

The VSCode extension can pass back an access token to the extension, so you don't have to copy the token anywhere. This would actually be a lovely way to set up src as well, IMO.

Proposed flow:

// User types
$ src login <URL>
// Browser opens/src logs a URL to navigate to and waits, opens an HTTP server in the background to receive the token
// UI shows "Authorize src-cli" instead of generic token create UI
// src logs success!

This would require that we reintroduce the src config file though that we got rid of about 2 years ago. I personally think this is absolutely acceptable. We take env vars, because it's easy in CI, but I think offering a config file as well would not hurt at all. All tools I know support that. If there are concerns about storing the token plain text on-disk we can also investigate using the keychain / other OS specific things.