Skip to content

Commit 0a53862

Browse files
committed
Merge remote-tracking branch 'origin/main' into odata-client-meta-content-id
# Conflicts: # datamodel/odata-client/src/main/java/com/sap/cloud/sdk/datamodel/odata/client/request/MultipartParser.java
2 parents 8c89c29 + 37be46d commit 0a53862

File tree

99 files changed

+1244
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1244
-243
lines changed

.github/workflows/reuse.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
- name: REUSE Compliance Check
17-
uses: fsfe/reuse-action@v2.0.0
17+
uses: fsfe/reuse-action@v3.0.0

.pipeline/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ stages:
2929
low: '0'
3030
pmd:
3131
high: '0'
32-
normal: '6'
33-
low: '2'
32+
normal: '1'
33+
low: '0'

.pipeline/scripts/release_notes_automation.py

+1-29
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,12 @@ def write_file(file_name, data):
3131
""",
3232
"""### 📈 Improvements
3333
34-
- Dependency Updates:
35-
- SAP dependency updates:
36-
- Update [thing](https://link-to-thing) from `a.b.c` to `x.z.y`
37-
- Other dependency updates:
38-
- Major version updates:
39-
- Update [thing](https://link-to-thing) from `a.b.c` to `x.z.y`
40-
- Minor version updates:
41-
- Update [thing](https://link-to-thing) from `a.b.c` to `x.z.y`
34+
-
4235
4336
""",
4437
"""### 🐛 Fixed Issues
4538
4639
-
47-
4840
"""]
4941

5042
def remove_unchanged_sections(file, unchanged_sections):
@@ -66,25 +58,6 @@ def link_github_release(file, version):
6658
return file
6759

6860

69-
def clean_up_dependency_updates(file):
70-
empty_dependency_update = "- Update \[thing\]\(https://link-to-thing\) from `a.b.c` to `x.z.y`\n"
71-
sap_dependency_update = " - SAP dependency updates:\n "+empty_dependency_update
72-
major_dependency_update = " - Major version updates:\n "+empty_dependency_update
73-
minor_dependency_update = " - Minor version updates:\n "+empty_dependency_update
74-
other_dependency_update = " - Other dependency updates:\n "+major_dependency_update+"\n"+minor_dependency_update
75-
76-
# Dependency Updates cannot be ALL empty since we already removed the entire empty section in remove_unchanged_sections()
77-
# First we remove the biggest strings, then the smaller ones
78-
79-
# 2 biggest strings
80-
file = re.sub(sap_dependency_update, "", file)
81-
file = re.sub(other_dependency_update, "", file)
82-
# smaller strings
83-
file = re.sub(major_dependency_update, "", file)
84-
file = re.sub(minor_dependency_update, "", file)
85-
# smallest leftovers
86-
file = re.sub(empty_dependency_update, "", file)
87-
return file
8861

8962
releases_pattern = re.compile(r"^## ")
9063
def count_releases(filename):
@@ -126,7 +99,6 @@ def write_release_notes(folder, target_file):
12699
file = remove_unchanged_sections(file, unchanged_sections)
127100
file = set_header(file, args.version)
128101
file = link_github_release(file, args.version)
129-
file = clean_up_dependency_updates(file)
130102

131103
target_file = find_target_file(args.version)
132104
write_release_notes(args.folder, target_file)

.pipeline/scripts/release_notes_template.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,8 @@
1616

1717
### 📈 Improvements
1818

19-
- Dependency Updates:
20-
- SAP dependency updates:
21-
- Update [thing](https://link-to-thing) from `a.b.c` to `x.z.y`
22-
- Other dependency updates:
23-
- Major version updates:
24-
- Update [thing](https://link-to-thing) from `a.b.c` to `x.z.y`
25-
- Minor version updates:
26-
- Update [thing](https://link-to-thing) from `a.b.c` to `x.z.y`
19+
-
2720

2821
### 🐛 Fixed Issues
2922

3023
-
31-

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
![build](https://github.com/SAP/cloud-sdk-java/actions/workflows/continuous-integration.yaml/badge.svg)
44
[![REUSE status](https://api.reuse.software/badge/github.com/SAP/cloud-sdk-java)](https://api.reuse.software/info/github.com/SAP/cloud-sdk-java)
55
[![Fosstars security rating](https://github.com/SAP/cloud-sdk-java/blob/fosstars-report/fosstars_badge.svg)](https://github.com/SAP/cloud-sdk-java/blob/fosstars-report/fosstars_report.md)
6-
[![Maven Central](https://img.shields.io/badge/maven_central-5.4.0-blue.svg)](https://search.maven.org/search?q=g:com.sap.cloud.sdk%20AND%20a:sdk-core%20AND%20v:5.4.0)
6+
[![Maven Central](https://img.shields.io/badge/maven_central-5.5.0-blue.svg)](https://search.maven.org/search?q=g:com.sap.cloud.sdk%20AND%20a:sdk-core%20AND%20v:5.5.0)
77

88
# SAP Cloud SDK for Java
99

archetypes/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sap.cloud.sdk</groupId>
66
<artifactId>sdk-parent</artifactId>
7-
<version>5.5.0-SNAPSHOT</version>
7+
<version>5.6.0-SNAPSHOT</version>
88
</parent>
99
<groupId>com.sap.cloud.sdk.archetypes</groupId>
1010
<artifactId>archetypes-parent</artifactId>

archetypes/spring-boot3/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sap.cloud.sdk.archetypes</groupId>
66
<artifactId>archetypes-parent</artifactId>
7-
<version>5.5.0-SNAPSHOT</version>
7+
<version>5.6.0-SNAPSHOT</version>
88
</parent>
99
<artifactId>spring-boot3</artifactId>
1010
<packaging>maven-archetype</packaging>

archetypes/spring-boot3/src/main/resources/archetype-resources/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<spring-boot.version>3.2.0</spring-boot.version>
1616

1717
<java.version>17</java.version>
18-
<cloud-sdk.version>5.5.0-SNAPSHOT</cloud-sdk.version>
18+
<cloud-sdk.version>5.6.0-SNAPSHOT</cloud-sdk.version>
1919

2020
<maven.compiler.source>${java.version}</maven.compiler.source>
2121
<maven.compiler.target>${java.version}</maven.compiler.target>

cloudplatform/caching/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
66
<artifactId>cloudplatform-parent</artifactId>
7-
<version>5.5.0-SNAPSHOT</version>
7+
<version>5.6.0-SNAPSHOT</version>
88
</parent>
99
<artifactId>caching</artifactId>
1010
<name>Business Technology Platform - Caching</name>

cloudplatform/cloudplatform-connectivity-scp-cf/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
66
<artifactId>cloudplatform-parent</artifactId>
7-
<version>5.5.0-SNAPSHOT</version>
7+
<version>5.6.0-SNAPSHOT</version>
88
</parent>
99
<artifactId>cloudplatform-connectivity-scp-cf</artifactId>
1010
<name>(Deprecated) Cloud Platform - Connectivity SAP BTP Cloud Foundry</name>

cloudplatform/cloudplatform-connectivity/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
66
<artifactId>cloudplatform-parent</artifactId>
7-
<version>5.5.0-SNAPSHOT</version>
7+
<version>5.6.0-SNAPSHOT</version>
88
</parent>
99
<artifactId>cloudplatform-connectivity</artifactId>
1010
<name>Business Technology Platform - Connectivity</name>

cloudplatform/cloudplatform-connectivity/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity/BtpServiceOptions.java

+28-22
Original file line numberDiff line numberDiff line change
@@ -142,29 +142,21 @@ public static OptionsEnhancer<?> withTargetUri( @Nonnull final URI targetUri )
142142
}
143143

144144
/**
145-
* Creates an {@link OptionsEnhancer} that instructs the destination to use mTLS authentication only.
146-
* <p>
147-
* In the regular OAuth2 case, setting this option will skip the IAS token flow.
148-
* <p>
149-
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withApplicationName(String)} and
150-
* {@link #withConsumerClient(String, String)}.
151-
* <p>
152-
* <b>Caution:</b> This option cannot be combined with {@link OnBehalfOf#NAMED_USER_CURRENT_TENANT}.
145+
* Creates an instance of {@link NoTokenForTechnicalProviderUser}.
153146
*
154-
* @return An instance of {@link OptionsEnhancer} that will lead to mTLS authentication only.
147+
* @return A new {@link NoTokenForTechnicalProviderUser} instance.
155148
*/
156149
@Nonnull
157-
public static OptionsEnhancer<?> withMTLSAuthenticationOnly()
150+
public static OptionsEnhancer<?> withoutTokenForTechnicalProviderUser()
158151
{
159-
return new IasCommunicationOptions(null, null, null, true);
152+
return new NoTokenForTechnicalProviderUser(true);
160153
}
161154

162155
/**
163156
* Creates an {@link OptionsEnhancer} that instructs an IAS-based destination to use the given application
164157
* provider name when performing token retrievals. This is needed in <b>App-To-App</b> communication scenarios.
165158
* <p>
166-
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withMTLSAuthenticationOnly()} and
167-
* {@link #withConsumerClient(String, String)}.
159+
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withConsumerClient(String, String)}.
168160
*
169161
* @param applicationName
170162
* The name of the application provider to be used. This is the name that was used to register the
@@ -175,15 +167,14 @@ public static OptionsEnhancer<?> withMTLSAuthenticationOnly()
175167
@Nonnull
176168
public static OptionsEnhancer<?> withApplicationName( @Nonnull final String applicationName )
177169
{
178-
return new IasCommunicationOptions(applicationName, null, null, false);
170+
return new IasCommunicationOptions(applicationName, null, null);
179171
}
180172

181173
/**
182174
* Creates an {@link OptionsEnhancer} that instructs an IAS-based destination to use the given consumer client
183175
* ID when performing token retrievals. This is needed in <i>Service-To-App</i> communication scenarios.
184176
* <p>
185-
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withMTLSAuthenticationOnly()} and
186-
* {@link #withApplicationName(String)}.
177+
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withApplicationName(String)}.
187178
*
188179
* @param consumerClientId
189180
* The client ID of the consumer application. This client ID is usually extracted from an incoming
@@ -194,16 +185,15 @@ public static OptionsEnhancer<?> withApplicationName( @Nonnull final String appl
194185
@Nonnull
195186
public static OptionsEnhancer<?> withConsumerClient( @Nonnull final String consumerClientId )
196187
{
197-
return new IasCommunicationOptions(null, consumerClientId, null, false);
188+
return new IasCommunicationOptions(null, consumerClientId, null);
198189
}
199190

200191
/**
201192
* Creates an {@link OptionsEnhancer} that instructs an IAS-based destination to use the given consumer client
202193
* and tenant ID when performing token retrievals. This is needed in <i>Service-To-App</i> communication
203194
* scenarios.
204195
* <p>
205-
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withMTLSAuthenticationOnly()} and
206-
* {@link #withApplicationName(String)}.
196+
* <b>Hint:</b> This option is <b>mutually exclusive</b> with {@link #withApplicationName(String)}.
207197
*
208198
* @param consumerClientId
209199
* The client ID of the consumer application. This client ID is usually extracted from an incoming
@@ -219,7 +209,7 @@ public static OptionsEnhancer<?> withConsumerClient( @Nonnull final String consu
219209
OptionsEnhancer<?>
220210
withConsumerClient( @Nonnull final String consumerClientId, @Nonnull final String consumerTenantId )
221211
{
222-
return new IasCommunicationOptions(null, consumerClientId, consumerTenantId, false);
212+
return new IasCommunicationOptions(null, consumerClientId, consumerTenantId);
223213
}
224214

225215
/**
@@ -233,9 +223,26 @@ public static class IasTargetUri implements OptionsEnhancer<URI>
233223
URI value;
234224
}
235225

226+
/**
227+
* An {@link OptionsEnhancer} that indicates whether <b>no</b> token is required for authenticating at the
228+
* target system <b>iff</b> the authentication happens on behalf of a <b>technical provider user</b>. In this
229+
* case, retrieving a token from the IAS service is optional and, therefore, can be skipped. Instead,
230+
* authentication is done via mTLS only. In every other case (i.e. <i>named user</i> for either the provider or
231+
* a subscriber, or <i>technical user</i> on behalf of a subscriber), a token is always required to not lose any
232+
* tenancy information at the target system.
233+
*
234+
* @since 5.6.0
235+
*/
236+
@Value
237+
@AllArgsConstructor( access = AccessLevel.PRIVATE )
238+
public static class NoTokenForTechnicalProviderUser implements OptionsEnhancer<Boolean>
239+
{
240+
Boolean value;
241+
}
242+
236243
/**
237244
* An {@link OptionsEnhancer} that contains the communication options for an IAS-based destination. Also refer
238-
* to {@link #withMTLSAuthenticationOnly()}, {@link #withApplicationName(String)}, and
245+
* to {@link #withoutTokenForTechnicalProviderUser()}, {@link #withApplicationName(String)}, and
239246
* {@link #withConsumerClient(String, String)}.
240247
*/
241248
@Value
@@ -248,7 +255,6 @@ public static class IasCommunicationOptions implements OptionsEnhancer<IasCommun
248255
String consumerClientId;
249256
@Nullable
250257
String consumerTenantId;
251-
boolean mTLSAuthenticationOnly;
252258

253259
@Nonnull
254260
@Override

cloudplatform/cloudplatform-connectivity/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity/DefaultHttpDestination.java

+37-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
package com.sap.cloud.sdk.cloudplatform.connectivity;
66

7+
import static com.sap.cloud.sdk.cloudplatform.connectivity.DestinationKeyStoreComparator.resolveCertificatesOnly;
8+
import static com.sap.cloud.sdk.cloudplatform.connectivity.DestinationKeyStoreComparator.resolveKeyStoreHashCode;
9+
710
import java.net.URI;
811
import java.security.KeyStore;
912
import java.util.ArrayList;
@@ -20,6 +23,9 @@
2023
import javax.annotation.Nullable;
2124
import javax.net.ssl.SSLContext;
2225

26+
import org.apache.commons.lang3.builder.EqualsBuilder;
27+
import org.apache.commons.lang3.builder.HashCodeBuilder;
28+
2329
import com.google.common.collect.ImmutableList;
2430
import com.google.common.collect.Lists;
2531
import com.google.common.net.HttpHeaders;
@@ -36,36 +42,30 @@
3642
import io.vavr.control.Option;
3743
import io.vavr.control.Try;
3844
import lombok.AccessLevel;
39-
import lombok.EqualsAndHashCode;
4045
import lombok.Getter;
4146
import lombok.experimental.Delegate;
4247
import lombok.extern.slf4j.Slf4j;
4348

4449
/**
4550
* Immutable default implementation of the {@link HttpDestination} interface.
4651
*/
47-
@EqualsAndHashCode
4852
@Slf4j
4953
public final class DefaultHttpDestination implements HttpDestination
5054
{
5155
@Delegate
5256
private final DestinationProperties baseProperties;
5357

54-
@EqualsAndHashCode.Exclude
5558
private final KeyStore keyStore;
56-
@EqualsAndHashCode.Exclude
5759
private final KeyStore trustStore;
5860

5961
@Nonnull
6062
final ImmutableList<Header> customHeaders;
6163

6264
@Nonnull
6365
@Getter( AccessLevel.PACKAGE )
64-
@EqualsAndHashCode.Exclude
6566
private final ImmutableList<DestinationHeaderProvider> customHeaderProviders;
6667

6768
@Nonnull
68-
@EqualsAndHashCode.Exclude
6969
private final ImmutableList<DestinationHeaderProvider> headerProvidersFromClassLoading;
7070

7171
// the following 'cached' fields are ALWAYS derived from the baseProperties and stored in the corresponding fields
@@ -77,27 +77,21 @@ public final class DefaultHttpDestination implements HttpDestination
7777
// furthermore, it is safe to exclude these fields from the equals and hashCode methods because their values are
7878
// purely derived from the baseProperties, which are included in the equals and hashCode methods.
7979
@Nonnull
80-
@EqualsAndHashCode.Exclude
8180
private final Option<ProxyConfiguration> cachedProxyConfiguration;
8281

8382
@Nonnull
84-
@EqualsAndHashCode.Exclude
8583
private final Option<ProxyType> cachedProxyType;
8684

8785
@Nonnull
88-
@EqualsAndHashCode.Exclude
8986
private final Option<BasicCredentials> cachedBasicCredentials;
9087

9188
@Nonnull
92-
@EqualsAndHashCode.Exclude
9389
private final AuthenticationType cachedAuthenticationType;
9490

9591
@Nonnull
96-
@EqualsAndHashCode.Exclude
9792
private final ImmutableList<Header> cachedHeadersFromProperties;
9893

9994
@Nonnull
100-
@EqualsAndHashCode.Exclude
10195
private final ImmutableList<Header> cachedProxyAuthorizationHeaders;
10296

10397
private DefaultHttpDestination(
@@ -511,6 +505,37 @@ public static Builder fromDestination( @Nonnull final Destination destination )
511505
return builder;
512506
}
513507

508+
@Override
509+
public boolean equals( @Nullable final Object o )
510+
{
511+
if( this == o ) {
512+
return true;
513+
}
514+
515+
if( o == null || getClass() != o.getClass() ) {
516+
return false;
517+
}
518+
519+
final DefaultHttpDestination that = (DefaultHttpDestination) o;
520+
return new EqualsBuilder()
521+
.append(baseProperties, that.baseProperties)
522+
.append(customHeaders, that.customHeaders)
523+
.append(resolveCertificatesOnly(keyStore), resolveCertificatesOnly(that.keyStore))
524+
.append(resolveCertificatesOnly(trustStore), resolveCertificatesOnly(that.trustStore))
525+
.isEquals();
526+
}
527+
528+
@Override
529+
public int hashCode()
530+
{
531+
return new HashCodeBuilder(17, 37)
532+
.append(baseProperties)
533+
.append(customHeaders)
534+
.append(resolveKeyStoreHashCode(keyStore))
535+
.append(resolveKeyStoreHashCode(trustStore))
536+
.toHashCode();
537+
}
538+
514539
/**
515540
* Builder class to allow for easy creation of an immutable {@code DefaultHttpDestination} instance.
516541
*/

0 commit comments

Comments
 (0)