syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: Fixing issue with migration from RandomStringUtils to RandomStringGenerator
Date Mon, 19 Jun 2017 15:52:53 GMT
Fixing issue with migration from RandomStringUtils to RandomStringGenerator


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/335cfdab
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/335cfdab
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/335cfdab

Branch: refs/heads/master
Commit: 335cfdab3028cb1ec74a6918252fb6c6db811273
Parents: d611e65
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Mon Jun 19 17:52:18 2017 +0200
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Mon Jun 19 17:52:41 2017 +0200

----------------------------------------------------------------------
 .../syncope/client/enduser/resources/CaptchaResource.java       | 3 +--
 .../apache/syncope/core/spring/security/SecureRandomUtils.java  | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/335cfdab/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
index a514498..e60a532 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/CaptchaResource.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.client.enduser.resources;
 
 import javax.servlet.http.HttpServletRequest;
-import org.apache.commons.text.CharacterPredicates;
 import org.apache.commons.text.RandomStringGenerator;
 import org.apache.syncope.client.enduser.SyncopeEnduserConstants;
 import org.apache.syncope.common.lib.SecureTextRandomProvider;
@@ -36,7 +35,7 @@ public class CaptchaResource extends CaptchaImageResource {
 
     private static final RandomStringGenerator RANDOM_LETTERS = new RandomStringGenerator.Builder().
             usingRandom(new SecureTextRandomProvider()).
-            filteredBy(CharacterPredicates.LETTERS).
+            withinRange('a', 'z').
             build();
 
     @Override

http://git-wip-us.apache.org/repos/asf/syncope/blob/335cfdab/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
----------------------------------------------------------------------
diff --git a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
index 9fe8cb3..0e9e0ff 100644
--- a/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
+++ b/core/spring/src/main/java/org/apache/syncope/core/spring/security/SecureRandomUtils.java
@@ -19,7 +19,6 @@
 package org.apache.syncope.core.spring.security;
 
 import org.apache.commons.text.CharacterPredicate;
-import org.apache.commons.text.CharacterPredicates;
 import org.apache.commons.text.RandomStringGenerator;
 import org.apache.syncope.common.lib.SecureTextRandomProvider;
 
@@ -31,12 +30,12 @@ public final class SecureRandomUtils {
 
     private static final RandomStringGenerator FOR_LETTERS = new RandomStringGenerator.Builder().
             usingRandom(new SecureTextRandomProvider()).
-            filteredBy(CharacterPredicates.LETTERS).
+            withinRange('a', 'z').
             build();
 
     private static final RandomStringGenerator FOR_NUMBERS = new RandomStringGenerator.Builder().
             usingRandom(new SecureTextRandomProvider()).
-            filteredBy(CharacterPredicates.LETTERS).
+            withinRange('0', '9').
             build();
 
     public static String generateRandomPassword(final int tokenLength) {


Mime
View raw message