]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15654 added liveness endpoint to allowlist with passcode
authorTobias Trabelsi <64127335+tobias-trabelsi-sonarsource@users.noreply.github.com>
Wed, 17 Nov 2021 07:14:04 +0000 (08:14 +0100)
committersonartech <sonartech@sonarsource.com>
Wed, 17 Nov 2021 20:03:38 +0000 (20:03 +0000)
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/UserSessionInitializer.java
server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/UserSessionInitializerTest.java

index 205b669eb99c2796a899ffa74c80cc895a161106..5582633876af578f344aef6f87c2b579620272da 100644 (file)
@@ -60,8 +60,11 @@ public class UserSessionInitializer {
     "/api/authentication/login", "/api/authentication/logout", "/api/authentication/validate",
     "/api/project_badges/measure", "/api/project_badges/quality_gate");
 
-  private static final Set<String> URL_USING_PASSCODE = ImmutableSet.of(
-    "/api/ce/info", "/api/ce/pause", "/api/ce/resume", "/api/system/health", "/api/system/analytics", "/api/system/migrate_es");
+  private static final Set<String> URL_USING_PASSCODE = Set.of(
+    "/api/ce/info", "/api/ce/pause",
+    "/api/ce/resume", "/api/system/health",
+    "/api/system/analytics", "/api/system/migrate_es",
+    "/api/system/liveness");
 
   private static final UrlPattern URL_PATTERN = UrlPattern.builder()
     .includes("/*")
index df26d7230521826a190dbaa0c2cd49386a0f7561..36daa93dba652307fc9b0e510e915c5300403b58 100644 (file)
@@ -103,6 +103,7 @@ public class UserSessionInitializerTest {
     assertPathIsIgnoredWithAnonymousAccess("/api/ce/pause");
     assertPathIsIgnoredWithAnonymousAccess("/api/ce/resume");
     assertPathIsIgnoredWithAnonymousAccess("/api/system/health");
+    assertPathIsIgnoredWithAnonymousAccess("/api/system/liveness");
 
     // exclude static resources
     assertPathIsIgnored("/css/style.css");