You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2020/02/20 11:37:46 UTC

[sling-org-apache-sling-repoinit-parser] branch master updated: SLING-8757 - disable comma-separated lists in home() function as it's not supported downstream

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

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git


The following commit(s) were added to refs/heads/master by this push:
     new f6d7255  SLING-8757 - disable comma-separated lists in home() function as it's not supported downstream
f6d7255 is described below

commit f6d72556f9004fdabcd7e258c344d178b5fb4ff0
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Feb 20 12:37:26 2020 +0100

    SLING-8757 - disable comma-separated lists in home() function as it's not supported downstream
---
 src/main/javacc/RepoInitGrammar.jjt                               | 3 ++-
 .../org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java  | 2 ++
 src/test/resources/testcases/test-34-output.txt                   | 8 ++++----
 src/test/resources/testcases/test-34.txt                          | 8 ++++----
 src/test/resources/testcases/test-99-output.txt                   | 4 ++--
 src/test/resources/testcases/test-99.txt                          | 4 ++--
 6 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/src/main/javacc/RepoInitGrammar.jjt b/src/main/javacc/RepoInitGrammar.jjt
index bda1db2..23d9662 100644
--- a/src/main/javacc/RepoInitGrammar.jjt
+++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -221,7 +221,8 @@ String usernameList() :
 }
 {
     ( t = <STRING> ) { names.add(t.image); }
-    ( <COMMA> t = <STRING> { names.add(t.image); }) *
+    // disable lists for now, not supported downstream
+    // ( <COMMA> t = <STRING> { names.add(t.image); }) *
 
     {
         return String.join(",", names);
diff --git a/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
index cb8ba9e..fd70828 100644
--- a/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
+++ b/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java
@@ -92,6 +92,8 @@ public class ParsingErrorsTest {
             add(new Object[] { "set ACL on one(name)two(onlyOneFunctionAllowed) \n remove * for u \n end", ParseException.class });
             add(new Object[] { "set ACL on home(alice:colonNotAllowed) \n remove * for u \n end", ParseException.class });
             add(new Object[] { "set ACL on home(alice#hashNotAllowed) \n remove * for u \n end", ParseException.class });
+            add(new Object[] { "set ACL on home(alice,commaNotAllowed) \n remove * for u \n end", ParseException.class });
+            add(new Object[] { "set ACL on home(alice,comma,not,allowed) \n remove * for u \n end", ParseException.class });
         }};
         return result;
     }
diff --git a/src/test/resources/testcases/test-34-output.txt b/src/test/resources/testcases/test-34-output.txt
index 63787b2..08eb8c3 100644
--- a/src/test/resources/testcases/test-34-output.txt
+++ b/src/test/resources/testcases/test-34-output.txt
@@ -4,11 +4,11 @@ SetAclPaths on :home:jack# /tmp/a :functionNamesAreFree:bobby#
   AclLine ALLOW {principals=[alice], privileges=[jcr:two]}
 SetAclPrincipals for fred 
   AclLine ALLOW {paths=[/one, :home:Alice123#, /tmp], privileges=[jcr:three]}
-SetAclPaths on /a/b :home:jack,jill# /tmp/a :square:bobby# 
+SetAclPaths on /a/b :home:jack# /tmp/a :square:bobby# 
   AclLine ALLOW {principals=[alice], privileges=[jcr:four]}
 SetAclPrincipals for austin 
-  AclLine ALLOW {paths=[/one, :home:Alice123,11bob42#, /tmp], privileges=[jcr:five]}
-SetAclPaths on :home:spaces,are,ok# 
+  AclLine ALLOW {paths=[/one, :home:Alice123#, /tmp], privileges=[jcr:five]}
+SetAclPaths on :home:spacesAreOk# 
   AclLine ALLOW {principals=[spaceman], privileges=[jcr:six]}
-SetAclPaths on :home:alice,bob#/sub/folder /anotherPath :home:fred#/root 
+SetAclPaths on :home:alice#/sub/folder /anotherPath :home:fred#/root 
   AclLine ALLOW {principals=[mercury], privileges=[jcr:seven]}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-34.txt b/src/test/resources/testcases/test-34.txt
index 41dc2f3..dff0343 100644
--- a/src/test/resources/testcases/test-34.txt
+++ b/src/test/resources/testcases/test-34.txt
@@ -12,18 +12,18 @@ set ACL for fred
   allow jcr:three on /one,home(Alice123),/tmp
 end
 
-set ACL on /a/b,home(jack,jill),/tmp/a,square(bobby)
+set ACL on /a/b,home(jack),/tmp/a,square(bobby)
   allow jcr:four for alice
 end
 
 set ACL for austin
-  allow jcr:five on /one,home(Alice123,11bob42),/tmp
+  allow jcr:five on /one,home(Alice123),/tmp
 end
 
-set ACL on home(spaces,  are,   ok)
+set ACL on home(  spacesAreOk )
   allow jcr:six for spaceman
 end
 
-set ACL on home(alice, bob)/sub/folder, /anotherPath, home(fred)/root
+set ACL on home(alice)/sub/folder, /anotherPath, home(fred)/root
   allow jcr:seven for mercury
 end
diff --git a/src/test/resources/testcases/test-99-output.txt b/src/test/resources/testcases/test-99-output.txt
index f23f2fd..a556865 100644
--- a/src/test/resources/testcases/test-99-output.txt
+++ b/src/test/resources/testcases/test-99-output.txt
@@ -50,6 +50,6 @@ DeleteGroup since124_C
 SetAclPaths on :home:alice# 
   AclLine ALLOW {principals=[alice, bob, carol], privileges=[jcr:one]}
 SetAclPrincipals for bob 
-  AclLine ALLOW {paths=[:home:alice,fredTheSecond,markTheThird#, /another/path, :home:larry#], privileges=[jcr:two]}
-SetAclPaths on :home:alice,bob#/sub/folder/of/their/homes 
+  AclLine ALLOW {paths=[:home:alice#, /another/path, :home:larry#], privileges=[jcr:two]}
+SetAclPaths on :home:alice#/sub/folder/of/their/homes 
   AclLine ALLOW {principals=[fred], privileges=[jcr:three]}  
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-99.txt b/src/test/resources/testcases/test-99.txt
index 08d71eb..5863fb0 100644
--- a/src/test/resources/testcases/test-99.txt
+++ b/src/test/resources/testcases/test-99.txt
@@ -90,9 +90,9 @@ set ACL on home(alice)
 end
 
 set ACL for bob
-  allow jcr:two on home(alice, fredTheSecond, markTheThird), /another/path, home(larry)
+  allow jcr:two on home(alice), /another/path, home(larry)
 end  
 
-set ACL on home(alice,bob)/sub/folder/of/their/homes
+set ACL on home(alice)/sub/folder/of/their/homes
   allow jcr:three for fred
 end