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

Proxy settings never save when submitting invalid host #1822

Closed
brylie opened this issue Oct 26, 2016 · 12 comments
Closed

Proxy settings never save when submitting invalid host #1822

brylie opened this issue Oct 26, 2016 · 12 comments
Assignees
Labels

Comments

@brylie
Copy link
Contributor

brylie commented Oct 26, 2016

When submitting proxy settings for an API with an invalid host, the Proxy Settings form never submits. The end-user is not informed of any problem, even though API Umbrella likely rejected the submission since the host does not exist.

Steps to reproduce

  1. Add an API
    • enter any title and description
    • for the host, enter a domain name that does not exist
  2. Go to the API details page
  3. Click the Proxy tab
  4. Enter proxy details
  5. Click 'Save and Publish'

Expected result

The proxy form should indicate to the user that the submission has failed, exiting the 'pending' state.

Observed result

The proxy form remains in the 'pending' state, never completing the submission.

Screencast

peek 2016-10-26 15-33

@marla-singer
Copy link
Contributor

@brylie It happens because we don't have the special conditions in this line.
https://github.com/apinf/platform/blob/develop/proxy_backends/client/form/autoform.js#L41
When host is invalid, error isn't catched and response has structure:

errors: {
 ["failed [422] {"errors":{"servers[0].host":["Could not resolve host: no address for proxy.api"]}}"]
}
http_status: 422
result: {}

I detected it when was debbuging

@marla-singer
Copy link
Contributor

@bajiat Interesting

@brylie
Copy link
Contributor Author

brylie commented Oct 26, 2016

@marla-singer thanks for the details. How difficult do you suppose this would be to fix?

@marla-singer
Copy link
Contributor

marla-singer commented Oct 26, 2016

@brylie If me guess is correct, it's about a hour. We don't save the proxy settings, if host is invalid, yes?And notify user about invalid host

@bajiat
Copy link
Contributor

bajiat commented Oct 26, 2016

@marla-singer Sold! This is also yours, if you have time in addition to #1699

@brylie
Copy link
Contributor Author

brylie commented Oct 26, 2016

Right, the form should go back to 'edit mode', and the user should be informed that the host is invalid.

This will require the user to

  1. go to the API Settings tab,
  2. change the host, and
  3. come back to the Proxy tab.

@Nazarah @bajiat is there a different user flow we should consider here?

@bajiat
Copy link
Contributor

bajiat commented Oct 26, 2016

@brylie So we need explicitly to tell them that they need to go to Settings tab?

@marla-singer
Copy link
Contributor

@bajiat Nope, It's obviously, I think

@Nazarah
Copy link
Contributor

Nazarah commented Oct 26, 2016

@brylie, according to @bajiat can we somehow verify the host while adding the API? a simple Pinging using HTTP GET? if no response is found, we can reject adding the API

@brylie
Copy link
Contributor Author

brylie commented Oct 26, 2016

we somehow verify the host while adding the API? a simple Pinging using HTTP GET?

That would mitigate the issue. We would still have a potential problem if API Umbrella rejects the Proxy settings for any reason, since we are not handling failure in the code @marla-singer mentioned.

@bajiat
Copy link
Contributor

bajiat commented Oct 26, 2016

I'm ok with alerting user and going back to edit mode.

@bajiat
Copy link
Contributor

bajiat commented Oct 26, 2016

We can decide whether we want to check host already when API is added to Catalog later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants