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

command(login): validate that the provided hippo URL is valid #826

Merged
merged 1 commit into from
Oct 18, 2022

Conversation

endocrimes
Copy link
Member

I have no idea what the "idomatic rust" way to do this is, so I'm going vaguely based on how we return errors elsewhere in the login command.

Previous behavior:
One would be prompted to choose an auth method before then receiving a reqwest error.

New behavior:

[spin(dani/validate-hippo-url)] $ ./target/debug/spin login --url some-nonsnese
Error: Invalid Hippo URL, should be in the format "https://my-hippo-instance.com". "some-nonsnese": relative URL without a base

Happy to workshop on the error message itself (and if you point me to where integration testing happens I'm happy to add a regression test).

Signed-off-by: Danielle Lancashire dani@builds.terrible.systems

src/commands/login.rs Outdated Show resolved Hide resolved
src/commands/login.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@lann lann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@endocrimes endocrimes force-pushed the dani/validate-hippo-url branch 2 times, most recently from cf0cb26 to a2b950a Compare October 18, 2022 14:40
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
@endocrimes endocrimes merged commit 58847df into fermyon:main Oct 18, 2022
@endocrimes endocrimes deleted the dani/validate-hippo-url branch October 18, 2022 16:18
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.

3 participants