Skip to content

Remove backend gateway and have javascript talk directly with the API#197

Merged
wjonassen merged 7 commits intoopendcs:mainfrom
wjonassen:feature/remove_gateway_from_webclient
Oct 2, 2024
Merged

Remove backend gateway and have javascript talk directly with the API#197
wjonassen merged 7 commits intoopendcs:mainfrom
wjonassen:feature/remove_gateway_from_webclient

Conversation

@wjonassen
Copy link
Collaborator

Currently, javascript hits its own webserver and then that is relayed to the api. This is unnecessarily complicated, so now the browser will talk directly with the API, removing that middle step.

Solution

The goal is to remove the gateway code completely and have the user set the path to the api in a config file.

how you tested the change

Need to test that all of the pages and ajax calls interact the same as before. NOTE - CORS settings will need to be set properly as well.

…ascript talk directly with the API. Added a context param to web.xml (Which I am not sure is the right place to do it), and it's accessed in decodes.jsp for all web pages to use.
@wjonassen
Copy link
Collaborator Author

This is just a small change to begin with so I can get some comments before I make the changes for the entire project. I've done login, as well as the platforms page. Once we agree, the rest of the pages will be updated to follow the same process.

Removed Gateway code.
Removed api.conf, since it's being declared in web.xml.
Fixed AlgorithmsTest.java because api.conf is not used anymore.
NOTE - Still need to test some of these changes, just getting the commit out there for comments on specifics and/or general flow.
Added the authentication_type and authentication_base_path context parameters so we can use sso, as well as basic auth.
Also, to go with the sso authentication, added some code in login.jsp to handle the sso authentication both visually and functionally.
The versions in libs.versions.toml need to be where they are at for the lower version of java.  There is also a vulnerability identified in this version, but until we update the supported java, this vulnerability will be there.
@wjonassen wjonassen merged commit cc0da42 into opendcs:main Oct 2, 2024
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 2, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 30%)
3.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

3 participants