Skip to content

Commit

Permalink
Merge branch 'master' into openMetric
Browse files Browse the repository at this point in the history
  • Loading branch information
chanikag authored Nov 21, 2023
2 parents b1ffa69 + 404e1d1 commit f048f2b
Show file tree
Hide file tree
Showing 211 changed files with 3,103 additions and 627 deletions.
9 changes: 0 additions & 9 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/transaction-tests.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Please follow the steps below to build WSO2 Micro Integrator from the source cod
2. Run the maven command `mvn clean install` from the root directory of the repository.
3. The generated Micro Integrator distribution can be found at `micro-integrator/distribution/target/wso2mi-<version>.zip`.

Please note that the product can be build using only JDK 8 but the integration tests can be run in either JDK 8 or 11.
Please note that the product can be build using only JDK 11 but the integration tests can be run in either JDK 11 or 17.

#### Building the Docker image

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>business-adaptors</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion components/business-adaptors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>mi-component-parent</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>crypto-service</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>crypto-service</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion components/crypto-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<artifactId>mi-component-parent</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-services</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-services</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,8 @@ private MongoDB() {
public static final String CONNECT_TIMEOUT = "mongoDB_connectTimeout";
public static final String MAX_WAIT_TIME = "mongoDB_maxWaitTime";
public static final String SOCKET_TIMEOUT = "mongoDB_socketTimeout";
public static final String SSL_ENABLED = "mongoDB_ssl_enabled";
public static final String AUTH_SOURCE = "mongoDB_auth_source";
public static final String CONNECTIONS_PER_HOST = "mongoDB_connectionsPerHost";
public static final String THREADS_ALLOWED_TO_BLOCK_CONN_MULTIPLIER = "mongoDB_threadsAllowedToBlockForConnectionMultiplier";
public static final String RESULT_COLUMN_NAME = "Document";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-services</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.wso2.micro.integrator.dataservices.core;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -70,7 +71,7 @@ public class DataServiceFault extends Exception {
/**
* This map contains all the properties related to data services fault message
*/
private Map<String, Object> propertyMap = new HashMap<String, Object>();
private Map<String, Object> propertyMap = new LinkedHashMap<>();

public DataServiceFault(Throwable nestedException, String code, String dsFaultMessage) {
super(nestedException);
Expand Down Expand Up @@ -103,9 +104,11 @@ public static OMElement extractFaultMessage(Throwable throwable) {
keyElement.addChild(dataServiceKeyElement);
}
} else {
OMText valueElement = fac.createOMText(
keyElement, rootEntry.getValue().toString());
keyElement.addChild(valueElement);
if (rootEntry.getValue() != null) {
OMText valueElement = fac.createOMText(
keyElement, rootEntry.getValue().toString());
keyElement.addChild(valueElement);
}
}
root.addChild(keyElement);
}
Expand Down Expand Up @@ -173,40 +176,54 @@ public String getMessage() {
/**
* Returns a detailed description of the data service fault.
*/
public String getFullMessage() {
StringBuffer buff = new StringBuffer();
if (this.getDsFaultMessage() != null) {
buff.append("DS Fault Message: " + this.getDsFaultMessage() + "\n");
}
if (this.getCode() != null) {
buff.append("DS Code: " + this.getCode() + "\n");
getPropertyMap().put(DBConstants.FaultParams.DS_CODE, this.getCode());
}
if (this.getSourceDataService() != null) {
buff.append("Source Data Service:-\n");
buff.append(this.getSourceDataService().toString());
Map<String, String> sourcePropertyMap = new HashMap<String, String>();
sourcePropertyMap.put(DBConstants.FaultParams.DATA_SERVICE_NAME, this.getSourceDataService().getName());
public String getFullMessage() {
StringBuffer buff = new StringBuffer();
if (this.getDsFaultMessage() != null) {
buff.append("DS Fault Message: " + this.getDsFaultMessage() + "\n");
}
// if skipCurrentParams is not set to true, we don't have current params in WSDL
// so no need to add a null value
if (!("true".equalsIgnoreCase(DBUtils.getCurrentParamsDisabledProperty()))) {
if (this.getCurrentParams() != null) {
buff.append("Current Params: " + this.getCurrentParams() + "\n");
getPropertyMap().put(DBConstants.FaultParams.CURRENT_PARAMS, this.getCurrentParams().toString());
} else {
getPropertyMap().put(DBConstants.FaultParams.CURRENT_PARAMS, null);
}
}
if (this.getCurrentRequestName() != null) {
buff.append("Current Request Name: " + this.getCurrentRequestName() + "\n");
getPropertyMap().put(DBConstants.FaultParams.CURRENT_REQUEST_NAME, this.getCurrentRequestName());
} else {
getPropertyMap().put(DBConstants.FaultParams.CURRENT_REQUEST_NAME, null);
}
if (this.getCause() != null) {
buff.append("Nested Exception:-\n" + this.getCause() + "\n");
getPropertyMap().put(DBConstants.FaultParams.NESTED_EXCEPTION, this.getCause().toString());
} else {
getPropertyMap().put(DBConstants.FaultParams.NESTED_EXCEPTION, null);
}
if (this.getSourceDataService() != null) {
buff.append("Source Data Service:-\n");
buff.append(this.getSourceDataService().toString());
Map<String, String> sourcePropertyMap = new LinkedHashMap<>();
sourcePropertyMap.put(DBConstants.FaultParams.LOCATION, this.getSourceDataService().getRelativeDsLocation());
sourcePropertyMap.put(DBConstants.FaultParams.DEFAULT_NAMESPACE, this.getSourceDataService().getDefaultNamespace());
sourcePropertyMap.put(DBConstants.FaultParams.DESCRIPTION, this.getSourceDataService().getDescription() != null ?
this.getSourceDataService().getDescription() : "N/A");
sourcePropertyMap.put(DBConstants.FaultParams.DEFAULT_NAMESPACE, this.getSourceDataService().getDefaultNamespace());
sourcePropertyMap.put(DBConstants.FaultParams.DATA_SERVICE_NAME, this.getSourceDataService().getName());
getPropertyMap().put(DBConstants.FaultParams.SOURCE_DATA_SERVICE, sourcePropertyMap);
}
if (this.getCurrentRequestName() != null) {
buff.append("Current Request Name: " + this.getCurrentRequestName() + "\n");
getPropertyMap().put(DBConstants.FaultParams.CURRENT_REQUEST_NAME, this.getCurrentRequestName());
}
if (this.getCurrentParams() != null && !("true".equalsIgnoreCase(DBUtils.getCurrentParamsDisabledProperty()))) {
buff.append("Current Params: " + this.getCurrentParams() + "\n");
getPropertyMap().put(DBConstants.FaultParams.CURRENT_PARAMS, this.getCurrentParams().toString());
}
if (this.getCause() != null) {
buff.append("Nested Exception:-\n" + this.getCause() + "\n");
getPropertyMap().put(DBConstants.FaultParams.NESTED_EXCEPTION, this.getCause().toString());
}
return buff.toString();
}
} else {
getPropertyMap().put(DBConstants.FaultParams.SOURCE_DATA_SERVICE, null);
}
if (this.getCode() != null) {
buff.append("DS Code: " + this.getCode() + "\n");
getPropertyMap().put(DBConstants.FaultParams.DS_CODE, this.getCode());
} else {
getPropertyMap().put(DBConstants.FaultParams.DS_CODE, null);
}
return buff.toString();
}

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ private MongoClientOptions extractMongoOptions(Map<String, String> properties) {
builder.threadsAllowedToBlockForConnectionMultiplier(
Integer.parseInt(threadsAllowedToBlockForConnectionMultiplier));
}

String sslEnabled = (properties.get(DBConstants.MongoDB.SSL_ENABLED));
if (Boolean.parseBoolean(sslEnabled)) {
builder.sslEnabled(true);
}
return builder.build();
}

Expand All @@ -169,17 +174,23 @@ private MongoCredential createCredential(Map<String, String> properties) throws
String authenticationType = properties.get(DBConstants.MongoDB.AUTHENTICATION_TYPE);
String username = properties.get(DBConstants.MongoDB.USERNAME);
String password = properties.get(DBConstants.MongoDB.PASSWORD);
String database = properties.get(DBConstants.MongoDB.DATABASE);
String authSource = properties.get(DBConstants.MongoDB.AUTH_SOURCE);
if (authSource == null || authSource.isEmpty()) {
// For MONGODB-CR, SCRAM-SHA-1, and SCRAM-SHA-256, PLAIN the default auth source is the database tyring to connect
// refer: https://docs.mongodb.com/ruby-driver/master/reference/authentication/
// since database is mandatory, we will not address the case where DB is not defined.
authSource = properties.get(DBConstants.MongoDB.DATABASE);
}
if (authenticationType != null) {
switch (authenticationType) {
case DBConstants.MongoDB.MongoAuthenticationTypes.PLAIN:
credential = MongoCredential.createPlainCredential(username, database, password.toCharArray());
credential = MongoCredential.createPlainCredential(username, authSource, password.toCharArray());
break;
case DBConstants.MongoDB.MongoAuthenticationTypes.SCRAM_SHA_1:
credential = MongoCredential.createScramSha1Credential(username, database, password.toCharArray());
credential = MongoCredential.createScramSha1Credential(username, authSource, password.toCharArray());
break;
case DBConstants.MongoDB.MongoAuthenticationTypes.MONGODB_CR:
credential = MongoCredential.createMongoCRCredential(username, database, password.toCharArray());
credential = MongoCredential.createMongoCRCredential(username, authSource, password.toCharArray());
break;
case DBConstants.MongoDB.MongoAuthenticationTypes.GSSAPI:
credential = MongoCredential.createGSSAPICredential(username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-services</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-services</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion components/data/data-services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>data</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion components/data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>mi-component-parent</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion components/javax.cache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>mi-component-parent</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-publishers</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>data-publishers</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>data-publishers</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion components/mediation/data-publishers/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>mediation</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>extensions</artifactId>
<groupId>org.wso2.ei</groupId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.ei</groupId>
<artifactId>org.wso2.micro.integrator.security.handlers</artifactId>
<version>4.2.0-SNAPSHOT</version>
<version>4.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ public InvocationResponse invoke(MessageContext msgCtx) throws AxisFault {
if (faultCodeObject instanceof SOAP11FaultCodeImpl) {
faultCode = ((SOAP11FaultCodeImpl) faultCodeObject).getTextContent();
} else if (faultCodeObject instanceof SOAP12FaultCodeImpl) {
faultCode = ((SOAP12FaultSubCodeImpl) ((SOAP12FaultCodeImpl) faultCodeObject).getSubCode()).getTextContent();
if (null != ((SOAP12FaultCodeImpl) faultCodeObject).getSubCode()) {
faultCode = ((SOAP12FaultSubCodeImpl) ((SOAP12FaultCodeImpl) faultCodeObject)
.getSubCode()).getTextContent();
} else {
faultCode = ((SOAP12FaultCodeImpl)faultCodeObject).getTextContent();
}
}

if (faultCode != null && faultCode.contains("FailedAuthentication")) { // this is standard error code according to the WS-Sec
Expand Down
Loading

0 comments on commit f048f2b

Please sign in to comment.