Skip to content
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

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

paddycarey
Copy link
Contributor

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 over StringP etc.).

@paddycarey paddycarey changed the title feat: Add ability to specify single connection for try-login [A0CLI-7] feat: Add ability to specify single connection for try-login Jan 26, 2021
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
defer func() { _ = s.Shutdown(ctx) }()
Copy link
Contributor Author

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 🤷🏻

Copy link
Contributor

@cyx cyx left a 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

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.")
Copy link
Contributor

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.")
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@paddycarey paddycarey merged commit 5d7c881 into main Jan 26, 2021
@paddycarey paddycarey deleted the a0cli-7 branch January 26, 2021 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants