Add a way to dynamycally register new Security Constraints
@glassfishrobot is already working on this.
Since Jun 6, 2018.
- Dominant language
- Java
- Stars
- 325
- Forks
- 112
- PR merge metrics
- No merged PRs in 30d
Description
Servlets and Filters can be programmatically added and modified via ServletContextListener and ServletContainerInitializer. However AFAIK, there's no way to dynamically create a new Security Constraint based on a custom url, although you can add constraints to Servlets.
Use case: a set of navigation links loaded from an external source (e.g. a database), being served by a front controller (so Servlet constraint wouldn't be viable).
Current workaround is to do the authorization checks from a filter, but I'd prefer to delegate that work to the container instead.
I propose to add a method to ServletContext to register/modify web resource collections from inside ServletContextListener and ServletContainerInitializer.
This improvement could be a handy addition in companion with the new Security Spec.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.