public url regex default#5491
Conversation
| " navigate. The idea is that you can create the public pages" | ||
| " yourself (see OMERO.web framework since we do not provide public" | ||
| " pages.")], | ||
| ("Set a filter for URLS which the public user is allowed to access." |
There was a problem hiding this comment.
Is it worth stating that this is a regular expression? e.g. "Set a regular expression for URLs". filter could be some custom syntax, whereas calling it a regular expression tells the user the syntax which is expected in the string. Or do all Python devs know that the wee r at the start of the string signifies a regex (if indeed it does?)?
There was a problem hiding this comment.
Perhaps a comment, such as: r'(?#This regular expression matches nothing)a^',
syntax cf http://www.regular-expressions.info/refadv.html
|
With a public user set, I tested a number of URLs from my history and they were all redirected back to the login page, as intended. I also tested the 'a^' regex on a couple of online regex tools and there were no issues. Seems good to me. |
What this PR does
Updates the public url_filter default value so that it matches nothing.
This means users will need to set this, instead of relying on the default value.
Testing this PR
url_filter."^/(webgateway)"should still work OK.Related reading
See discussion at #5315 about
/api/urls being available with the default url_filter setting.The "regex that matches nothing" in this PR came from: https://stackoverflow.com/questions/940822/regular-expression-syntax-for-match-nothing for