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

mountPath and BasicAuth for Proxy #1

Closed
itelSchiller opened this issue Jun 2, 2020 · 11 comments
Closed

mountPath and BasicAuth for Proxy #1

itelSchiller opened this issue Jun 2, 2020 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@itelSchiller
Copy link

Hi,

Your tool is really cool! It would make the work of some of our developers easier.
But there is still one part missing for efficient work.

For OData BasicAuth and MountPath would be helpful.
Mounthpath is very often needed to simulate a "destionation"
https://www.npmjs.com/package/ui5-middleware-proxy-basicauth
https://www.npmjs.com/package/ui5-middleware-simpleproxy

@CarlosOrozco88 CarlosOrozco88 added the enhancement New feature or request label Jun 2, 2020
@CarlosOrozco88 CarlosOrozco88 moved this from To do to Server TODO in ui5-tools | Tasks Jun 2, 2020
@CarlosOrozco88 CarlosOrozco88 self-assigned this Jun 2, 2020
@CarlosOrozco88
Copy link
Owner

CarlosOrozco88 commented Jun 2, 2020

  • Other odataProxy configuration
  • MountPath configuration
  • ODATA auth

@CarlosOrozco88
Copy link
Owner

CarlosOrozco88 commented Jun 2, 2020

I published a new version with mountpath configurable, it works with odataProxy "Other" configuration.

You can change it in the workspace configuration or with command ui5-tools.configurator.odataProvider

@itelSchiller
Copy link
Author

I have tested it with the north wind service, but it does not seem to work.
image
image

@CarlosOrozco88
Copy link
Owner

CarlosOrozco88 commented Jun 3, 2020

Hi,

could you try now with version 0.1.8?
Additionally, when Other odataProxy is configured, odataUri and odataMountPath accepts multiple entries:

Configuration:
image

Using first proxy:
image

Using second proxy:
image

You can check it with the example workspace included in this repo.

Thanks for de feedback!

@itelSchiller
Copy link
Author

Great, now it works!
That would help a lot of people in the development.

Only in a special case does it get complicated. If mine calls up a server/gateway with a port in the URL https://my.internal.Server:com:8443/

Then the following error appears:
GET http://localhost:3000/mydestination 500 (Internal Server Error)
Error occured while trying to proxy to: localhost:3000

@CarlosOrozco88
Copy link
Owner

CarlosOrozco88 commented Jun 4, 2020

I dont know how to check this error, i use this config in work that use ports in the url:
image
Your url https://my.internal.Server:com:8443/ contains two :, i dont know if this could be the problem...
That config "is the same" that this one:
image

By the way, if you think its necessary, i can concatenate the odataMountPath with odataUri in order to avoid this configuration, so it will look like in the future:
image
I dont like this, because then you cant customice odataMountPath with "random" string and forces to exist that path in odataUri server)

Also i think its necessary another config property to separate resourcesUri and odataUri, and Other option to resourcesProxy that allows to customice resourcesUri

@itelSchiller
Copy link
Author

The : behind com was accidental.

Probably that are my own network problems. Because I call it up over VPN.
I can access Gateway's OData service directly from the browser, but not the proxy.

@CarlosOrozco88
Copy link
Owner

Im calling it up over VPN too.
I think i will activate logLevel of this proxy to debug and other proxys to error debugLevel (next version), then in vscode menu: Help > Toggle Developer Tools > Console so you can check the logs, i hope we can find some helpfull messages...

By the way, you can check it now but all proxy are in info debugLevel.

@CarlosOrozco88 CarlosOrozco88 moved this from Server TODO to Done in ui5-tools | Tasks Jun 8, 2020
@CarlosOrozco88
Copy link
Owner

Now you can create a .env file in root workspace with:
UI5TOOLS_ODATA_USER=user1
UI5TOOLS_ODATA_PASSWORD=pass1
If you have multiple destinations, then the next ones:
UI5TOOLS_ODATA_USER_2=user2
UI5TOOLS_ODATA_PASSWORD_2=pass2
UI5TOOLS_ODATA_USER_3=user3
UI5TOOLS_ODATA_PASSWORD_3=pass3
...
Can you have a look, please?

Thanks!

@itelSchiller
Copy link
Author

itelSchiller commented Jun 9, 2020

that works with authentication. also with the mutiple mountpath/destionation

thanks with the dev tools tip

My own mistake is that the gateway has a self-signed certificate. Either you would have to install the certificate on your device, or you could disable this SSL check, like in Postman or in the ui5-tooling-middleware (see screenshots)
Bildschirmfoto 2020-06-09 um 08 40 21
image

@CarlosOrozco88
Copy link
Owner

Hi!

In 0.3.1 ssl check is disabled by default. I hope this solves the problem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants