jakartaee / jakartaee/servlet

Add a way to dynamycally register new Security Constraints

Open
#157 7 comments 0 reactions 1 assignee View on GitHub

@glassfishrobot is already working on this.

Since Jun 6, 2018.

Enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.