Closed Gustash closed 1 year ago
Since we need things like serial client_id etc.later on I beliebe --skip-instructions
should contain everything we need alonside with generated url.
Then we can add a flag or another subcommand which would expect those parameters with authorization code (we can separate the code from the url in Heroic itself).
Take a look at https://github.com/imLinguin/nile/blob/main/nile/api/authorization.py#L73 to see what parameters are needed.
This issue is in relation to the Heroic Games Launcher integration.
Why
Currently, the cli can only login through user interaction.
In theory we could make it work for Heroic, but it would require a lot of work and be finicky. For example, we would need to parse the URL from all the instructions, find a hacky way to stop the tool from opening a separate browser for login, and keep a child process around until login completion.
Proposal
What I propose is a two step solution:
--skip-instructions
flag that, as the name suggests, skips showing the instructions, prints only the URL to stdout and exits--redirect-url
argument to auth, so we can send a valid URL whenever available and have Nile then complete the sign-in processIssues to be addressed
I've already been toying around with these proposals. The only issue right now is that we're storing the code_verifier in the class instance, so we'd need to send whatever data is required to finish login with
--skip-instructions
.Discussion
If these proposals sounds, well, sound, my question is on what the output format for
--skip-instructions
should be. Just newline separated, positional, output? Maybe JSON would be easier to parse? Add support for both through a flag?I'd like to have a discussion over this before contributing something, to make sure we all agree on implementation details.