Skip to Content
Product Information
Author's profile photo Artem Kovalov

SAP Cloud SDK – June 2021 Release Highlights

Welcome to the overview of the SAP Cloud SDK releases from June.

Quick links

SAP Cloud SDK for Java 3.48.0

We Made Naming More Flexible in OData v2 & v4 Generators

To future prove OData generators we had to refactor our naming strategy used to generate Java classes, methods, fields, and alike. This update leads to a few breaking changes which are mostly internal and in most cases wouldn’t affect users of our generator maven plugin or CLI.

We changed the following interfaces and classes in an incompatible way:

  • The NamingStrategy interface has been redesigned entirely, leading to compilation errors if the existing implementation is used.
  • The DefaultNamingStrategy has been renamed to S4HanaNamingStrategy. We kept the latter as the default strategy to ensure better compatibility.
  • The DefaultNamingStrategy.NameSource enumeration has been moved to the package rather than being nested inside of a class.

Improved Token Exchange Performance for Destinations with Known Strategy

By default, the ScpCfDestinationLoader always performs an initial lookup request against the destination service to get the authentication type configured in the destination. This guarantees that we perform a user token exchange if it’s required to authenticate at the target system. On the flip side, this request will be redundant if we know beforehand the token exchange is required. Having to load such a destination often might lead to a significant performance toll.

By introducing ScpCfDestinationTokenExchangeStrategy we’re now able to skip the initial authentication type lookup request when loading a destination on BTP Cloud Foundry and do only the token exchange to boost performance. From the options below you can see that having just an authentication type lookup is also possible.

  • LOOKUP_THEN_EXCHANGE (default)
  • LOOKUP_ONLY
  • EXCHANGE_ONLY

Use this new strategy like this when building your destination

DestinationOptions options =
    DestinationOptions
        .builder()
        .augmentBuilder(
            ScpCfDestinationOptionsAugmenter
                .augmenter()
                .tokenExchangeStrategy(ScpCfDestinationTokenExchangeStrategy.EXCHANGE_ONLY))
        .build();

Try<Destination> destination = DestinationAccessor.getLoader().tryGetDestination("MyDestination", options);

There’s no such thing as a little performance boost in cloud development. We hope you’ll enjoy good use of this performance improvement when required.

Better Handling Of JWT Scopes With The SAP Cloud SDK

Our new API Principal#getAuthorizationsByAudience provides OAuth authorization scope of the principal grouped by the audience.

Let’s imagine we have the following three audiences with assigned scopes

[ "a.Display", "b.Change.Things", "c.Ignore" ]

We also have a JWT with the following audience claims

{aud: [a, b]}

If you use our existing Principal#getAuthorization API on an App legible only for the audience “a“, you’ll get just [Display] scope.

With our new API, you’ll receive a full map of JWT scopes. For the case above you’ll get the following map:

{a: [Display], b: [Change.Things]}

Such API provided more flexibility when validating the JWT in situations where there could exist feature toggles or other use-cases requiring multiple audiences to be matched with scopes.

How to update?

Navigate to a root folder of your project and find a pom.xml file. Bump the version of com.sap.cloud.sdk dependency to 3.48.0 similar to the XML code snippet below and you’re done! Mind, because Maven Central relying on CDN it takes a bit of time for the new maven module to be distributed.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.sap.cloud.sdk</groupId>
            <artifactId>sdk-bom</artifactId>
            <version>3.48.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
    <!-- possibly further managed dependencies ... -->
</dependencyManagement>

If for some reason your IDE hasn’t fetched an updated dependency version, run mvn clean install from the command line in the root directory of your project.

SAP Cloud SDK for JavaScript 1.46.0

Quick links

We used June to proved multiple fixes and improvements mentioned in our release notes.

How to update?

To update the version of the SAP Cloud SDK for JavaScript used in an existing project, use the command npm update in the root folder of your module. Note that this will also update other modules unless you explicitly specify which packages to update. If you want to check beforehand what will change, use npm outdated.

Additionally, you can consult NPM for more information on version history and update path.

Feedback

We hope you enjoy developing with SAP Cloud SDK! To help us further improve give your ideas and suggestions in the comments to this blog or create an issue in our GitHub repository.

All the best,

SAP Cloud SDK Team

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.