You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2026/06/12 12:45:52 UTC

(syncope) branch 4_1_X updated (b3a8f0e90e -> 9c4d8609fd)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


    from b3a8f0e90e Upgrading AdminLTE
     new f40345793e [SYNCOPE-1971] - Fix authentication throttle with JCache providers on Payara
     new d16be80755 Upgrading AdminLTE
     new 7590e00ce3 Cleanup
     new 4d6908cf4c Upgrading Spring Cloud Gateway
     new 147f482d82 Upgrading Swagger Core
     new 9c4d8609fd Fixing Neo4j

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../client/ui/commons/themes/js/adminlte.min.js    |  2 +-
 core/persistence-neo4j/pom.xml                     |  6 ++
 .../core/persistence/neo4j/PersistenceContext.java |  3 +-
 .../core/persistence/neo4j/dao/Neo4jTaskDAO.java   | 12 ++--
 .../syncope/core/starter/SelfKeymasterContext.java |  2 +-
 .../security/AuthenticationAttemptThrottler.java   | 64 +++++++---------------
 .../security/RateLimitAuthenticationException.java |  4 +-
 .../core/spring/security/WebSecurityContext.java   | 21 +++++--
 .../AuthenticationAttemptThrottlerTest.java        | 63 ++++++++++++---------
 .../SyncopeBasicAuthenticationEntryPointTest.java  |  6 +-
 fit/core-reference/pom.xml                         |  6 ++
 pom.xml                                            |  8 +--
 12 files changed, 102 insertions(+), 95 deletions(-)


(syncope) 01/06: [SYNCOPE-1971] - Fix authentication throttle with JCache providers on Payara

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit f40345793e9f50e4c66fb614361a28a762eda37d
Author: Massimiliano Perrone <ma...@tirasa.net>
AuthorDate: Wed Jun 10 16:53:00 2026 +0200

    [SYNCOPE-1971] - Fix authentication throttle with JCache providers on Payara
---
 .../security/AuthenticationAttemptThrottler.java   | 23 ++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java
index 6527950643..65f4d7c086 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java
@@ -93,14 +93,14 @@ public class AuthenticationAttemptThrottler {
 
         String key = key(domain, username);
         long now = clock.getAsLong();
-        RateLimitAuthenticationException blocked = attempts.invoke(key, (entry, args) -> {
+        Long retryAfter = attempts.invoke(key, (entry, args) -> {
             if (!entry.exists()) {
                 return null;
             }
 
             Attempts state = entry.getValue();
             if (state.blockedUntil() > now) {
-                return blocked(state.blockedUntil(), now);
+                return retryAfterSeconds(state.blockedUntil(), now);
             }
 
             Deque<Long> failures = prune(state.failures(), now);
@@ -111,8 +111,8 @@ public class AuthenticationAttemptThrottler {
             }
             return null;
         });
-        if (blocked != null) {
-            throw blocked;
+        if (retryAfter != null) {
+            throw blocked(retryAfter);
         }
     }
 
@@ -133,7 +133,7 @@ public class AuthenticationAttemptThrottler {
         }
 
         long now = clock.getAsLong();
-        RateLimitAuthenticationException blocked = attempts.invoke(key(domain, username), (entry, args) -> {
+        Long retryAfter = attempts.invoke(key(domain, username), (entry, args) -> {
             Attempts state = entry.exists()
                     ? entry.getValue()
                     : new Attempts();
@@ -143,14 +143,14 @@ public class AuthenticationAttemptThrottler {
             if (failures.size() >= throttle.getMaxAttempts()) {
                 long blockedUntil = now + TimeUnit.SECONDS.toMillis(throttle.getLockSeconds());
                 entry.setValue(new Attempts(failures, blockedUntil));
-                return blocked(blockedUntil, now);
+                return retryAfterSeconds(blockedUntil, now);
             }
 
             entry.setValue(new Attempts(failures, state.blockedUntil()));
             return null;
         });
-        if (blocked != null) {
-            throw blocked;
+        if (retryAfter != null) {
+            throw blocked(retryAfter);
         }
     }
 
@@ -163,8 +163,11 @@ public class AuthenticationAttemptThrottler {
         return failures;
     }
 
-    protected static RateLimitAuthenticationException blocked(final long blockedUntil, final long now) {
-        long retryAfter = Math.max(1, TimeUnit.MILLISECONDS.toSeconds(blockedUntil - now));
+    protected static long retryAfterSeconds(final long blockedUntil, final long now) {
+        return Math.max(1, TimeUnit.MILLISECONDS.toSeconds(blockedUntil - now));
+    }
+
+    protected static RateLimitAuthenticationException blocked(final long retryAfter) {
         return new RateLimitAuthenticationException("Too many authentication failures", retryAfter);
     }
 }


(syncope) 05/06: Upgrading Swagger Core

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 147f482d82b7ac2ea52ce96172fd88559402f65c
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Fri Jun 12 13:58:23 2026 +0200

    Upgrading Swagger Core
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5eec1bc8a4..b00b542baa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -470,7 +470,7 @@ under the License.
     <cas.version>7.3.7.2</cas.version>
     <cas-client.version>4.1.1</cas-client.version>
 
-    <swagger-core.version>2.2.50</swagger-core.version>
+    <swagger-core.version>2.2.51</swagger-core.version>
     <swagger-ui.version>5.32.6</swagger-ui.version>
 
     <jquery-slimscroll.version>1.3.8</jquery-slimscroll.version>
@@ -2291,7 +2291,7 @@ under the License.
             <link>https://docs.spring.io/spring-framework/docs/6.2.x/javadoc-api/</link>
             <link>https://docs.spring.io/spring-security/site/docs/6.5.x/api/</link>
             <link>https://developer-docs.flowable.com/javadocs/flowable-oss-javadoc/2025.1/</link>
-            <link>https://docs.swagger.io/swagger-core/v2.2.50/apidocs/</link>
+            <link>https://docs.swagger.io/swagger-core/v2.2.51/apidocs/</link>
           </links>
           <additionalOptions>
             <additionalOption>--legal-notices</additionalOption>


(syncope) 04/06: Upgrading Spring Cloud Gateway

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 4d6908cf4cdefe59f652b4b4b94e714b295e5d2c
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Fri Jun 12 13:57:35 2026 +0200

    Upgrading Spring Cloud Gateway
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index bf11cdb3eb..5eec1bc8a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -436,7 +436,7 @@ under the License.
     <nimbus-jose-jwt.version>10.9.1</nimbus-jose-jwt.version>
 
     <spring-boot.version>3.5.15</spring-boot.version>
-    <spring-cloud-gateway.version>4.3.4</spring-cloud-gateway.version>
+    <spring-cloud-gateway.version>4.3.5</spring-cloud-gateway.version>
 
     <openjpa.version>4.1.1</openjpa.version>
 
@@ -1559,7 +1559,7 @@ under the License.
       <dependency>
         <groupId>org.springframework.cloud</groupId>
         <artifactId>spring-cloud-contract-wiremock</artifactId>
-        <version>4.3.3</version>
+        <version>4.3.4</version>
         <scope>test</scope>
       </dependency>
     </dependencies>


(syncope) 03/06: Cleanup

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 7590e00ce341b3c80437e87a3263d6edd3c91dcd
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Jun 11 12:46:53 2026 +0200

    Cleanup
---
 .../syncope/core/starter/SelfKeymasterContext.java |  2 +-
 .../security/AuthenticationAttemptThrottler.java   | 55 +++++--------------
 .../security/RateLimitAuthenticationException.java |  4 +-
 .../core/spring/security/WebSecurityContext.java   | 21 +++++---
 .../AuthenticationAttemptThrottlerTest.java        | 63 +++++++++++++---------
 .../SyncopeBasicAuthenticationEntryPointTest.java  |  6 +--
 6 files changed, 71 insertions(+), 80 deletions(-)

diff --git a/core/self-keymaster-starter/src/main/java/org/apache/syncope/core/starter/SelfKeymasterContext.java b/core/self-keymaster-starter/src/main/java/org/apache/syncope/core/starter/SelfKeymasterContext.java
index 135547e75d..6e45361604 100644
--- a/core/self-keymaster-starter/src/main/java/org/apache/syncope/core/starter/SelfKeymasterContext.java
+++ b/core/self-keymaster-starter/src/main/java/org/apache/syncope/core/starter/SelfKeymasterContext.java
@@ -225,7 +225,7 @@ public class SelfKeymasterContext {
             final UserProvisioningManager provisioningManager,
             final SecurityProperties securityProperties,
             final EncryptorManager encryptorManager,
-            @Qualifier(AuthenticationAttemptThrottler.CACHE_NAME)
+            @Qualifier(AuthenticationAttemptThrottler.CACHE)
             final Cache<String, AuthenticationAttemptThrottler.Attempts> authenticationAttemptCache,
             final KeymasterProperties keymasterProperties) {
 
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java
index 65f4d7c086..e552a70c3f 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottler.java
@@ -24,15 +24,10 @@ import java.util.Deque;
 import java.util.concurrent.TimeUnit;
 import java.util.function.LongSupplier;
 import javax.cache.Cache;
-import javax.cache.configuration.MutableConfiguration;
-import javax.cache.expiry.TouchedExpiryPolicy;
 import org.apache.commons.lang3.StringUtils;
 
 public class AuthenticationAttemptThrottler {
 
-    public static final String CACHE_NAME =
-            "org.apache.syncope.core.spring.security.AuthenticationAttemptThrottler";
-
     public record Attempts(Deque<Long> failures, long blockedUntil) implements Serializable {
 
         private static final long serialVersionUID = 8023582605543650484L;
@@ -46,9 +41,19 @@ public class AuthenticationAttemptThrottler {
         }
     }
 
+    public static final String CACHE = "AuthenticationAttemptCache";
+
+    protected static String key(final String domain, final String username) {
+        return StringUtils.defaultString(domain) + ':' + StringUtils.defaultString(username);
+    }
+
+    protected static long retryAfterSeconds(final long blockedUntil, final long now) {
+        return Math.max(1, TimeUnit.MILLISECONDS.toSeconds(blockedUntil - now));
+    }
+
     protected final SecurityProperties.AuthenticationThrottleProperties throttle;
 
-    protected final LongSupplier clock;
+    protected final LongSupplier clock = System::currentTimeMillis;
 
     protected final Cache<String, Attempts> attempts;
 
@@ -56,36 +61,10 @@ public class AuthenticationAttemptThrottler {
             final SecurityProperties securityProperties,
             final Cache<String, Attempts> attempts) {
 
-        this(securityProperties, System::currentTimeMillis, attempts);
-    }
-
-    protected AuthenticationAttemptThrottler(
-            final SecurityProperties securityProperties,
-            final LongSupplier clock,
-            final Cache<String, Attempts> attempts) {
-
         this.throttle = securityProperties.getAuthenticationThrottle();
-        this.clock = clock;
         this.attempts = attempts;
     }
 
-    public static MutableConfiguration<String, Attempts> cacheConfiguration(
-            final SecurityProperties.AuthenticationThrottleProperties throttle) {
-
-        return new MutableConfiguration<String, Attempts>().
-                setTypes(String.class, Attempts.class).
-                setExpiryPolicyFactory(TouchedExpiryPolicy.factoryOf(
-                        new javax.cache.expiry.Duration(TimeUnit.SECONDS, cacheExpirySeconds(throttle))));
-    }
-
-    protected static long cacheExpirySeconds(final SecurityProperties.AuthenticationThrottleProperties throttle) {
-        return Math.max(1, Math.max(throttle.getWindowSeconds(), throttle.getLockSeconds()));
-    }
-
-    protected static String key(final String domain, final String username) {
-        return StringUtils.defaultString(domain) + ':' + StringUtils.defaultString(username);
-    }
-
     public void checkAllowed(final String domain, final String username) {
         if (!isEnabled()) {
             return;
@@ -112,7 +91,7 @@ public class AuthenticationAttemptThrottler {
             return null;
         });
         if (retryAfter != null) {
-            throw blocked(retryAfter);
+            throw new RateLimitAuthenticationException(retryAfter);
         }
     }
 
@@ -150,7 +129,7 @@ public class AuthenticationAttemptThrottler {
             return null;
         });
         if (retryAfter != null) {
-            throw blocked(retryAfter);
+            throw new RateLimitAuthenticationException(retryAfter);
         }
     }
 
@@ -162,12 +141,4 @@ public class AuthenticationAttemptThrottler {
         }
         return failures;
     }
-
-    protected static long retryAfterSeconds(final long blockedUntil, final long now) {
-        return Math.max(1, TimeUnit.MILLISECONDS.toSeconds(blockedUntil - now));
-    }
-
-    protected static RateLimitAuthenticationException blocked(final long retryAfter) {
-        return new RateLimitAuthenticationException("Too many authentication failures", retryAfter);
-    }
 }
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/RateLimitAuthenticationException.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/RateLimitAuthenticationException.java
index a78888b4a2..1a69f9b0af 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/RateLimitAuthenticationException.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/RateLimitAuthenticationException.java
@@ -26,8 +26,8 @@ public class RateLimitAuthenticationException extends AuthenticationException {
 
     private final long retryAfterSeconds;
 
-    public RateLimitAuthenticationException(final String msg, final long retryAfterSeconds) {
-        super(msg);
+    public RateLimitAuthenticationException(final long retryAfterSeconds) {
+        super("Too many authentication failures");
         this.retryAfterSeconds = retryAfterSeconds;
     }
 
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/WebSecurityContext.java b/core/spring/src/main/java/org/apache/syncope/core/spring/security/WebSecurityContext.java
index 77bfdc8b66..bb948d0961 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/WebSecurityContext.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/WebSecurityContext.java
@@ -20,8 +20,12 @@ package org.apache.syncope.core.spring.security;
 
 import dev.samstevens.totp.code.CodeVerifier;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 import javax.cache.Cache;
 import javax.cache.CacheManager;
+import javax.cache.configuration.MutableConfiguration;
+import javax.cache.expiry.Duration;
+import javax.cache.expiry.TouchedExpiryPolicy;
 import org.apache.syncope.common.keymaster.client.api.ConfParamOps;
 import org.apache.syncope.common.keymaster.client.api.DomainOps;
 import org.apache.syncope.common.lib.types.IdRepoEntitlement;
@@ -130,7 +134,7 @@ public class WebSecurityContext {
             final UserProvisioningManager provisioningManager,
             final SecurityProperties securityProperties,
             final EncryptorManager encryptorManager,
-            @Qualifier(AuthenticationAttemptThrottler.CACHE_NAME)
+            @Qualifier(AuthenticationAttemptThrottler.CACHE)
             final Cache<String, AuthenticationAttemptThrottler.Attempts> authenticationAttemptCache) {
 
         return new UsernamePasswordAuthenticationProvider(
@@ -142,15 +146,20 @@ public class WebSecurityContext {
                 authenticationAttemptCache);
     }
 
-    @ConditionalOnMissingBean(name = AuthenticationAttemptThrottler.CACHE_NAME)
-    @Bean(name = AuthenticationAttemptThrottler.CACHE_NAME)
+    @ConditionalOnMissingBean(name = AuthenticationAttemptThrottler.CACHE)
+    @Bean(name = AuthenticationAttemptThrottler.CACHE)
     public Cache<String, AuthenticationAttemptThrottler.Attempts> authenticationAttemptCache(
             final CacheManager cacheManager,
             final SecurityProperties securityProperties) {
 
-        return cacheManager.createCache(
-                AuthenticationAttemptThrottler.CACHE_NAME,
-                AuthenticationAttemptThrottler.cacheConfiguration(securityProperties.getAuthenticationThrottle()));
+        return cacheManager.createCache(AuthenticationAttemptThrottler.CACHE,
+                new MutableConfiguration<String, AuthenticationAttemptThrottler.Attempts>().
+                        setTypes(String.class, AuthenticationAttemptThrottler.Attempts.class).
+                        setExpiryPolicyFactory(TouchedExpiryPolicy.factoryOf(new Duration(
+                                TimeUnit.SECONDS,
+                                Math.max(1, Math.max(
+                                        securityProperties.getAuthenticationThrottle().getWindowSeconds(),
+                                        securityProperties.getAuthenticationThrottle().getLockSeconds()))))));
     }
 
     @Bean
diff --git a/core/spring/src/test/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottlerTest.java b/core/spring/src/test/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottlerTest.java
index 3db75e9671..97eac45dd1 100644
--- a/core/spring/src/test/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottlerTest.java
+++ b/core/spring/src/test/java/org/apache/syncope/core/spring/security/AuthenticationAttemptThrottlerTest.java
@@ -21,14 +21,19 @@ package org.apache.syncope.core.spring.security;
 import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
-import java.util.UUID;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.LongSupplier;
 import javax.cache.Cache;
 import javax.cache.Caching;
+import javax.cache.configuration.MutableConfiguration;
+import javax.cache.expiry.Duration;
+import javax.cache.expiry.TouchedExpiryPolicy;
+import org.apache.syncope.common.lib.SyncopeConstants;
 import org.junit.jupiter.api.Test;
+import org.springframework.test.util.ReflectionTestUtils;
 
-public class AuthenticationAttemptThrottlerTest {
+class AuthenticationAttemptThrottlerTest {
 
     private static SecurityProperties securityProperties() {
         SecurityProperties securityProperties = new SecurityProperties();
@@ -43,55 +48,61 @@ public class AuthenticationAttemptThrottlerTest {
             final SecurityProperties securityProperties,
             final LongSupplier clock) {
 
-        Cache<String, AuthenticationAttemptThrottler.Attempts> authenticationAttemptCache =
-                Caching.getCachingProvider().getCacheManager().createCache(
-                        AuthenticationAttemptThrottlerTest.class.getName() + '-' + UUID.randomUUID(),
-                        AuthenticationAttemptThrottler.cacheConfiguration(
-                                securityProperties.getAuthenticationThrottle()));
+        Cache<String, AuthenticationAttemptThrottler.Attempts> cache =
+                Caching.getCachingProvider().getCacheManager().getCache(AuthenticationAttemptThrottler.CACHE);
+        if (cache == null) {
+            cache = Caching.getCachingProvider().getCacheManager().createCache(
+                    AuthenticationAttemptThrottler.CACHE,
+                    new MutableConfiguration<String, AuthenticationAttemptThrottler.Attempts>().
+                            setTypes(String.class, AuthenticationAttemptThrottler.Attempts.class).
+                            setExpiryPolicyFactory(
+                                    TouchedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, 30))));
+        } else {
+            cache.clear();
+        }
 
-        return new AuthenticationAttemptThrottler(securityProperties, clock, authenticationAttemptCache);
+        AuthenticationAttemptThrottler throttler = new AuthenticationAttemptThrottler(securityProperties, cache);
+        ReflectionTestUtils.setField(throttler, "clock", clock);
+        return throttler;
     }
 
     @Test
-    public void blocksAfterConfiguredFailures() {
+    void blocksAfterConfiguredFailures() {
         AtomicLong now = new AtomicLong();
         SecurityProperties securityProperties = securityProperties();
-        AuthenticationAttemptThrottler throttler =
-                throttler(securityProperties, now::get);
+        AuthenticationAttemptThrottler throttler = throttler(securityProperties, now::get);
 
         for (int i = 1; i < securityProperties.getAuthenticationThrottle().getMaxAttempts(); i++) {
-            assertDoesNotThrow(() -> throttler.recordFailure("Master", "rossini"));
+            assertDoesNotThrow(() -> throttler.recordFailure(SyncopeConstants.MASTER_DOMAIN, "rossini"));
         }
         assertThrows(RateLimitAuthenticationException.class,
-                () -> throttler.recordFailure("Master", "rossini"));
+                () -> throttler.recordFailure(SyncopeConstants.MASTER_DOMAIN, "rossini"));
         assertThrows(RateLimitAuthenticationException.class,
-                () -> throttler.checkAllowed("Master", "rossini"));
+                () -> throttler.checkAllowed(SyncopeConstants.MASTER_DOMAIN, "rossini"));
 
         now.addAndGet(30_000);
-        assertDoesNotThrow(() -> throttler.checkAllowed("Master", "rossini"));
+        assertDoesNotThrow(() -> throttler.checkAllowed(SyncopeConstants.MASTER_DOMAIN, "rossini"));
     }
 
     @Test
-    public void successResetsFailures() {
+    void successResetsFailures() {
         AtomicLong now = new AtomicLong();
-        AuthenticationAttemptThrottler throttler =
-                throttler(securityProperties(), now::get);
+        AuthenticationAttemptThrottler throttler = throttler(securityProperties(), now::get);
 
-        throttler.recordFailure("Master", "rossini");
-        throttler.clearFailures("Master", "rossini");
+        throttler.recordFailure(SyncopeConstants.MASTER_DOMAIN, "rossini");
+        throttler.clearFailures(SyncopeConstants.MASTER_DOMAIN, "rossini");
 
-        assertDoesNotThrow(() -> throttler.recordFailure("Master", "rossini"));
+        assertDoesNotThrow(() -> throttler.recordFailure(SyncopeConstants.MASTER_DOMAIN, "rossini"));
     }
 
     @Test
-    public void expiredFailuresAreIgnored() {
+    void expiredFailuresAreIgnored() {
         AtomicLong now = new AtomicLong();
-        AuthenticationAttemptThrottler throttler =
-                throttler(securityProperties(), now::get);
+        AuthenticationAttemptThrottler throttler = throttler(securityProperties(), now::get);
 
-        throttler.recordFailure("Master", "rossini");
+        throttler.recordFailure(SyncopeConstants.MASTER_DOMAIN, "rossini");
         now.addAndGet(61_000);
 
-        assertDoesNotThrow(() -> throttler.recordFailure("Master", "rossini"));
+        assertDoesNotThrow(() -> throttler.recordFailure(SyncopeConstants.MASTER_DOMAIN, "rossini"));
     }
 }
diff --git a/core/spring/src/test/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPointTest.java b/core/spring/src/test/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPointTest.java
index c7e6022069..7f34017eb8 100644
--- a/core/spring/src/test/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPointTest.java
+++ b/core/spring/src/test/java/org/apache/syncope/core/spring/security/SyncopeBasicAuthenticationEntryPointTest.java
@@ -27,17 +27,17 @@ import org.springframework.http.HttpStatus;
 import org.springframework.mock.web.MockHttpServletRequest;
 import org.springframework.mock.web.MockHttpServletResponse;
 
-public class SyncopeBasicAuthenticationEntryPointTest {
+class SyncopeBasicAuthenticationEntryPointTest {
 
     @Test
-    public void rateLimitAuthenticationExceptionReturnsTooManyRequests() throws Exception {
+    void rateLimitAuthenticationExceptionReturnsTooManyRequests() throws Exception {
         SyncopeBasicAuthenticationEntryPoint entryPoint = new SyncopeBasicAuthenticationEntryPoint();
         MockHttpServletResponse response = new MockHttpServletResponse();
 
         entryPoint.commence(
                 new MockHttpServletRequest(),
                 response,
-                new RateLimitAuthenticationException("Too many authentication failures", 30));
+                new RateLimitAuthenticationException(30));
 
         assertEquals(HttpStatus.TOO_MANY_REQUESTS.value(), response.getStatus());
         assertEquals("30", response.getHeader(HttpHeaders.RETRY_AFTER));


(syncope) 02/06: Upgrading AdminLTE

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit d16be80755ad81617b0e887069dc467d9b280bc3
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Jun 11 10:54:53 2026 +0200

    Upgrading AdminLTE
---
 .../org/apache/syncope/client/ui/commons/themes/js/adminlte.min.js      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/idrepo/common-ui/src/main/resources/org/apache/syncope/client/ui/commons/themes/js/adminlte.min.js b/client/idrepo/common-ui/src/main/resources/org/apache/syncope/client/ui/commons/themes/js/adminlte.min.js
index aecd8f89af..7518ce07f2 100644
--- a/client/idrepo/common-ui/src/main/resources/org/apache/syncope/client/ui/commons/themes/js/adminlte.min.js
+++ b/client/idrepo/common-ui/src/main/resources/org/apache/syncope/client/ui/commons/themes/js/adminlte.min.js
@@ -1,5 +1,5 @@
 /*!
- * AdminLTE v4.0.1 (https://adminlte.io)
+ * AdminLTE v4.0.2 (https://adminlte.io)
  * Copyright 2014-2026 Colorlib <https://colorlib.com>
  * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE)
  */


(syncope) 06/06: Fixing Neo4j

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 9c4d8609fdd140ff0eaa7bbf07dd22b0a752a011
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Fri Jun 12 13:33:13 2026 +0200

    Fixing Neo4j
---
 core/persistence-neo4j/pom.xml                               |  6 ++++++
 .../syncope/core/persistence/neo4j/PersistenceContext.java   |  3 ++-
 .../syncope/core/persistence/neo4j/dao/Neo4jTaskDAO.java     | 12 ++++++------
 fit/core-reference/pom.xml                                   |  6 ++++++
 4 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/core/persistence-neo4j/pom.xml b/core/persistence-neo4j/pom.xml
index 08817349c2..dc744c25c2 100644
--- a/core/persistence-neo4j/pom.xml
+++ b/core/persistence-neo4j/pom.xml
@@ -43,6 +43,12 @@ under the License.
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-data-neo4j</artifactId>
     </dependency>
+    <!-- keep until https://github.com/spring-projects/spring-data-commons/issues/3500 -->
+    <dependency>
+      <groupId>org.springframework.data</groupId>
+      <artifactId>spring-data-commons</artifactId>
+      <version>3.5.11</version>
+    </dependency>
 
     <dependency>
       <groupId>org.apache.syncope.core</groupId>
diff --git a/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/PersistenceContext.java b/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/PersistenceContext.java
index f260a5aa15..4f95ba6705 100644
--- a/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/PersistenceContext.java
+++ b/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/PersistenceContext.java
@@ -244,7 +244,8 @@ public class PersistenceContext {
     @ConditionalOnMissingBean
     @Bean
     public org.neo4j.cypherdsl.core.renderer.Configuration cypherDslConfiguration() {
-        return org.neo4j.cypherdsl.core.renderer.Configuration.newConfig().withDialect(Dialect.NEO4J_5).build();
+        return org.neo4j.cypherdsl.core.renderer.Configuration.newConfig().
+                withDialect(Dialect.NEO4J_5_DEFAULT_CYPHER).build();
     }
 
     @ConditionalOnMissingBean
diff --git a/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/Neo4jTaskDAO.java b/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/Neo4jTaskDAO.java
index 75576dd5c5..408c8e8e0d 100644
--- a/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/Neo4jTaskDAO.java
+++ b/core/persistence-neo4j/src/main/java/org/apache/syncope/core/persistence/neo4j/dao/Neo4jTaskDAO.java
@@ -270,7 +270,7 @@ public class Neo4jTaskDAO extends AbstractDAO implements TaskDAO {
 
         StringBuilder statement = new StringBuilder(" ORDER BY ");
         if (subStatement.length() == 0) {
-            statement.append("n.id DESC");
+            statement.append("p.id DESC");
         } else {
             subStatement.deleteCharAt(subStatement.length() - 1);
             statement.append(subStatement);
@@ -283,15 +283,15 @@ public class Neo4jTaskDAO extends AbstractDAO implements TaskDAO {
     @Override
     public <T extends Task<T>> List<T> findToExec(final TaskType type, final Pageable pageable) {
         TaskUtils taskUtils = taskUtilsFactory.getInstance(type);
-        StringBuilder query = new StringBuilder("MATCH (n:" + taskUtils.getTaskStorage() + ") WHERE ");
+        StringBuilder query = new StringBuilder("MATCH (p:" + taskUtils.getTaskStorage() + ") WHERE ");
 
         if (type == TaskType.NOTIFICATION) {
-            query.append("n.executed = false ");
+            query.append("p.executed = false ");
         } else {
-            query.append("(n)-[:").append(execRelationship(type)).append("]-() ");
+            query.append("(p)-[:").append(execRelationship(type)).append("]-() ");
         }
 
-        query.append("RETURN n.id ").append(toOrderByStatement(pageable.getSort().get()));
+        query.append("RETURN p.id ").append(toOrderByStatement(pageable.getSort().get()));
 
         if (pageable.isPaged()) {
             query.append(" SKIP ").append(pageable.getPageSize() * pageable.getPageNumber()).
@@ -299,7 +299,7 @@ public class Neo4jTaskDAO extends AbstractDAO implements TaskDAO {
         }
 
         return toList(neo4jClient.query(query.toString()).fetch().all(),
-                "n.id",
+                "p.id",
                 (Class<AbstractTask<?>>) taskUtils.getTaskEntity(),
                 null);
     }
diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml
index d2d91adc55..9129014a11 100644
--- a/fit/core-reference/pom.xml
+++ b/fit/core-reference/pom.xml
@@ -1111,6 +1111,12 @@ under the License.
           <artifactId>syncope-core-persistence-neo4j</artifactId>
           <version>${project.version}</version>
         </dependency>
+        <!-- keep until https://github.com/spring-projects/spring-data-commons/issues/3500 -->
+        <dependency>
+          <groupId>org.springframework.data</groupId>
+          <artifactId>spring-data-commons</artifactId>
+          <version>3.5.11</version>
+        </dependency>
       </dependencies>
 
       <build>