-
Notifications
You must be signed in to change notification settings - Fork 108
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
CLI - Just-in-time login flow #2158
Conversation
…nto bfops/anonymous-cli
We should probably print something explaining what happens. e.g.
|
Done. I just did a simple message though. Feel free to iterate on it more (inline in the diff). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good to me. Thanks for addressing the feedback and also for the detailed testing section and comments. It made review very straightforward.
I'm going to merge this given how much trouble I'm having triggering the |
Description of Changes
When a user goes to perform an action that requires logging in, we prompt them whether they want to log in.
If they decline to log in, we auth them directly with the server that they're trying to access.
Note: We are still using the endpoint-based auth flow, and not doing any kind of scan for a key on the local machine! I have never gotten an answer for what code I'm supposed to use to encrypt a token "manually" once I have the key in hand. IIRC when we last discussed, we said it was fine to keep using this endpoint, but if not then I would still need to know where that code lives / how to use it.
The following commands now have the potential to prompt the user to log in:
call
delete
describe
rename
energy
list
logs
publish
sql
subscribe
All of these commands have been updated to have a
--yes
parameter (if they didn't already). Somewhat unintuitively, this will actually answer "no" to the "log in with spacetimedb.com?" prompt so that it can obey its deeper mission of proceeding non-interactively.The
login show
command has not been updated to this "just in time" login behavior. It seems unintuitive to prompt the user to log in when they're trying tologin show
. Instead, it tells them they're not logged in.API and ABI breaking changes
API breaking in the sense that it adds a confirmation prompt to many CLI actions.
Expected complexity level and risk
2
Testing
login show
works properly when logged inlogin show
gives an error when not logged in