Filter configs cannot contain commas in INI format

Details

Description

Consider this configuration:

[urls]
/test/** = roles[guest, admin]

The above won't work at the moment because PathMatchingFilter splits the right-hand value into 'roles[guest' and 'admin]'. Commas inside square brackets should be ignored when splitting the path value.

Activity

My proposed fix involves specifying '[' as the starting quote and ']'
as the end quote when using Shiro's split() method. One side-effect of
this approach is that " is no longer considered a quote character. Is
that OK? Do quote characters have any special meaning in filter chain
definitions?

Peter Ledbrook
added a comment - 24/Oct/10 14:56
My proposed fix involves specifying ' [' as the starting quote and '] '
as the end quote when using Shiro's split() method. One side-effect of
this approach is that " is no longer considered a quote character. Is
that OK? Do quote characters have any special meaning in filter chain
definitions?
Thanks,
Peter

I think that's a valid solution. But I'm amazed it didn't work already by using quotes inside the brackets. I thought that was documented in http://shiro.apache.org/web.html that you had to quote commas, but it doesn't look like it.

Les Hazlewood
added a comment - 25/Oct/10 19:29 Hi Peter,
I think that's a valid solution. But I'm amazed it didn't work already by using quotes inside the brackets. I thought that was documented in http://shiro.apache.org/web.html that you had to quote commas, but it doesn't look like it.
Can you try:
[urls]
/test/** = roles ["guest, admin"]
and see if that works?

That probably does work, but I didn't know whether double-quotes was the appropriate solution or not. If it is, then I'll revert my local change because it breaks the quoting. Seems odd to require quotes (from a user perspective) since you already have the '[' and ']' delimiters.

Peter Ledbrook
added a comment - 26/Oct/10 17:00 That probably does work, but I didn't know whether double-quotes was the appropriate solution or not. If it is, then I'll revert my local change because it breaks the quoting. Seems odd to require quotes (from a user perspective) since you already have the ' [' and '] ' delimiters.