Skip to content

Commit 73f26ad

Browse files
authored
Merge branch 'master' into fix-issue202370-queda-vacio-diccionario-evento
2 parents b672410 + b0d935f commit 73f26ad

File tree

48 files changed

+2453
-394
lines changed

Some content is hidden

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

48 files changed

+2453
-394
lines changed

android/src/main/java/com/genexus/specific/android/HttpClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ public void prepareSSLSocket(SSLSocket socket) {
8888
// enable TLSv1.1/1.2 if available
8989
// (see https://github.com/rfc2822/davdroid/issues/229)
9090
String[] supportedProtocols = socket.getSupportedProtocols();
91+
9192
ArrayList<String> tempList = new ArrayList<String>();
9293
Collections.addAll(tempList, supportedProtocols);
93-
// remove only olds and unsecure protocols (SSLv3 ), TLS in all version are supported.
94+
// remove only olds and unsecure protocols (SSLv3 ), TLS 1.2 and up are supported.
9495
tempList.remove("SSLv3");
9596
// from : https://blog.dev-area.net/2015/08/13/android-4-1-enable-tls-1-1-and-tls-1-2/
96-
// add 1.1 and 1.2 if not yet added, at least in Android 4.x
97-
if (!tempList.contains("TLSv1.1"))
98-
tempList.add("TLSv1.1");
97+
// Tls 1.1 is not supoerted anymore in Android 16 or up. Exception java.lang.IllegalArgumentException: protocol TLSv1.1 is not supported if added
98+
// add 1.2 if not yet added, at least in Android 4.x
9999
if (!tempList.contains("TLSv1.2"))
100100
tempList.add("TLSv1.2");
101101

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<dependency>
3434
<groupId>org.apache.commons</groupId>
3535
<artifactId>commons-lang3</artifactId>
36-
<version>3.18.0</version>
36+
<version>${commons.lang3.version}</version>
3737
</dependency>
3838
<dependency>
3939
<groupId>commons-io</groupId>

common/src/main/java/com/genexus/internet/MsgList.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public void removeAllItems()
9898
removeAllElements();
9999
}
100100

101+
public boolean hasAny(String msgId)
102+
{
103+
return this.stream().anyMatch(item -> msgId.equals(item.getId()));
104+
}
105+
101106
private short displayMode = 1;
102107

103108
public void setDisplaymode(short displayMode)

common/src/main/java/com/genexus/opentelemetry/OpenTelemetryHelper.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,31 @@
22

33
import io.opentelemetry.api.trace.Span;
44

5+
/**
6+
* Helper class for OpenTelemetry operations.
7+
* Provides utility methods for working with OpenTelemetry.
8+
*/
59
public class OpenTelemetryHelper {
610

11+
/**
12+
* Records an exception on the specified span
13+
*
14+
* @param span the span to record the exception on
15+
* @param exc the exception to record
16+
*/
717
public static void recordException(Span span, Throwable exc) {
818
if (span != null && exc != null) {
919
span.recordException(exc);
1020
}
1121
}
1222

23+
/**
24+
* Records an exception on the current active span
25+
*
26+
* @param exc the exception to record
27+
* @throws NullPointerException if exc is null
28+
*/
1329
public static void recordException(Throwable exc) {
1430
recordException(Span.current(), exc);
1531
}
16-
}
32+
}

gxawsserverless/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<dependency>
5353
<groupId>software.amazon.awssdk</groupId>
5454
<artifactId>lambda</artifactId>
55-
<version>2.21.28</version>
55+
<version>${software.awssdk.version}</version>
5656
</dependency>
5757

5858
<dependency>

gxazureserverless/pom.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
<version>3.1.0</version>
2828
</dependency>
2929

30-
<dependency>
31-
<groupId>com.microsoft.azure</groupId>
32-
<artifactId>azure-functions-maven-plugin</artifactId>
33-
<version>1.35.0</version>
34-
</dependency>
35-
3630
<dependency>
3731
<groupId>io.cloudevents</groupId>
3832
<artifactId>cloudevents-api</artifactId>
@@ -54,13 +48,14 @@
5448
<dependency>
5549
<groupId>com.azure</groupId>
5650
<artifactId>azure-messaging-eventgrid</artifactId>
57-
<version>4.22.3</version>
51+
<version>4.31.4</version>
5852
</dependency>
5953

6054
<dependency>
6155
<groupId>org.mockito</groupId>
6256
<artifactId>mockito-core</artifactId>
6357
<version>5.12.0</version>
58+
<scope>test</scope>
6459
</dependency>
6560

6661
<dependency>

gxazureserverless/src/main/java/com/genexus/cloud/serverless/helpers/ServiceBusBatchMessageProcessor.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.genexus.cloud.serverless.model.EventMessage;
66
import com.genexus.cloud.serverless.model.EventMessages;
77
import com.microsoft.azure.functions.ExecutionContext;
8-
import com.sun.jna.platform.win32.Guid;
98

109
import java.time.Instant;
1110
import java.util.Date;

gxcache-memcached/src/main/java/com/genexus/cache/memcached/Memcached.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ public void clear(String cacheid, String key) {
121121
}
122122

123123
public void clearCache(String cacheid) {
124-
_cache.incr(cacheid, 1);
124+
Long newPrefix = CommonUtil.now(false, false).getTime();
125+
set(cacheid, newPrefix);
125126
}
126127

127128
public void clearKey(String key) {

gxcloudstorage-awss3-v1/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<dependency>
2929
<groupId>com.amazonaws</groupId>
3030
<artifactId>aws-java-sdk-s3</artifactId>
31-
<version>1.12.587</version>
31+
<version>1.12.792</version>
3232
</dependency>
3333
</dependencies>
3434
</project>

gxcloudstorage-awss3-v2/src/main/java/com/genexus/db/driver/ExternalProviderS3V2.java

Lines changed: 62 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private void initialize() throws Exception {
119119
this.folder = folder;
120120

121121
this.client = buildS3Client(accessKey, secretKey, endpointValue, clientRegion);
122-
this.presigner = buildS3Presigner(accessKey, secretKey, clientRegion);
122+
this.presigner = buildS3Presigner(accessKey, secretKey, endpointValue, clientRegion);
123123
bucketExists();
124124
}
125125
}
@@ -178,7 +178,7 @@ private S3Client buildS3Client(String accessKey, String secretKey, String endpoi
178178
return s3Client;
179179
}
180180

181-
private S3Presigner buildS3Presigner(String accessKey, String secretKey, String region) {
181+
private S3Presigner buildS3Presigner(String accessKey, String secretKey, String endpoint, String region) {
182182
boolean bUseIAM = !getPropertyValue(USE_IAM, "", "").isEmpty() || (accessKey.equals("") && secretKey.equals(""));
183183

184184
S3Presigner.Builder builder = S3Presigner.builder()
@@ -193,6 +193,10 @@ private S3Presigner buildS3Presigner(String accessKey, String secretKey, String
193193
logger.debug("Using IAM Credentials for presigner");
194194
}
195195

196+
if (!endpoint.isEmpty() && !endpoint.contains(".amazonaws.com")) {
197+
builder.endpointOverride(URI.create(endpoint));
198+
}
199+
196200
return builder.build();
197201
}
198202

@@ -568,15 +572,27 @@ else if (url.startsWith(this.getStorageUriWithoutRegion()))
568572
}
569573

570574
private String getStorageUri() {
571-
return (!pathStyleUrls) ?
572-
"https://" + bucket + ".s3." + clientRegion + ".amazonaws.com/" :
573-
".s3." + clientRegion + ".amazonaws.com//" + bucket + "/";
575+
if (!pathStyleUrls) {
576+
if (endpointUrl.contains(".amazonaws.com")) {
577+
return "https://" + bucket + ".s3." + clientRegion + ".amazonaws.com/";
578+
} else {
579+
return endpointUrl + "/" + bucket + "/";
580+
}
581+
} else {
582+
return endpointUrl + "/" + bucket + "/";
583+
}
574584
}
575585

576586
private String getStorageUriWithoutRegion() {
577-
return (!pathStyleUrls) ?
578-
"https://" + bucket + ".s3.amazonaws.com/" :
579-
".s3.amazonaws.com//" + bucket + "/";
587+
if (!pathStyleUrls) {
588+
if (endpointUrl.contains(".amazonaws.com")) {
589+
return "https://" + bucket + ".s3.amazonaws.com/";
590+
} else {
591+
return endpointUrl + "/" + bucket + "/";
592+
}
593+
} else {
594+
return endpointUrl + "/" + bucket + "/";
595+
}
580596
}
581597

582598
// With ACL implementation
@@ -650,19 +666,27 @@ private String getResourceUrlWithACL(String externalFileName, ResourceAccessCont
650666
} else {
651667
try {
652668
int lastIndex = Math.max(externalFileName.lastIndexOf('/'), externalFileName.lastIndexOf('\\'));
653-
String path = externalFileName.substring(0, lastIndex + 1);
654-
String fileName = externalFileName.substring(lastIndex + 1);
669+
String path = lastIndex >= 0 ? externalFileName.substring(0, lastIndex + 1) : "";
670+
String fileName = lastIndex >= 0 ? externalFileName.substring(lastIndex + 1) : externalFileName;
655671
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.toString());
656672

657-
String url = String.format(
658-
"https://%s.s3.%s.amazonaws.com/%s%s",
659-
bucket,
660-
clientRegion,
661-
path,
662-
encodedFileName
663-
);
664-
665-
return url;
673+
if (endpointUrl.contains(".amazonaws.com")) {
674+
return String.format(
675+
"https://%s.s3.%s.amazonaws.com/%s%s",
676+
bucket,
677+
clientRegion,
678+
path,
679+
encodedFileName
680+
);
681+
} else {
682+
return String.format(
683+
"%s/%s/%s%s",
684+
endpointUrl,
685+
bucket,
686+
path,
687+
encodedFileName
688+
);
689+
}
666690
} catch (UnsupportedEncodingException uee) {
667691
logger.error("Failed to encode resource URL for " + externalFileName, uee);
668692
return "";
@@ -771,19 +795,27 @@ private String getResourceUrlWithoutACL(String externalFileName, int expirationM
771795
} else if (ownerEnforcedBucketPrivacy == BucketPrivacy.PUBLIC){
772796
try {
773797
int lastIndex = Math.max(externalFileName.lastIndexOf('/'), externalFileName.lastIndexOf('\\'));
774-
String path = externalFileName.substring(0, lastIndex + 1);
775-
String fileName = externalFileName.substring(lastIndex + 1);
798+
String path = lastIndex >= 0 ? externalFileName.substring(0, lastIndex + 1) : "";
799+
String fileName = lastIndex >= 0 ? externalFileName.substring(lastIndex + 1) : externalFileName;
776800
String encodedFileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.toString());
777801

778-
String url = String.format(
779-
"https://%s.s3.%s.amazonaws.com/%s%s",
780-
bucket,
781-
clientRegion,
782-
path,
783-
encodedFileName
784-
);
785-
786-
return url;
802+
if (endpointUrl.contains(".amazonaws.com")) {
803+
return String.format(
804+
"https://%s.s3.%s.amazonaws.com/%s%s",
805+
bucket,
806+
clientRegion,
807+
path,
808+
encodedFileName
809+
);
810+
} else {
811+
return String.format(
812+
"%s/%s/%s%s",
813+
endpointUrl,
814+
bucket,
815+
path,
816+
encodedFileName
817+
);
818+
}
787819
} catch (UnsupportedEncodingException uee) {
788820
logger.error("Failed to encode resource URL for {}", externalFileName, uee);
789821
return "";

0 commit comments

Comments
 (0)