@sap-ux/backend-proxy-middleware 0.10.56 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,7 @@ It can be used either with the `ui5 serve` or the `fiori run` commands.
16
16
  | `destinationInstance` | `string` optional | If a destination needs to be read by a specific instance of a destination service then you need to provide the id of the service as optional property `destinationInstance`.|
17
17
  | `path` | `string` mandatory | Path that is to be proxied |
18
18
  | `pathReplace` | `string` optional | If provided then the path will be replaced with this value before forwarding |
19
+ | `connectPath` | `string` optional | Path used to fetch the correct credentials from the store when a full odata service url 'system' is used. |
19
20
  | `client` | `string` optional | sap-client parameter |
20
21
  | `scp` | `boolean` optional | If set to true the proxy will execute the required OAuth routine for the ABAP environment on SAP BTP |
21
22
  | `apiHub` | `boolean` optional | If set to true then the proxy will connect to the SAP API Business Hub |
@@ -364,10 +364,17 @@ async function updateProxyConfigFromStore(backend, logger, proxyOptions) {
364
364
  // check if system credentials are stored in the store
365
365
  try {
366
366
  const systemStore = await (0, store_1.getService)({ logger, entityName: 'system' });
367
- const system = (await systemStore.read(new store_1.BackendSystemKey({ url: localBackend.url, client: localBackend.client }))) ??
367
+ let backendUrl = localBackend.url;
368
+ if (localBackend.connectPath) {
369
+ const normalizedPath = localBackend.connectPath.startsWith('/')
370
+ ? localBackend.connectPath
371
+ : `/${localBackend.connectPath}`;
372
+ backendUrl = new URL(normalizedPath, localBackend.url).href;
373
+ }
374
+ const system = (await systemStore.read(new store_1.BackendSystemKey({ url: backendUrl, client: localBackend.client }))) ??
368
375
  {
369
376
  name: '<unknown>',
370
- url: localBackend.url,
377
+ url: backendUrl,
371
378
  authenticationType: validateAuthType(localBackend.authenticationType)
372
379
  };
373
380
  // Auth type is determined from app config as we may have multiple stored systems with the same url/client using different auth types
@@ -54,6 +54,11 @@ export interface LocalBackendConfig extends BaseBackendConfig {
54
54
  * Mandatory URL pointing to the backend system
55
55
  */
56
56
  url: string;
57
+ /**
58
+ * Path used to connect to a specific service in the backend system.
59
+ * This is required to fetch the correct credentials from the store when a full odata service url 'system' is used.
60
+ */
61
+ connectPath?: string;
57
62
  }
58
63
  export type BackendConfig = LocalBackendConfig | DestinationBackendConfig;
59
64
  export interface BackendMiddlewareConfig {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Abackend-proxy-middleware"
11
11
  },
12
- "version": "0.10.56",
12
+ "version": "0.11.1",
13
13
  "license": "Apache-2.0",
14
14
  "author": "@SAP/ux-tools-team",
15
15
  "main": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "i18next": "25.8.18",
32
32
  "prompts": "2.4.2",
33
33
  "proxy-from-env": "1.1.0",
34
- "@sap-ux/axios-extension": "1.25.24",
34
+ "@sap-ux/axios-extension": "1.25.25",
35
35
  "@sap-ux/btp-utils": "1.1.10",
36
36
  "@sap-ux/logger": "0.8.2",
37
37
  "@sap-ux/store": "1.5.10"