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 2020/01/14 08:38:33 UTC

[syncope] branch master updated (77185ee -> 6c9fc67)

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

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


    from 77185ee  [SYNCOPE-1531] Hide CSV export / import buttons for selection panels
     new 3b4755e  Upgrading Bootbox and asciidoctorj-pdf
     new 6c9fc67  [SYNCOPE-1532] Extending the set of allowed characters for Realms name and path

The 2 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:
 .../apache/syncope/core/persistence/api/dao/RealmDAO.java |  4 +++-
 .../persistence/jpa/validation/entity/RealmValidator.java |  6 ++----
 .../java/org/apache/syncope/fit/core/RealmITCase.java     | 15 ++++++++++++++-
 pom.xml                                                   |  4 ++--
 4 files changed, 21 insertions(+), 8 deletions(-)


[syncope] 01/02: Upgrading Bootbox and asciidoctorj-pdf

Posted by il...@apache.org.
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

commit 3b4755e5f5640ef0debe371ff11700686138d7b0
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Jan 14 08:32:30 2020 +0100

    Upgrading Bootbox and asciidoctorj-pdf
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index ec2cb8a..23b31b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -471,7 +471,7 @@ under the License.
     <bootstrap.version>3.4.1</bootstrap.version>
     <bootstrap-select.version>1.12.4</bootstrap-select.version>
     <bootstrap-fileinput.version>4.4.8</bootstrap-fileinput.version>
-    <bootbox.version>4.4.0</bootbox.version>
+    <bootbox.version>5.4.0</bootbox.version>
     <font-awesome.version>4.7.0</font-awesome.version>
     <font-awesome.filename>font-awesome.min.css</font-awesome.filename>
     <ionicons.version>2.0.1</ionicons.version>
@@ -2542,7 +2542,7 @@ under the License.
               <dependency>
                 <groupId>org.asciidoctor</groupId>
                 <artifactId>asciidoctorj-pdf</artifactId>
-                <version>1.5.0-rc.1</version>
+                <version>1.5.0-rc.2</version>
               </dependency>
             </dependencies>
             <configuration>


[syncope] 02/02: [SYNCOPE-1532] Extending the set of allowed characters for Realms name and path

Posted by il...@apache.org.
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

commit 6c9fc678f121dae659073f27636e2efa0e3ca70f
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Tue Jan 14 09:37:47 2020 +0100

    [SYNCOPE-1532] Extending the set of allowed characters for Realms name and path
---
 .../apache/syncope/core/persistence/api/dao/RealmDAO.java |  4 +++-
 .../persistence/jpa/validation/entity/RealmValidator.java |  6 ++----
 .../java/org/apache/syncope/fit/core/RealmITCase.java     | 15 ++++++++++++++-
 3 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
index 42ba819..800b493 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
@@ -27,7 +27,9 @@ import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
 
 public interface RealmDAO extends DAO<Realm> {
 
-    Pattern PATH_PATTERN = Pattern.compile("^(/[A-Za-z0-9]+)+");
+    Pattern NAME_PATTERN = Pattern.compile("^[A-Za-z0-9~]+");
+
+    Pattern PATH_PATTERN = Pattern.compile("^(/[A-Za-z0-9~]+)+");
 
     Realm getRoot();
 
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/RealmValidator.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/RealmValidator.java
index 7a05ea8..a4d51f1 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/RealmValidator.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/RealmValidator.java
@@ -18,16 +18,14 @@
  */
 package org.apache.syncope.core.persistence.jpa.validation.entity;
 
-import java.util.regex.Pattern;
 import javax.validation.ConstraintValidatorContext;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.types.EntityViolationType;
+import org.apache.syncope.core.persistence.api.dao.RealmDAO;
 import org.apache.syncope.core.persistence.api.entity.Realm;
 
 public class RealmValidator extends AbstractValidator<RealmCheck, Realm> {
 
-    private static final Pattern REALM_NAME_PATTERN = Pattern.compile("^[A-Za-z0-9]+");
-
     @Override
     public boolean isValid(final Realm realm, final ConstraintValidatorContext context) {
         context.disableDefaultConstraintViolation();
@@ -51,7 +49,7 @@ public class RealmValidator extends AbstractValidator<RealmCheck, Realm> {
                         addPropertyNode("parent").addConstraintViolation();
             }
 
-            if (!REALM_NAME_PATTERN.matcher(realm.getName()).matches()) {
+            if (!RealmDAO.NAME_PATTERN.matcher(realm.getName()).matches()) {
                 isValid = false;
 
                 context.buildConstraintViolationWithTemplate(
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
index e1cf3f0..134e0bb 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
@@ -72,7 +72,7 @@ public class RealmITCase extends AbstractITCase {
 
     @Test
     public void createUpdate() {
-        final RealmTO realm = new RealmTO();
+        RealmTO realm = new RealmTO();
         realm.setName("last");
 
         // 1. create
@@ -126,6 +126,19 @@ public class RealmITCase extends AbstractITCase {
     }
 
     @Test
+    public void createWithTilde() {
+        RealmTO realm = new RealmTO();
+        realm.setName("73~1~19534");
+
+        Response response = realmService.create("/even/two", realm);
+        assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
+
+        List<RealmTO> realms = realmService.list("/even/two/73~1~19534");
+        assertEquals(1, realms.size());
+        assertEquals(realm.getName(), realms.get(0).getName());
+    }
+
+    @Test
     public void deletingAccountPolicy() {
         // 1. create account policy
         DefaultAccountRuleConf ruleConf = new DefaultAccountRuleConf();