-
Notifications
You must be signed in to change notification settings - Fork 56
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: don't error if source id doesn't exist #476
Conversation
As mentioned offline, need to be careful with this since the same code path is used by For the time being, it might be sufficient to use the source domain as the selector instead of ID. |
0b00164
to
7ddb4ea
Compare
As of the latest change:
Follow up changes that I've left out to keep this PR small: |
if err != nil { | ||
return err | ||
func login(options LoginOptions) error { | ||
// TODO (https://github.com/infrahq/infra/issues/488): support non-interactive login |
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.
What's the definition of non-interactive
in this context?
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 means to me adding support for command line parameters to fill in the fields we would other prompt user. Not sure if it will address the issues with desktop apps needing to reauth
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.
Yep that's correct, more specifically when no TTY is available for stdin
. For Desktop apps we should consider refresh tokens or another mechanism that allows for transparently renewing session duration
case errors.Is(err, terminal.InterruptErr): | ||
return nil | ||
case len(sources) == 0: | ||
return errors.New("Zero sources have been configured.") |
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.
Once we have APIs to add sources, this should prompt user to input a source rather than error out
Co-authored-by: Steven Soroka <steven@infrahq.com>
Co-authored-by: Steven Soroka <steven@infrahq.com>
02af524
to
8c40dfd
Compare
Fixes #408