ui5-tooling icon indicating copy to clipboard operation
ui5-tooling copied to clipboard

[FEATURE] Proxy Backend Services

Open janmattfeld opened this issue 6 years ago • 9 comments

[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

janmattfeld avatar Jun 22 '18 10:06 janmattfeld

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.

RandomByte avatar Jun 25 '18 17:06 RandomByte

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?

cschuff avatar Jun 28 '18 13:06 cschuff

Full ack from my side @cschuff 👍

RandomByte avatar Jun 28 '18 13:06 RandomByte

@janmattfeld why do you think ui5-cli component is affected?

MichaelSp avatar Jul 13 '18 15:07 MichaelSp

@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:

janmattfeld avatar Jul 13 '18 18:07 janmattfeld

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

RandomByte avatar Jul 16 '18 13:07 RandomByte

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 avatar Mar 17 '19 22:03 mauriciolauffer

Does the current implementation as in the PR already support SAML authentication?

BenReim avatar Aug 22 '19 09:08 BenReim

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 👍

preetamkajalrout avatar May 30 '20 15:05 preetamkajalrout

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.

flovogt avatar Apr 18 '23 07:04 flovogt