SAP-BTP-Spielwiese/app1/node_modules/@sap/xsenv/migration.md
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

1.2 KiB

Migration Guide

Version 2 ==> Version 3

Changes to application code

Nested objects in credentials (K8S case only)

The following service credentials:

/etc/
  /secrets/
    /sapcp/
      /some-service/
        /some-instance/
          /url   - containing https://some-service
          /uaa   - containing { "url": "https://uaa", "clientid": "client", "clientsecret": "secret" }
          /other - containing [1, "two"]

had been provided to applications in v2 of @sap/xsenv as:

{
  url: 'https://some-service',
  uaa: '{ "url": "https://uaa", "clientid": "client", "clientsecret": "secret" }',
  other: '[1, "two"]'
}

The uaa property requires parsing (with JSON.parse) in order to use its properties individually.

With v3 of @sap/xsenv nested JSON objects are parsed automatically and are provided to applications as:

{
  url: 'https://some-service',
  uaa:  {
    url: 'https://uaa',
    clientid: 'client',
    clientsecret: 'secret'
  },
  other: '[1, "two"]'

Invocation to JSON.parse should be removed from application code.

Note: property values representing arrays are currently not automatically parsed.