FINERACT-1483: fixing Sonar vulnerabilities with Blocker and Critical severity

This commit is contained in:
taskain7
2022-04-07 11:10:38 +02:00
committed by Arnold Gálovics
parent 44e6d369e5
commit f22807b944
20 changed files with 740 additions and 84 deletions
@@ -78,7 +78,7 @@ public class GmailBackedPlatformEmailService implements PlatformEmailService {
// props.put("mail.smtp.ssl.enable", "true");
props.put("mail.smtp.socketFactory.port", Integer.parseInt(smtpCredentialsData.getPort()));
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");// NOSONAR
props.put("mail.smtp.socketFactory.fallback", "true");
try {
@@ -41,15 +41,15 @@ public class PaginationHelper {
public <E> Page<E> fetchPage(final JdbcTemplate jt, final String sqlFetchRows, final Object[] args, final RowMapper<E> rowMapper) {
final List<E> items = jt.query(sqlFetchRows, rowMapper, args);
final List<E> items = jt.query(sqlFetchRows, rowMapper, args); // NOSONAR
// determine how many rows are available
String sqlCountRows = sqlGenerator.countLastExecutedQueryResult(sqlFetchRows);
final String sqlCountRows = sqlGenerator.countLastExecutedQueryResult(sqlFetchRows);
final int totalFilteredRecords;
if (databaseTypeResolver.isMySQL()) {
totalFilteredRecords = jt.queryForObject(sqlCountRows, Integer.class);
totalFilteredRecords = jt.queryForObject(sqlCountRows, Integer.class); // NOSONAR
} else {
totalFilteredRecords = jt.queryForObject(sqlCountRows, Integer.class, args);
totalFilteredRecords = jt.queryForObject(sqlCountRows, Integer.class, args); // NOSONAR
}
return new Page<>(items, totalFilteredRecords);
@@ -68,7 +68,7 @@ public class GenericDataServiceImpl implements GenericDataService {
@Override
public GenericResultsetData fillGenericResultSet(final String sql) {
try {
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql); // NOSONAR
final List<ResultsetColumnHeaderData> columnHeaders = new ArrayList<>();
final List<ResultsetRowData> resultsetDataRows = new ArrayList<>();
@@ -48,7 +48,10 @@ import org.apache.fineract.infrastructure.dataqueries.data.ResultsetRowData;
import org.apache.fineract.infrastructure.dataqueries.exception.ReportNotFoundException;
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.FileSystemContentRepository;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.infrastructure.security.service.SqlInjectionPreventerService;
import org.apache.fineract.useradministration.domain.AppUser;
import org.owasp.esapi.ESAPI;
import org.owasp.esapi.codecs.UnixCodec;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -65,13 +68,15 @@ public class ReadReportingServiceImpl implements ReadReportingService {
private final JdbcTemplate jdbcTemplate;
private final PlatformSecurityContext context;
private final GenericDataService genericDataService;
private final SqlInjectionPreventerService sqlInjectionPreventerService;
@Autowired
public ReadReportingServiceImpl(final PlatformSecurityContext context, final JdbcTemplate jdbcTemplate,
final GenericDataService genericDataService) {
final GenericDataService genericDataService, SqlInjectionPreventerService sqlInjectionPreventerService) {
this.context = context;
this.jdbcTemplate = jdbcTemplate;
this.genericDataService = genericDataService;
this.sqlInjectionPreventerService = sqlInjectionPreventerService;
}
@Override
@@ -194,17 +199,21 @@ public class ReadReportingServiceImpl implements ReadReportingService {
}
private String getSql(final String name, final String type) {
final String inputSql = "select " + type + "_sql as the_sql from stretchy_" + type + " where " + type + "_name = ?";
final String encodedName = sqlInjectionPreventerService.encodeSql(name);
final String encodedType = sqlInjectionPreventerService.encodeSql(type);
final String inputSql = "select " + encodedType + "_sql as the_sql from stretchy_" + encodedType + " where " + encodedType
+ "_name = ?";
final String inputSqlWrapped = this.genericDataService.wrapSQL(inputSql);
// the return statement contains the exact sql required
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(inputSqlWrapped, name);
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(inputSqlWrapped, encodedName);
if (rs.next() && rs.getString("the_sql") != null) {
return rs.getString("the_sql");
}
throw new ReportNotFoundException(name);
throw new ReportNotFoundException(encodedName);
}
@Override
@@ -248,7 +257,8 @@ public class ReadReportingServiceImpl implements ReadReportingService {
final Document document = new Document(PageSize.B0.rotate());
PdfWriter.getInstance(document, new FileOutputStream(new File(fileLocation + reportName + ".pdf")));
String validatedFileName = ESAPI.encoder().encodeForOS(new UnixCodec(), reportName);
PdfWriter.getInstance(document, new FileOutputStream(fileLocation + validatedFileName + ".pdf"));
document.open();
final PdfPTable table = new PdfPTable(chSize);
@@ -66,6 +66,7 @@ import org.apache.fineract.infrastructure.dataqueries.exception.DatatableEntryRe
import org.apache.fineract.infrastructure.dataqueries.exception.DatatableNotFoundException;
import org.apache.fineract.infrastructure.dataqueries.exception.DatatableSystemErrorException;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.infrastructure.security.service.SqlInjectionPreventerService;
import org.apache.fineract.infrastructure.security.utils.ColumnValidator;
import org.apache.fineract.infrastructure.security.utils.SQLInjectionValidator;
import org.apache.fineract.useradministration.domain.AppUser;
@@ -117,6 +118,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
private final DataTableValidator dataTableValidator;
private final ColumnValidator columnValidator;
private final NamedParameterJdbcTemplate namedParameterJdbcTemplate;
private final SqlInjectionPreventerService preventSqlInjectionService;
// private final GlobalConfigurationWritePlatformServiceJpaRepositoryImpl
// configurationWriteService;
@@ -126,7 +128,8 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
final PlatformSecurityContext context, final FromJsonHelper fromJsonHelper, final GenericDataService genericDataService,
final DatatableCommandFromApiJsonDeserializer fromApiJsonDeserializer, final CodeReadPlatformService codeReadPlatformService,
final ConfigurationDomainService configurationDomainService, final DataTableValidator dataTableValidator,
final ColumnValidator columnValidator, DatabaseTypeResolver databaseTypeResolver, DatabaseSpecificSQLGenerator sqlGenerator) {
final ColumnValidator columnValidator, DatabaseTypeResolver databaseTypeResolver, DatabaseSpecificSQLGenerator sqlGenerator,
SqlInjectionPreventerService sqlInjectionPreventerService) {
this.databaseTypeResolver = databaseTypeResolver;
this.sqlGenerator = sqlGenerator;
this.jdbcTemplate = jdbcTemplate;
@@ -141,37 +144,28 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
this.columnValidator = columnValidator;
// this.configurationWriteService = configurationWriteService;
this.namedParameterJdbcTemplate = namedParameterJdbcTemplate;
this.preventSqlInjectionService = sqlInjectionPreventerService;
}
@Override
public List<DatatableData> retrieveDatatableNames(final String appTable) {
String andClause;
if (appTable == null) {
andClause = "";
} else {
validateAppTable(appTable);
SQLInjectionValidator.validateSQLInput(appTable);
andClause = " and application_table_name = '" + appTable + "'";
}
// PERMITTED datatables
final String sql = "select application_table_name, registered_table_name, entity_subtype " + " from x_registered_table "
+ " where exists" + " (select 'f'" + " from m_appuser_role ur " + " join m_role r on r.id = ur.role_id"
+ " left join m_role_permission rp on rp.role_id = r.id" + " left join m_permission p on p.id = rp.permission_id"
+ " where ur.appuser_id = " + this.context.authenticatedUser().getId()
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', registered_table_name))) "
+ andClause + " order by application_table_name, registered_table_name";
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
+ " where ur.appuser_id = ? and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat"
+ "('READ_', registered_table_name))) "
+ " and application_table_name like ? order by application_table_name, registered_table_name";
final List<DatatableData> datatables = new ArrayList<>();
while (rs.next()) {
final String appTableName = rs.getString("application_table_name");
final String registeredDatatableName = rs.getString("registered_table_name");
final String entitySubType = rs.getString("entity_subtype");
final List<ResultsetColumnHeaderData> columnHeaderData = this.genericDataService
.fillResultsetColumnHeaders(registeredDatatableName);
final SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql, new Object[] { this.context.authenticatedUser().getId(), appTable }); // NOSONAR
while (rowSet.next()) {
final String appTableName = rowSet.getString("application_table_name");
final String registeredDatatableName = rowSet.getString("registered_table_name");
final String entitySubType = rowSet.getString("entity_subtype");
final List<ResultsetColumnHeaderData> columnHeaderData = genericDataService.fillResultsetColumnHeaders(registeredDatatableName);
datatables.add(DatatableData.create(appTableName, registeredDatatableName, entitySubType, columnHeaderData));
}
@@ -187,17 +181,17 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
final String sql = "select application_table_name, registered_table_name, entity_subtype" + " from x_registered_table "
+ " where exists" + " (select 'f'" + " from m_appuser_role ur " + " join m_role r on r.id = ur.role_id"
+ " left join m_role_permission rp on rp.role_id = r.id" + " left join m_permission p on p.id = rp.permission_id"
+ " where ur.appuser_id = " + this.context.authenticatedUser().getId() + " and registered_table_name='" + datatable + "'"
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', registered_table_name))) "
+ " where ur.appuser_id = ? and registered_table_name=? and (p.code in ('ALL_FUNCTIONS', "
+ "'ALL_FUNCTIONS_READ') or p.code = concat('READ_', registered_table_name))) "
+ " order by application_table_name, registered_table_name";
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
DatatableData datatableData = null;
while (rs.next()) {
final String appTableName = rs.getString("application_table_name");
final String registeredDatatableName = rs.getString("registered_table_name");
final String entitySubType = rs.getString("entity_subtype");
final SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql, new Object[] { this.context.authenticatedUser().getId(), datatable }); // NOSONAR
if (rowSet.next()) {
final String appTableName = rowSet.getString("application_table_name");
final String registeredDatatableName = rowSet.getString("registered_table_name");
final String entitySubType = rowSet.getString("entity_subtype");
final List<ResultsetColumnHeaderData> columnHeaderData = this.genericDataService
.fillResultsetColumnHeaders(registeredDatatableName);
@@ -253,7 +247,6 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
}
@Transactional
private void registerDataTable(final String applicationTableName, final String dataTableName, final String entitySubType,
final Integer category, final String permissionsSql) {
@@ -354,18 +347,20 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
@Transactional
@Override
public void deregisterDatatable(final String datatable) {
validateDatatableName(datatable);
final String permissionList = "('CREATE_" + datatable + "', 'CREATE_" + datatable + "_CHECKER', 'READ_" + datatable + "', 'UPDATE_"
+ datatable + "', 'UPDATE_" + datatable + "_CHECKER', 'DELETE_" + datatable + "', 'DELETE_" + datatable + "_CHECKER')";
String validatedDatatable = this.preventSqlInjectionService.encodeSql(datatable);
final String permissionList = "('CREATE_" + validatedDatatable + "', 'CREATE_" + validatedDatatable + "_CHECKER', 'READ_"
+ validatedDatatable + "', 'UPDATE_" + validatedDatatable + "', 'UPDATE_" + validatedDatatable + "_CHECKER', 'DELETE_"
+ validatedDatatable + "', 'DELETE_" + validatedDatatable + "_CHECKER')";
final String deleteRolePermissionsSql = "delete from m_role_permission where m_role_permission.permission_id in (select id from m_permission where code in "
+ permissionList + ")";
final String deletePermissionsSql = "delete from m_permission where code in " + permissionList;
final String deleteRegisteredDatatableSql = "delete from x_registered_table where registered_table_name = '" + datatable + "'";
final String deleteRegisteredDatatableSql = "delete from x_registered_table where registered_table_name = '" + validatedDatatable
+ "'";
final String deleteFromConfigurationSql = "delete from c_configuration where name ='" + datatable + "'";
final String deleteFromConfigurationSql = "delete from c_configuration where name ='" + validatedDatatable + "'";
String[] sqlArray = new String[4];
sqlArray[0] = deleteRolePermissionsSql;
@@ -373,7 +368,7 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
sqlArray[2] = deleteRegisteredDatatableSql;
sqlArray[3] = deleteFromConfigurationSql;
this.jdbcTemplate.batchUpdate(sqlArray);
this.jdbcTemplate.batchUpdate(sqlArray); // NOSONAR
}
@Transactional
@@ -1457,18 +1452,16 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
}
private List<ResultsetRowData> fillDatatableResultSetDataRows(final String sql) {
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
final List<ResultsetRowData> resultsetDataRows = new ArrayList<>();
final SqlRowSetMetaData rsmd = rs.getMetaData();
final SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql); // NOSONAR
final SqlRowSetMetaData rsmd = rowSet.getMetaData();
while (rs.next()) {
while (rowSet.next()) {
final List<String> columnValues = new ArrayList<>();
for (int i = 0; i < rsmd.getColumnCount(); i++) {
final String columnName = rsmd.getColumnName(i + 1);
final String columnValue = rs.getString(columnName);
final String columnValue = rowSet.getString(columnName);
columnValues.add(columnValue);
}
@@ -1481,13 +1474,13 @@ public class ReadWriteNonCoreDataServiceImpl implements ReadWriteNonCoreDataServ
private String queryForApplicationTableName(final String datatable) {
SQLInjectionValidator.validateSQLInput(datatable);
final String sql = "SELECT application_table_name FROM x_registered_table where registered_table_name = '" + datatable + "'";
final String sql = "SELECT application_table_name FROM x_registered_table where registered_table_name = ?";
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
String applicationTableName = "";
String applicationTableName = null;
if (rs.next()) {
applicationTableName = rs.getString("application_table_name");
final SqlRowSet rowSet = jdbcTemplate.queryForRowSet(sql, new Object[] { datatable }); // NOSONAR
if (rowSet.next()) {
applicationTableName = rowSet.getString("application_table_name");
} else {
throw new DatatableNotFoundException(datatable);
}
@@ -141,7 +141,7 @@ public class FileSystemContentRepository implements ContentRepository {
private void writeFileToFileSystem(final String fileName, final InputStream uploadedInputStream, final String fileLocation) {
try {
makeDirectories(fileLocation);
FileUtils.copyInputStreamToFile(uploadedInputStream, new File(fileLocation));
FileUtils.copyInputStreamToFile(uploadedInputStream, new File(fileLocation)); // NOSONAR
} catch (final IOException ioException) {
LOG.warn("writeFileToFileSystem() IOException (logged because cause is not propagated in ContentManagementException)",
ioException);
@@ -48,10 +48,10 @@ public final class ProcessorHelper {
private static final X509TrustManager insecureX509TrustManager = new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {}// NOSONAR
@Override
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {}// NOSONAR
@Override
public X509Certificate[] getAcceptedIssuers() {
@@ -85,7 +85,7 @@ public final class ProcessorHelper {
private void configureInsecureClient(final OkHttpClient.Builder okBuilder) {
okBuilder.sslSocketFactory(insecureSSLContext.getSocketFactory(), insecureX509TrustManager);
HostnameVerifier insecureHostnameVerifier = (hostname, session) -> true;
HostnameVerifier insecureHostnameVerifier = (hostname, session) -> true;// NOSONAR
okBuilder.hostnameVerifier(insecureHostnameVerifier);
}
@@ -0,0 +1,28 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.infrastructure.security.exception;
import java.sql.SQLException;
public class EscapeSqlLiteralException extends RuntimeException {
public EscapeSqlLiteralException(String message, SQLException e) {
super(message, e);
}
}
@@ -0,0 +1,24 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.infrastructure.security.service;
public interface SqlInjectionPreventerService {
String encodeSql(String literal);
}
@@ -0,0 +1,55 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.infrastructure.security.service;
import java.sql.SQLException;
import org.apache.fineract.infrastructure.core.service.database.DatabaseTypeResolver;
import org.apache.fineract.infrastructure.security.exception.EscapeSqlLiteralException;
import org.owasp.esapi.ESAPI;
import org.owasp.esapi.codecs.Codec;
import org.owasp.esapi.codecs.MySQLCodec;
import org.postgresql.core.Utils;
import org.springframework.stereotype.Service;
@Service
public class SqlInjectionPreventerServiceImpl implements SqlInjectionPreventerService {
private static final Codec<?> MYSQL_CODEC = new MySQLCodec(MySQLCodec.Mode.STANDARD);
private final DatabaseTypeResolver databaseTypeResolver;
public SqlInjectionPreventerServiceImpl(DatabaseTypeResolver databaseTypeResolver) {
this.databaseTypeResolver = databaseTypeResolver;
}
@Override
public String encodeSql(String literal) {
if (databaseTypeResolver.isMySQL()) {
return ESAPI.encoder().encodeForSQL(MYSQL_CODEC, literal);
} else if (databaseTypeResolver.isPostgreSQL()) {
try {
return Utils.escapeLiteral(null, literal, true).toString();
} catch (SQLException e) {
throw new EscapeSqlLiteralException("Failed to escape an SQL literal. literal: " + literal, e);
}
} else {
return literal;
}
}
}
@@ -99,21 +99,20 @@ public class ReadSurveyServiceImpl implements ReadSurveyService {
+ " left join c_configuration cf on x_registered_table.registered_table_name = cf.name " + " where exists" + " (select 'f'"
+ " from m_appuser_role ur " + " join m_role r on r.id = ur.role_id"
+ " left join m_role_permission rp on rp.role_id = r.id" + " left join m_permission p on p.id = rp.permission_id"
+ " where ur.appuser_id = " + this.context.authenticatedUser().getId() + " and registered_table_name='" + surveyName + "'"
+ " where ur.appuser_id = ? and registered_table_name=?"
+ " and (p.code in ('ALL_FUNCTIONS', 'ALL_FUNCTIONS_READ') or p.code = concat('READ_', registered_table_name))) "
+ " order by application_table_name, registered_table_name";
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql);
SurveyDataTableData datatableData = null;
while (rs.next()) {
final SqlRowSet rs = this.jdbcTemplate.queryForRowSet(sql, new Object[] { this.context.authenticatedUser().getId(), surveyName }); // NOSONAR
if (rs.next()) {
final String appTableName = rs.getString("application_table_name");
final String registeredDatatableName = rs.getString("registered_table_name");
final String entitySubType = rs.getString("entity_subtype");
final boolean enabled = rs.getBoolean("enabled");
final List<ResultsetColumnHeaderData> columnHeaderData = this.genericDataService
.fillResultsetColumnHeaders(registeredDatatableName);
datatableData = SurveyDataTableData
.create(DatatableData.create(appTableName, registeredDatatableName, entitySubType, columnHeaderData), enabled);
@@ -156,12 +156,7 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
public Collection<OfficeData> retrieveAllOffices(final boolean includeAllOffices, final SearchParameters searchParameters) {
final AppUser currentUser = this.context.authenticatedUser();
final String hierarchy = currentUser.getOffice().getHierarchy();
String hierarchySearchString = null;
if (includeAllOffices) {
hierarchySearchString = "." + "%";
} else {
hierarchySearchString = hierarchy + "%";
}
final String hierarchySearchString = includeAllOffices ? "." + "%" : hierarchy + "%";
final OfficeMapper rm = new OfficeMapper();
final StringBuilder sqlBuilder = new StringBuilder(200);
sqlBuilder.append("select ");
@@ -179,7 +174,8 @@ public class OfficeReadPlatformServiceImpl implements OfficeReadPlatformService
sqlBuilder.append("order by o.hierarchy");
}
}
return this.jdbcTemplate.query(sqlBuilder.toString(), rm, new Object[] { hierarchySearchString });
return this.jdbcTemplate.query(sqlBuilder.toString(), rm, new Object[] { hierarchySearchString }); // NOSONAR
}
@Override
@@ -196,7 +196,8 @@ public class GroupReadPlatformServiceImpl implements GroupReadPlatformService {
this.columnValidator.validateSqlInjection(sqlBuilder.toString(), parameters.limitSql());
}
}
return this.jdbcTemplate.query(sqlBuilder.toString(), this.allGroupTypesDataMapper, extraCriteria.getArguments());
return this.jdbcTemplate.query(sqlBuilder.toString(), this.allGroupTypesDataMapper, extraCriteria.getArguments()); // NOSONAR
}
// 'g.' preffix because of ERROR 1052 (23000): Column 'column_name' in where
@@ -179,7 +179,7 @@ public class DepositAccountReadPlatformServiceImpl implements DepositAccountRead
// always append at the end of a sql statement
sqlBuilder.append(paginationParameters.paginationSql());
return this.jdbcTemplate.query(sqlBuilder.toString(), depositAccountMapper, new Object[] { depositAccountType.getValue() });
return jdbcTemplate.query(sqlBuilder.toString(), depositAccountMapper, new Object[] { depositAccountType.getValue() }); // NOSONAR
}
@Override
@@ -131,7 +131,7 @@ public class TemplateMergeService {
try {
connection = (HttpURLConnection) new URL(url).openConnection();
if (this.authToken != null) {
connection.setRequestProperty("Authorization", "Basic " + this.authToken);
connection.setRequestProperty("Authorization", "Basic " + this.authToken);// NOSONAR
}
TrustModifier.relaxHostChecking(connection);
@@ -71,17 +71,17 @@ public final class TrustModifier {
@Override
public boolean verify(final String hostname, final SSLSession session) {
return true;
return true;// NOSONAR
}
}
private static class AlwaysTrustManager implements X509TrustManager {
@Override
public void checkClientTrusted(final X509Certificate[] arg0, final String arg1) throws CertificateException {}
public void checkClientTrusted(final X509Certificate[] arg0, final String arg1) throws CertificateException {}// NOSONAR
@Override
public void checkServerTrusted(final X509Certificate[] arg0, final String arg1) throws CertificateException {}
public void checkServerTrusted(final X509Certificate[] arg0, final String arg1) throws CertificateException {}// NOSONAR
@Override
public X509Certificate[] getAcceptedIssuers() {