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:29 UTC

[syncope] branch 2_1_X updated (f2502e9 -> 8f1054e)

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

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


    from f2502e9  [SYNCOPE-1531] Hide CSV export / import buttons for selection panels
     new d429f30  Upgrading Bootbox and asciidoctorj-pdf
     new 8f1054e  [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 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit d429f306dfb74fd5d43800ba12c8aeb4e5ebabc4
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 6eae620..a6354c4 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>
@@ -2586,7 +2586,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 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 8f1054e6bb131c38ae57d7f702350d741664671e
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 c250c47..320f038 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
@@ -73,7 +73,7 @@ public class RealmITCase extends AbstractITCase {
 
     @Test
     public void createUpdate() {
-        final RealmTO realm = new RealmTO();
+        RealmTO realm = new RealmTO();
         realm.setName("last");
 
         // 1. create
@@ -127,6 +127,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();