Skip to content

Commit f7943c2

Browse files
update dependency versions from MEND - LMCROSSITXSADEPLOY-3204 (#1632)
* update dependency versions from MEND - LMCROSSITXSADEPLOY-3204
1 parent bf397ac commit f7943c2

File tree

3 files changed

+58
-41
lines changed

3 files changed

+58
-41
lines changed

multiapps-controller-web/src/main/java/org/cloudfoundry/multiapps/controller/web/Messages.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public final class Messages {
2525
public static final String MISSING_PROPERTIES_FOR_CREATING_THE_SPECIFIC_PROVIDER = "Missing properties for creating the specific provider!";
2626
public static final String DEPLOY_FROM_URL_WRONG_CREDENTIALS = "Credentials to {0} are wrong. Make sure that they are correct.";
2727

28+
public static final String FAILED_TO_CREATE_BLOB_STORE_CONTEXT = "Failed to create BlobStoreContext";
29+
2830
// Audit log messages
2931
public static final String USER_TRYING_TO_LOGIN_AUDIT_LOG_MESSAGE = "\"{0}\" is trying to login in space \"{1}\"";
3032
public static final String USER_SUCCESSFULLY_LOGGED_IN_AUDIT_LOG_MESSAGE = "\"{0}\" successfully logged in space \"{1}\"";

multiapps-controller-web/src/main/java/org/cloudfoundry/multiapps/controller/web/configuration/bean/factory/ObjectStoreFileStorageFactoryBean.java

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package org.cloudfoundry.multiapps.controller.web.configuration.bean.factory;
22

3+
import java.text.MessageFormat;
4+
import java.util.Collections;
5+
import java.util.HashMap;
6+
import java.util.List;
7+
import java.util.Map;
8+
39
import io.pivotal.cfenv.core.CfService;
410
import org.apache.commons.lang3.StringUtils;
511
import org.cloudfoundry.multiapps.controller.core.util.UriUtil;
@@ -15,12 +21,6 @@
1521
import org.springframework.beans.factory.FactoryBean;
1622
import org.springframework.beans.factory.InitializingBean;
1723

18-
import java.text.MessageFormat;
19-
import java.util.Collections;
20-
import java.util.HashMap;
21-
import java.util.List;
22-
import java.util.Map;
23-
2424
public class ObjectStoreFileStorageFactoryBean implements FactoryBean<ObjectStoreFileStorage>, InitializingBean {
2525

2626
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectStoreFileStorageFactoryBean.class);
@@ -44,26 +44,25 @@ private ObjectStoreFileStorage createObjectStoreFileStorage() {
4444
if (providersServiceInfo.isEmpty()) {
4545
return null;
4646
}
47+
4748
Map<String, Exception> exceptions = new HashMap<>();
49+
4850
for (ObjectStoreServiceInfo objectStoreServiceInfo : providersServiceInfo) {
49-
BlobStoreContext context = getBlobStoreContext(objectStoreServiceInfo);
50-
if (context == null) {
51-
exceptions.put(objectStoreServiceInfo.getProvider(),
52-
new IllegalArgumentException(Messages.MISSING_PROPERTIES_FOR_CREATING_THE_SPECIFIC_PROVIDER));
53-
continue;
54-
}
55-
ObjectStoreFileStorage fileStorage = createFileStorage(objectStoreServiceInfo, context);
5651
try {
52+
BlobStoreContext context = getBlobStoreContext(objectStoreServiceInfo);
53+
ObjectStoreFileStorage fileStorage = createFileStorage(objectStoreServiceInfo, context);
5754
fileStorage.testConnection();
5855
LOGGER.info(MessageFormat.format(Messages.OBJECT_STORE_WITH_PROVIDER_0_CREATED, objectStoreServiceInfo.getProvider()));
5956
return fileStorage;
6057
} catch (Exception e) {
6158
exceptions.put(objectStoreServiceInfo.getProvider(), e);
6259
}
6360
}
61+
6462
exceptions.forEach(
65-
(provider, exception) -> LOGGER.error(MessageFormat.format(Messages.CANNOT_CREATE_OBJECT_STORE_CLIENT_WITH_PROVIDER_0, provider),
66-
exception));
63+
(provider, exception) -> LOGGER.error(
64+
MessageFormat.format(Messages.CANNOT_CREATE_OBJECT_STORE_CLIENT_WITH_PROVIDER_0, provider),
65+
exception));
6766
throw new IllegalStateException(Messages.NO_VALID_OBJECT_STORE_CONFIGURATION_FOUND);
6867
}
6968

@@ -77,15 +76,31 @@ private List<ObjectStoreServiceInfo> getProvidersServiceInfo() {
7776

7877
private BlobStoreContext getBlobStoreContext(ObjectStoreServiceInfo serviceInfo) {
7978
ContextBuilder contextBuilder = ContextBuilder.newBuilder(serviceInfo.getProvider());
79+
applyCredentials(serviceInfo, contextBuilder);
80+
81+
resolveContextEndpoint(serviceInfo, contextBuilder);
82+
83+
BlobStoreContext context = contextBuilder.buildView(BlobStoreContext.class);
84+
if (context == null) {
85+
throw new IllegalStateException(Messages.FAILED_TO_CREATE_BLOB_STORE_CONTEXT);
86+
}
87+
88+
return context;
89+
}
90+
91+
private void applyCredentials(ObjectStoreServiceInfo serviceInfo, ContextBuilder contextBuilder) {
8092
if (serviceInfo.getCredentialsSupplier() != null) {
8193
contextBuilder.credentialsSupplier(serviceInfo.getCredentialsSupplier());
82-
} else if (serviceInfo.getIdentity() != null && serviceInfo.getCredential() != null) {
83-
contextBuilder.credentials(serviceInfo.getIdentity(), serviceInfo.getCredential());
8494
} else {
85-
return null;
95+
String identity = serviceInfo.getIdentity();
96+
String credential = serviceInfo.getCredential();
97+
98+
if (StringUtils.isBlank(identity) || StringUtils.isBlank(credential)) {
99+
throw new IllegalArgumentException(Messages.MISSING_PROPERTIES_FOR_CREATING_THE_SPECIFIC_PROVIDER);
100+
}
101+
102+
contextBuilder.credentials(identity, credential);
86103
}
87-
resolveContextEndpoint(serviceInfo, contextBuilder);
88-
return contextBuilder.buildView(BlobStoreContext.class);
89104
}
90105

91106
private void resolveContextEndpoint(ObjectStoreServiceInfo serviceInfo, ContextBuilder contextBuilder) {

pom.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,49 @@
1515
<sonar.organization>cloudfoundry</sonar.organization>
1616
<sonar.coverage.jacoco.xmlReportPaths>../multiapps-controller-coverage/target/site/jacoco-aggregate/jacoco.xml
1717
</sonar.coverage.jacoco.xmlReportPaths>
18-
<junit.version>5.12.1</junit.version>
18+
<junit.version>5.12.2</junit.version>
1919
<junit-platform.version>1.12.1</junit-platform.version>
20-
<mockito.version>5.14.2</mockito.version>
20+
<mockito.version>5.17.0</mockito.version>
2121
<derby.version>10.16.1.1</derby.version>
2222
<h2.version>2.2.224</h2.version>
2323
<servlet-api.version>6.1.0</servlet-api.version>
2424
<log4j.version>2.24.3</log4j.version>
2525
<slf4j.version>2.0.17</slf4j.version>
26-
<commons-io.version>2.18.0</commons-io.version>
27-
<commons-collections4.version>4.4</commons-collections4.version>
28-
<snakeyaml.version>2.3</snakeyaml.version>
26+
<commons-io.version>2.19.0</commons-io.version>
27+
<commons-collections4.version>4.5.0</commons-collections4.version>
28+
<snakeyaml.version>2.4</snakeyaml.version>
2929
<httpclient.version>4.5.14</httpclient.version>
3030
<httpcore.version>4.4.16</httpcore.version>
3131
<eclipselink.version>3.0.4
3232
</eclipselink.version> <!-- Be careful when updating eclipselink versions. As of version 4.0.4, there have been reported regressions connected to exhausted Hikari DB pools -->
3333
<flowable.version>6.8.0</flowable.version>
3434
<mybatis.version>3.5.19</mybatis.version>
35-
<spring.version>6.2.4</spring.version>
36-
<spring-security.version>6.4.5</spring-security.version>
35+
<spring.version>6.2.7</spring.version>
36+
<spring-security.version>6.5.0</spring-security.version>
3737
<json-smart.version>2.5.2</json-smart.version>
38-
<hikari.version>6.2.1</hikari.version>
39-
<jackson.version>2.18.3</jackson.version>
40-
<jackson.databind.version>2.18.3</jackson.databind.version>
41-
<liquibase.version>4.29.1</liquibase.version>
42-
<liquibase-slf4j.version>5.0.0</liquibase-slf4j.version>
43-
<cloudfoundry-client.version>2.55.0</cloudfoundry-client.version>
44-
<swagger.version>1.6.14</swagger.version>
45-
<jclouds.version>2.6.0</jclouds.version>
38+
<hikari.version>6.3.0</hikari.version>
39+
<jackson.version>2.19.0</jackson.version>
40+
<jackson.databind.version>2.19.0</jackson.databind.version>
41+
<liquibase.version>4.31.1</liquibase.version>
42+
<liquibase-slf4j.version>5.1.0</liquibase-slf4j.version>
43+
<cloudfoundry-client.version>2.56.0</cloudfoundry-client.version>
44+
<swagger.version>1.6.15</swagger.version>
45+
<jclouds.version>2.7.0</jclouds.version>
4646
<guava.version>33.4.6-jre</guava.version>
47-
<resilience4j.version>2.2.0</resilience4j.version>
47+
<resilience4j.version>2.3.0</resilience4j.version>
4848
<immutables.version>2.10.1</immutables.version>
49-
<micrometer.version>1.12.5</micrometer.version>
50-
<aliyun-sdk-oss.version>3.17.4</aliyun-sdk-oss.version>
49+
<micrometer.version>1.15.0</micrometer.version>
50+
<aliyun-sdk-oss.version>3.18.2</aliyun-sdk-oss.version>
5151
<auto-service.version>1.1.1</auto-service.version>
52-
<commons-codec.version>1.16.1</commons-codec.version>
52+
<commons-codec.version>1.18.0</commons-codec.version>
5353
<multiapps.version>2.32.0</multiapps.version>
54-
<java-cfenv.version>3.1.5</java-cfenv.version>
54+
<java-cfenv.version>3.4.0</java-cfenv.version>
5555
<jaxb-api.version>4.0.2</jaxb-api.version>
5656
<jaxb-core.version>4.0.5</jaxb-core.version>
5757
<jaxb-impl.version>4.0.5</jaxb-impl.version>
5858
<jakarta.inject-api.version>2.0.1</jakarta.inject-api.version>
5959
<jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version>
60-
<bouncycastle.version>1.78</bouncycastle.version>
60+
<bouncycastle.version>1.80</bouncycastle.version>
6161
<apache.compress.version>1.27.1</apache.compress.version>
6262
<tika-core.version>3.1.0</tika-core.version>
6363
</properties>

0 commit comments

Comments
 (0)