From 3260067a3be7061592b3f320f5326e75f4ed6641 Mon Sep 17 00:00:00 2001 From: srosse <stephane.rosse@frentix.com> Date: Fri, 9 Oct 2020 12:11:53 +0200 Subject: [PATCH] OO-4952: mark interfaces to external system as //NOSONAR Mark interfaces to external systems as not relevant for sonar as we have no choices to implement connection an other way --- .../olat/core/commons/services/sms/spi/BulkSMSProvider.java | 4 ++-- .../edusharing/manager/EdusharingSecurityServiceImpl.java | 2 +- .../modules/gotomeeting/manager/GoToMeetingManagerImpl.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/olat/core/commons/services/sms/spi/BulkSMSProvider.java b/src/main/java/org/olat/core/commons/services/sms/spi/BulkSMSProvider.java index 83b5d62a1d4..5fa99a51c7f 100644 --- a/src/main/java/org/olat/core/commons/services/sms/spi/BulkSMSProvider.java +++ b/src/main/java/org/olat/core/commons/services/sms/spi/BulkSMSProvider.java @@ -129,7 +129,7 @@ public class BulkSMSProvider extends AbstractSpringModule implements MessagesSPI throws SimpleMessageException { HttpPost send = new HttpPost(url + "?deduplication-id=" + messageId); String token = StringHelper.encodeBase64(tokenId + ":" + tokenSecret); - send.setHeader(new BasicHeader("Authorization", "Basic " + token)); + send.setHeader(new BasicHeader("Authorization", "Basic " + token));//NOSONAR no other choice send.setHeader(new BasicHeader("Content-Type", "application/json")); String phone = recipient.replace("+", "").replace(" ", ""); @@ -144,7 +144,7 @@ public class BulkSMSProvider extends AbstractSpringModule implements MessagesSPI if(returnCode == 200 || returnCode == 201) { return true; } - log.error("WebSMS return an error code " + returnCode + ": " + responseString); + log.error("WebSMS return an error code {}: {}", returnCode, responseString); return false; } catch(Exception e) { log.error("", e); diff --git a/src/main/java/org/olat/modules/edusharing/manager/EdusharingSecurityServiceImpl.java b/src/main/java/org/olat/modules/edusharing/manager/EdusharingSecurityServiceImpl.java index 87a0d3f7f80..dbc8d86bbc6 100644 --- a/src/main/java/org/olat/modules/edusharing/manager/EdusharingSecurityServiceImpl.java +++ b/src/main/java/org/olat/modules/edusharing/manager/EdusharingSecurityServiceImpl.java @@ -59,7 +59,7 @@ public class EdusharingSecurityServiceImpl implements EdusharingSecurityService private static final Cipher newCipher() throws NoSuchAlgorithmException, NoSuchPaddingException { - return Cipher.getInstance("RSA/ECB/PKCS1Padding"); + return Cipher.getInstance("RSA/ECB/PKCS1Padding");//NOSONAR The configuration of the cipher is given by EduSharing } @Override diff --git a/src/main/java/org/olat/modules/gotomeeting/manager/GoToMeetingManagerImpl.java b/src/main/java/org/olat/modules/gotomeeting/manager/GoToMeetingManagerImpl.java index 539772e781e..140a71d2e46 100644 --- a/src/main/java/org/olat/modules/gotomeeting/manager/GoToMeetingManagerImpl.java +++ b/src/main/java/org/olat/modules/gotomeeting/manager/GoToMeetingManagerImpl.java @@ -538,7 +538,7 @@ public class GoToMeetingManagerImpl implements GoToMeetingManager { post.addHeader("Accept", "application/json"); String authVal = goToMeetingModule.getTrainingConsumerKey() + ":" + goToMeetingModule.getTrainingConsumerSecret(); - post.addHeader("Authorization", "Basic " + StringHelper.encodeBase64(authVal)); + post.addHeader("Authorization", "Basic " + StringHelper.encodeBase64(authVal)); //NOSONAR no other choice post.addHeader("Content-Type", "application/x-www-form-urlencoded"); List<NameValuePair> urlParameters = new ArrayList<>(4); @@ -580,7 +580,7 @@ public class GoToMeetingManagerImpl implements GoToMeetingManager { post.addHeader("Accept", "application/json"); String authVal = goToMeetingModule.getTrainingConsumerKey() + ":" + goToMeetingModule.getTrainingConsumerSecret(); - post.addHeader("Authorization", "Basic " + StringHelper.encodeBase64(authVal)); + post.addHeader("Authorization", "Basic " + StringHelper.encodeBase64(authVal)); //NOSONAR no other choice post.addHeader("Content-Type", "application/x-www-form-urlencoded"); List<NameValuePair> urlParameters = new ArrayList<>(4); -- GitLab