aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Poscia <aurelien.poscia@sonarsource.com>2024-12-18 11:58:19 +0100
committersonartech <sonartech@sonarsource.com>2024-12-20 20:03:10 +0000
commit24b47b2d66ba46e3dd7ff421576b6eb13f7666ab (patch)
treec587d92989b3cdb060921e326f0eb1920cbc3fa4
parentb5bfc6f36e2d89743b495bb5823f567e965dc31b (diff)
downloadsonarqube-24b47b2d66ba46e3dd7ff421576b6eb13f7666ab.tar.gz
sonarqube-24b47b2d66ba46e3dd7ff421576b6eb13f7666ab.zip
SONAR-24023 Remove onelogin dependency
-rw-r--r--build.gradle1
-rw-r--r--server/sonar-auth-saml/build.gradle3
-rw-r--r--server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java18
-rw-r--r--server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlMessageIdChecker.java10
-rw-r--r--server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlStatusCheckerTest.java5
5 files changed, 8 insertions, 29 deletions
diff --git a/build.gradle b/build.gradle
index 207b58de017..146408e5761 100644
--- a/build.gradle
+++ b/build.gradle
@@ -385,7 +385,6 @@ subprojects {
dependency('com.microsoft.sqlserver:mssql-jdbc:12.8.1.jre11') {
exclude 'com.fasterxml.jackson.core:jackson-databind'
}
- dependency 'com.onelogin:java-saml:2.9.0'
dependency 'com.oracle.database.jdbc:ojdbc11:23.6.0.24.10'
dependency 'com.datadoghq:dd-java-agent:1.30.1'
dependency 'org.aspectj:aspectjtools:1.9.22.1'
diff --git a/server/sonar-auth-saml/build.gradle b/server/sonar-auth-saml/build.gradle
index 955aa9cfd53..d8ce2bc3da5 100644
--- a/server/sonar-auth-saml/build.gradle
+++ b/server/sonar-auth-saml/build.gradle
@@ -6,9 +6,6 @@ configurations {
dependencies {
// please keep the list ordered
-
- api "com.onelogin:java-saml"
-
compileOnlyApi 'com.github.spotbugs:spotbugs-annotations'
compileOnlyApi 'com.squareup.okhttp3:okhttp'
compileOnlyApi 'jakarta.servlet:jakarta.servlet-api'
diff --git a/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java b/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java
index 358d2ba3231..16bc31b577a 100644
--- a/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java
+++ b/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java
@@ -19,21 +19,9 @@
*/
package org.sonar.auth.saml;
-import com.google.common.collect.ImmutableList;
-import com.onelogin.saml2.Auth;
-import java.util.Arrays;
-import org.joda.time.Instant;
import org.junit.Rule;
-import org.junit.Test;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
-import org.sonar.db.user.SamlMessageIdDto;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatCode;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
public class SamlMessageIdCheckerIT {
@@ -42,7 +30,9 @@ public class SamlMessageIdCheckerIT {
private DbSession dbSession = db.getSession();
- private Auth auth = mock(Auth.class);
+ //TODO
+
+/* private Auth auth = mock(Auth.class);
private SamlMessageIdChecker underTest = new SamlMessageIdChecker(db.getDbClient());
@@ -85,5 +75,5 @@ public class SamlMessageIdCheckerIT {
SamlMessageIdDto result = db.getDbClient().samlMessageIdDao().selectByMessageId(dbSession, "MESSAGE_2").get();
assertThat(result.getMessageId()).isEqualTo("MESSAGE_2");
assertThat(result.getExpirationDate()).isEqualTo(10_000_000_000L);
- }
+ }*/
}
diff --git a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlMessageIdChecker.java b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlMessageIdChecker.java
index 8c84030e7ca..a688134b297 100644
--- a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlMessageIdChecker.java
+++ b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlMessageIdChecker.java
@@ -19,14 +19,8 @@
*/
package org.sonar.auth.saml;
-import com.onelogin.saml2.Auth;
-import org.joda.time.Instant;
import org.sonar.api.server.ServerSide;
import org.sonar.db.DbClient;
-import org.sonar.db.DbSession;
-import org.sonar.db.user.SamlMessageIdDto;
-
-import static java.util.Objects.requireNonNull;
@ServerSide
public class SamlMessageIdChecker {
@@ -37,6 +31,8 @@ public class SamlMessageIdChecker {
this.dbClient = dbClient;
}
+ //TODO
+/*
public void check(Auth auth) {
String messageId = requireNonNull(auth.getLastMessageId(), "Message ID is missing");
Instant lastAssertionNotOnOrAfter = auth.getLastAssertionNotOnOrAfter().stream()
@@ -54,5 +50,5 @@ public class SamlMessageIdChecker {
dbSession.commit();
}
}
-
+*/
}
diff --git a/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlStatusCheckerTest.java b/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlStatusCheckerTest.java
index 51f02441f3b..90269335a7a 100644
--- a/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlStatusCheckerTest.java
+++ b/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlStatusCheckerTest.java
@@ -19,15 +19,12 @@
*/
package org.sonar.auth.saml;
-import com.onelogin.saml2.Auth;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import org.sonar.api.config.PropertyDefinitions;
import org.sonar.api.config.internal.MapSettings;
import org.sonar.api.utils.System2;
-import static org.mockito.Mockito.mock;
-
public class SamlStatusCheckerTest {
private static final String IDP_CERTIFICATE = "-----BEGIN CERTIFICATE-----MIIF5zCCA8+gAwIBAgIUIXv9OVs/XUicgR1bsV9uccYhHfowDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAkFVMQ8wDQYDVQQIDAZHRU5FVkExEDAOBgNVBAcMB1ZFUk5JRVIxDjAMBgNVBAoMBVNPTkFSMQ0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UP8xTL4wxZq3MB8GA1UdIwQYMBaAFI5UVLtTySvbGqH7UP8xTL4wxZq3MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBABAtXsKNWx0sDDFA53qZ1zRyWKWAMoh95pawFCrKgTEW4ZrA73pa790eE1Y+vT6qUXKI4li9skIDa+6psCdxhZIrHPRAnVZVeB2373Bxr5bw/XQ8elRCjWeMULbYJ9tgsLV0I9CiEP0a6Tm8t0yDVXNUfx36E5fkgLSrxoRo8XJzxHbJCnLVXHdaNBxOT7jVcom6Wo4PB2bsjVzhHm6amn5hZp4dMHm0Mv0ln1wH8jVnizHQBLsGMzvvl58+9s1pP17ceRDkpNDz+EQyA+ZArqkW1MqtwVhbzz8QgMprhflKkArrsC7v06Jv8fqUbn9LvtYK9IwHTX7J8dFcsO/gUC5PevYT3nriN3Azb20ggSQ1yOEMozvj5T96S6itfHPit7vyEQ84JPrEqfuQDZQ/LKZQqfvuXX1aAG3TU3TMWB9VMMFsTuMFS8bfrhMX77g0Ud4qJcBOYOH3hR59agSdd2QZNLP3zZsYQHLLQkq94jdTXKTqm/w7mlPFKV59HjTbHBhTtxBHMft/mvvLEuC9KKFfAOXYQ6V+s9Nk0BW4ggEfewaX58OBuy7ISqRtRFPGia18YRzzHqkhjubJYMPkIfYpFVd+C0II3F0kdy8TtpccjyKo9bcHMLxO4n8PDAl195CPthMi8gUvT008LGEotr+3kXsouTEZTT0glXKLdO2W-----END CERTIFICATE-----";
@@ -54,7 +51,7 @@ public class SamlStatusCheckerTest {
private final MapSettings settings = new MapSettings(new PropertyDefinitions(System2.INSTANCE, SamlSettings.definitions()));
- private final Auth auth = mock(Auth.class);
+ //private final Auth auth = mock(Auth.class);
private SamlAuthenticationStatus samlAuthenticationStatus;
//TODO