Skip to content

public url regex default#5491

Merged
joshmoore merged 2 commits intoome:developfrom
will-moore:public_url_regex_default
Sep 8, 2017
Merged

public url regex default#5491
joshmoore merged 2 commits intoome:developfrom
will-moore:public_url_regex_default

Conversation

@will-moore
Copy link
Copy Markdown
Member

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

  1. Set public user as on https://docs.openmicroscopy.org/omero/5.3.3/sysadmins/public.html#public-user without setting the url_filter.
  2. Should find that NO urls are publicly available (will get redirected to login page)
  3. Setting the url_filter to e.g. "^/(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

@will-moore will-moore changed the title public url regex default matches nothing public url regex default Sep 4, 2017
@jburel jburel added the develop label Sep 4, 2017
" 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."
Copy link
Copy Markdown
Member

@kennethgillen kennethgillen Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)?

Copy link
Copy Markdown
Member

@kennethgillen kennethgillen Sep 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a comment, such as: r'(?#This regular expression matches nothing)a^',
syntax cf http://www.regular-expressions.info/refadv.html

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Updated both.

@rgozim
Copy link
Copy Markdown
Member

rgozim commented Sep 7, 2017

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.

@joshmoore joshmoore merged commit 4a2c980 into ome:develop Sep 8, 2017
@joshmoore joshmoore deleted the public_url_regex_default branch September 8, 2017 07:16
@sbesson sbesson added this to the 5.4.0 milestone Oct 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants