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

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


The following commit(s) were added to refs/heads/master by this push:
     new db551d63d6 [SYNCOPE-1890] Setting maxRetryAttempts for Syncope auth 
module (#1119)
db551d63d6 is described below

commit db551d63d62782b7278931034174e1debc0dc0a9
Author: alberto bogi <[email protected]>
AuthorDate: Tue Jul 1 11:43:21 2025 +0200

    [SYNCOPE-1890] Setting maxRetryAttempts for Syncope auth module (#1119)
    
    Co-authored-by: alberto bogi <[email protected]>
---
 .../apache/syncope/common/lib/auth/SyncopeAuthModuleConf.java  | 10 ++++++++++
 .../wa/bootstrap/mapping/AuthModulePropertySourceMapper.java   |  1 +
 2 files changed, 11 insertions(+)

diff --git 
a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SyncopeAuthModuleConf.java
 
b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SyncopeAuthModuleConf.java
index 6f565d974e..77ec530ce5 100644
--- 
a/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SyncopeAuthModuleConf.java
+++ 
b/common/am/lib/src/main/java/org/apache/syncope/common/lib/auth/SyncopeAuthModuleConf.java
@@ -39,6 +39,8 @@ public class SyncopeAuthModuleConf implements AuthModuleConf {
      */
     private String credentialCriteria;
 
+    private int maxRetryAttempts = 1;
+
     public String getDomain() {
         return domain;
     }
@@ -55,6 +57,14 @@ public class SyncopeAuthModuleConf implements AuthModuleConf 
{
         this.credentialCriteria = credentialCriteria;
     }
 
+    public int getMaxRetryAttempts() {
+        return maxRetryAttempts;
+    }
+
+    public void setMaxRetryAttempts(final int maxRetryAttempts) {
+        this.maxRetryAttempts = maxRetryAttempts;
+    }
+
     @Override
     public Map<String, Object> map(final AuthModuleTO authModule, final Mapper 
mapper) {
         return mapper.map(authModule, this);
diff --git 
a/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
 
b/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
index 0add168ac6..df1d4a1e07 100644
--- 
a/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
+++ 
b/wa/bootstrap/src/main/java/org/apache/syncope/wa/bootstrap/mapping/AuthModulePropertySourceMapper.java
@@ -392,6 +392,7 @@ public class AuthModulePropertySourceMapper extends 
PropertySourceMapper impleme
         props.setAttributeMappings(authModuleTO.getItems().stream().
                 collect(Collectors.toMap(Item::getIntAttrName, 
Item::getExtAttrName)));
         props.setCredentialCriteria(conf.getCredentialCriteria());
+        props.setMaxRetryAttempts(Math.max(conf.getMaxRetryAttempts(), 1));
 
         return prefix("cas.authn.syncope.", WAConfUtils.asMap(props));
     }

Reply via email to