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

[p42] - settings under network #3742

Open
ilarimikkonen opened this issue Apr 9, 2019 · 3 comments
Open

[p42] - settings under network #3742

ilarimikkonen opened this issue Apr 9, 2019 · 3 comments

Comments

@ilarimikkonen
Copy link
Member

if selected proxy is p42, user can see only"proxy base path", "api base path" and port.

@ilarimikkonen
Copy link
Member Author

after saving setting, user can send requests via configured URLs

@ilarimikkonen
Copy link
Member Author

if possible, do not keep any information in local db, but state is in proxy

@matleppa
Copy link
Member

matleppa commented Apr 24, 2019

Current situation

It seems, that the functionality of connecting an API to Proxy 42 needs to be completely separated from the functionality of connecting an API to apinfUmbrella.

  • in apinfUmbrella case the connection information is stored in proxy and in addition to that, it is duplicated in local DB.
  • Handling the data exchange to apinfUmbrella proxy is intertwined with storing data to local database, which means that in Proxy 42 case also a kind of mock data record is needed to be stored in proxyBackend DB containing some data.
  • Also the sending and receiving requests and responses is heavily related to updating to data from form to db. Thus adding handling of proxy 42 HTTP requests and responses to that would increase the complexity in code.

Suggestion

Separate connecting an API to proxy 42 from API to apinfUmbrella completely

  • API > Settings
    • add a new button, e.g. [Proxy 42] to Settings page
    • when API is connected to apinfUmbrella, the Proxy 42 button is not visible
    • when API is connected to Proxy 42, the button [ApinfUmbrella] (replacing button [Network]) is not visible.

Proxy_42_layout.png

  • API > Settings > Proxy 42
    • when API is connected to Proxy 42, the id of used Proxy card is stored into API data as a new field
    • in case API is connected to Proxy 42, the correct Proxy card is found by Proxy Id in API data. From Proxy card can be read the URL, from where the API-Proxy connection data is requested from Proxy 42 using HTTP GET method. After data response is gotten, the data is filled in and shown on Proxy 42 connection page.
  • in case API is not connected to Proxy 42, a page with empty input fields is displayed.
  • the connection data can be filled (or changed) in input fields. When button [Save configuration] is clicked, the connection data is updated to Proxy 42 using HTTP POST request.
    • In successful case the Proxy card id is stored into API card.
    • in unsuccessful case the response error code with possible error message is shown as an alert on page, providing user a possibility to make corrections.
  • when the connection is successfully established, also a button [] possible to add connection, update connection or remove connection

When the API is successfully connected to Proxy 42, a new button [RESET CONFIGURATION] is included in the page.

Proxy_42_reset.png

By clicking this button the connection is removed by sending a HTTP DELETE request to Proxy 42 in question.

  • After successful response, the Proxy id is removed from API data and the button [RESET CONFOGURATION] is no more visible.
  • In unsuccessful case the HTTP error code and possible error message are displayed on page as an alert.

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

No branches or pull requests

2 participants