Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shiroweb.urls does not support ordering of filters #7

Open
atomashpolskiy opened this issue Jun 6, 2017 · 3 comments
Open

shiroweb.urls does not support ordering of filters #7

atomashpolskiy opened this issue Jun 6, 2017 · 3 comments
Assignees

Comments

@atomashpolskiy
Copy link
Member

shiroweb.urls is a map, which means there's no way to hint Shiro in which order to perform path matching. This is effectively a show-stopper. Obvious fix would be to change this property to be a list. Or maybe some additional re-ordering of the key set can be done internally before filter mapping is passed to Shiro.

@andrus
Copy link
Contributor

andrus commented Jun 8, 2017

Good point. Somehow this has not popped up yet in the tests and early adopter projects. Will work on this.

@andrus andrus self-assigned this Jun 8, 2017
@andrus
Copy link
Contributor

andrus commented Jun 8, 2017

Just realized that YAML maps are deserialized into LinkedHashMaps by Jackson. So the ordering of map iterators is stable. Also if there are no contributions from multiple sources, the ordering will match exactly the ordering in YAML.

@andrus
Copy link
Contributor

andrus commented Jun 8, 2017

Here is a possible scheme for explicit ordering (e.g. in override maps) using optional references to other entries:

shiroweb:
  urls:
    # traditional default-ordered entry
    "/a/**" : anon
    # explicit relative ordering. Refers to a key from another YAML
    "/b/**" :
      chain: anon
      before: "/**"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants