Closed mlucascardoso closed 4 years ago
I believe, this is happening because proxy server created by middleware is http & target destination ( google ) is https. This is working fine in case of destination type: "service" (SAPUI5 resources).
Will have a look over the weekend and see if I can test this theory! If you can point some test scenarios, It would be really helpful.
I believe, this is happening because proxy server created by middleware is http & target destination ( google ) is https.
You're right, I've tested some http endpoints and they worked fine.
Will have a look over the weekend and see if I can test this theory! If you can point some test scenarios, It would be really helpful.
Ok, i think i have a good scenario:
Let's imagine that I need to consume SAP Identity Provider (IDP) API to deal to users CRUD. In production NEO environment I would create a destination to point to the IDP to consume it via SAPUI5. So to test it locally my configuration would be something like this:
destinations.json:
{
"destinations": {
"sapui5": {
"Description": "SAPUI5 Resources",
"cdn": "https://sapui5.hana.ondemand.com",
"localDir": false
},
"MY_COCKPIT_VARIABLE_TO_IDP": {
"Type":"HTTP",
"Authentication":"BasicAuthentication",
"Name":"MY_COCKPIT_VARIABLE_TO_IDP",
"URL": "https://<account_id>.accounts.ondemand.com/",
"User":"<user_name>",
"Password": "<pass>"
}
}
}
neo-app.json:
...other configs
{
"path": "/scim-users",
"target": {
"type": "destination",
"name": "MY_COCKPIT_VARIABLE_TO_IDP",
"entryPath": "/service/scim/Users"
},
"description": "SCIM USERS API"
}
list.controller.js:
sap.ui.define([
'sap/ui/core/mvc/Controller'
], function (MessageToast, Controller) {
return Controller.extend('controller-path', {
onInit: function () {
const model = new sap.ui.model.json.JSONModel('/scim-users');
model.loadData();
}
});
});
With this configuration, I get a few errors and I will list them bellow:
Your middleware is assuming that it always will have a subpath after "/", but in this case it doesn't have
resourcePath = rResourcePattern.exec(reqUrl)[1]; // Assumes there is some path after provided route url
The middleware is not reading entry-path in neo-app.json
file. The expected behavior is the middleware to read entry-path and inject it into destinations.json url.
https://<account_id>.accounts.ondemand.com/service/scim/Users
ERR_TLS_CERT_ALTNAME_INVALID when trying to request to IDP url after fixing above mentioned bugs.
Hi @mlucascardoso ,
Apologies for delayed response. Have made some changes to the code to fix the issues you were facing. Please note, existing destinations file will not work. I have made changes to how the destinations file will be configured in ui5.yaml ! Give README.md a go!
Lets say i have a destinations.json file with this content:
In list.controller.js i have:
When this controller is loaded, i get this error:
Any ideas what I'm doing wrong?