You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/05/14 17:37:11 UTC

[GitHub] dubee closed pull request #3644: Allow more special characters in EntityName.

dubee closed pull request #3644: Allow more special characters in EntityName.
URL: https://github.com/apache/incubator-openwhisk/pull/3644
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/common/scala/src/main/scala/whisk/core/entity/EntityPath.scala b/common/scala/src/main/scala/whisk/core/entity/EntityPath.scala
index c4836c3881..0262f10cad 100644
--- a/common/scala/src/main/scala/whisk/core/entity/EntityPath.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/EntityPath.scala
@@ -192,10 +192,10 @@ protected[core] object EntityName {
 
   /**
    * Allowed path part or entity name format (excludes path separator): first character
-   * is a letter|digit|underscore, followed by one or more allowed characters in [\w@ .-].
+   * is a letter|digit|underscore, followed by one or more allowed characters in [\w@ .&-].
    * The name may not have trailing white space.
    */
-  protected[core] val REGEX = raw"\A([\w]|[\w][\w@ .-]{0,${ENTITY_NAME_MAX_LENGTH - 2}}[\w@.-])\z"
+  protected[core] val REGEX = raw"\A([\w]|[\w][\w@ .&-]{0,${ENTITY_NAME_MAX_LENGTH - 2}}[\w@.&-])\z"
   private val entityNamePattern = REGEX.r.pattern // compile once
   protected[core] def entityNameMatcher(s: String): Matcher = entityNamePattern.matcher(s)
 
diff --git a/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala b/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala
index 99fe13121c..6ee2b24d64 100644
--- a/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala
+++ b/tests/src/test/scala/whisk/core/entity/test/SchemaTests.scala
@@ -235,14 +235,15 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat
     val paths = Seq(
       "a",
       "a b",
-      "a@b.c",
+      "a@b.c&d",
+      "a@&b",
       "_a",
       "_",
       "_ _",
       "a0",
       "a 0",
       "a.0",
-      "a@@",
+      "a@@&",
       "0",
       "0.0",
       "0.0.0",
@@ -265,9 +266,17 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with ExecHelpers with Mat
       " /",
       "/ ",
       "0 ",
+      "a=2b",
       "_ ",
+      "a?b",
+      "x#x",
+      "a§b",
       "a  ",
+      "a()b",
+      "a{}b",
       "a \t",
+      "-abc",
+      "&abc",
       "a\n",
       "a" * (EntityName.ENTITY_NAME_MAX_LENGTH + 1))
     paths.foreach { p =>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services