-
Notifications
You must be signed in to change notification settings - Fork 55
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
[A0CLI-7] feat: Add ability to specify single connection for try-login #39
Conversation
internal/cli/try_login.go
Outdated
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) | ||
defer cancel() | ||
defer func() { _ = s.Shutdown(ctx) }() |
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.
We don't actually care about the error here if there is one. The process will tear down immediately after this anyway and bring the server down with it regardless 🤷🏻
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.
Bunch of flag questions otherwise looks great
internal/cli/try_login.go
Outdated
cli.renderer.TryLogin(userInfo, tokenResponse, reveal) | ||
return nil | ||
}, | ||
} | ||
|
||
cmd.SetUsageTemplate(resourceUsageTemplate()) | ||
cmd.Flags().StringP("client-id", "c", "", "Client ID for which to test login.") | ||
cmd.Flags().BoolP("reveal", "r", false, "⚠️ Reveal tokens after successful login.") | ||
cmd.Flags().StringVarP(&clientID, "clinet-id", "c", "", "Client ID for which to test 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.
Typo on flag
cmd.Flags().BoolP("reveal", "r", false, "⚠️ Reveal tokens after successful login.") | ||
cmd.Flags().StringVarP(&clientID, "clinet-id", "c", "", "Client ID for which to test login.") | ||
cmd.Flags().StringVarP(&connectionName, "connection", "", "", "Connection to test during login.") | ||
cmd.Flags().BoolVarP(&reveal, "reveal", "r", false, "⚠️ Reveal tokens after successful 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.
Short flag empty by design?
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.
I wasn't really sure what to use here tbh, c
is already taken and not sure what else makes sense.
https://auth0team.atlassian.net/browse/A0CLI-7
This PR adds the ability to specify a single connection when using
try-login
. This allows easy testing of new connections.In addition, the PR also includes a fix to propagate errors from the callback request (the one intercepted by our local HTTP server) to the CLI, and updates flag usage to be more consistent with other commands (
StringVarP
overStringP
etc.).