ui5-tooling
ui5-tooling copied to clipboard
[FEATURE] Proxy Backend Services
[Enhancement] Reverse Proxy
While using ui5 serve
, it would be great to proxy existing (OData) backend services to get around Access-Control-Allow-Origin (CORS) errors.
Affected components
- [ ] ui5-builder
- [X] ui5-server
- [X] ui5-cli
- [ ] ui5-fs
- [ ] ui5-project
- [ ] ui5-logger
There is already a very simple proxy available that we took over from grunt-openui5: https://github.com/SAP/ui5-server/blob/master/lib/server.js#L62
Basically you can have requests like http://localhost/proxy/http/example.com/foo
and they get proxied to http://example.com/foo
.
However, I guess you are referring to a more advanced reverse proxy solution. At least that's something we heard from many developers at UI5con.
We'll try and create an RFC such a feature soon. There are apparently many ways we could takle a proxy and we should think about those beforehand.
Changing the service url in a way like that requires adaption of project code (here: e.g. serviceUrl
in manifest.json
).
Using a proxy solution should not require any changes to actual project code since those changes could easily make it's way into test/productive systems (and break things) and it's just a hazzle to maintain...
A configurable proxy solution should allow for registration of
- source path
- target url
- and may be some more... (see
http-proxy-middleware
)
In my opinion ui5-server
should come with this feature since I believe that at least 90% of the people using it will need it. Supporting this might be crucial for the acceptance of ui5-server
in general. What do you think?
Full ack from my side @cschuff 👍
@janmattfeld why do you think ui5-cli
component is affected?
@MichaelSp Afterall, ui5-server
provides the functionality of ui5 serve
within the ui5-cli
. So every new feature might introduce a different or extended configuration and new command line options :smile:
As signaled above, I finally created an RFC to tackle this topic: https://github.com/SAP/ui5-tooling/blob/rfc-proxy/rfcs/0003-proxy.md
I'm especially interested in your feedback on the use cases the proxy should solve: https://github.com/SAP/ui5-tooling/blob/rfc-proxy/rfcs/0003-proxy.md#possible-use-cases Does the list cover yours? If yes, which one?
Please have a look and leave a comment in the corresponding PR: https://github.com/SAP/ui5-tooling/pull/41
I'm not sure whether it could be part of this enhancement or not, but a functionality to use local destinations files, as we have in SAP Web IDE Personal Edition, would be great!
Does the current implementation as in the PR already support SAML authentication?
I'm not sure whether it could be part of this enhancement or not, but a functionality to use local destinations files, as we have in SAP Web IDE Personal Edition, would be great!
@mauriciolauffer : Not sure if you still need it. Give it a try to middleware I created for my use-case. ui5-middleware-destination
Feedback are welcome 👍
More sophisticated proxy solutions for ui5-server are now available in the form of custom middleware extensions from the UI5-community.
Currently, it is not planned to introduce a proxy into ui5 server. Therefore, closing this enhancement request.