Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/782#discussion_r130148566
  
    --- Diff: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
 ---
    @@ -101,6 +105,14 @@
         @Context
         private UriInfo uriInfo;
     
    +    /**
    +     * Only lower-case letters and digits; min 10 chars; max 1024 chars.
    +     * 
    +     * We are this extreme because some existing entity implementations 
rely on the entity-id format 
    +     * for use in hostnames, etc.
    +     */
    +    private final Pattern appIdPattern = 
Pattern.compile("[a-z0-9]{10,1022}");
    --- End diff --
    
    Yeah, I don't like how restrictive it is - but wanted to play it safe 
(particularly given @neykov's observation about its use in cloud resource 
names, where we might not sanitize it).
    
    I also wanted to fail-fast, so wanted to do the check early. Pushing the 
check into `LocalEntityManager` makes sense. Would we repeat it here still, or 
just do it in that one place? I lean towards just the one place - we shouldn't 
be causing any side-effects in the code leading up to the id being used.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to