You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/06/17 14:43:16 UTC

[Bug 59716] New: Allow JNDI configuration of CorsFilter

https://bz.apache.org/bugzilla/show_bug.cgi?id=59716

            Bug ID: 59716
           Summary: Allow JNDI configuration of CorsFilter
           Product: Tomcat 7
           Version: 7.0.69
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: lucastheisen@apache.org

Created attachment 33957
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33957&action=edit
Source code for the delegating filter and integration test.

Currently the CorsFilter is configured by init-param's.  This makes
configuration compile time (as it would be stored in the deployment artifact). 
In my experience, CORS configuration is environmental (I have a different set
of allowed origins based on where I deploy my app: dev/qa/production), and as
such should be runtime.  Pushing config to JNDI (or at least allowing override
in JNDI) allows you to configure the same artifact differently depending on
environment.  I have written a filter that delegates to the CorsFilter to allow
for JNDI config (which i will attach), but it would be quite simple and useful
to move this functionality into the core filter.  I would be willing to patch
the filter as well if you are interested in this approach...

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59716] Allow JNDI configuration of CorsFilter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59716

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All
           Severity|normal                      |enhancement

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Moving to an enhancement request.

Tomcat typically handles this via property replacement [1].

[1] http://tomcat.apache.org/tomcat-9.0-doc/config/index.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59716] Allow JNDI configuration of CorsFilter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59716

--- Comment #2 from Lucas Theisen <lu...@apache.org> ---
Fair enough...  I just find it easier to have all my application config in one
place (GlobalNamingResources), rather than multiple (setenv.sh and
GlobalNamingResources).  In any case, your suggestion would satisfy my
requirement to have a single build be configurable differently per environment,
so feel free to close this ticket.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59716] Allow JNDI configuration of CorsFilter

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59716

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Closing this ticket as per the OP's comment. It is also worth noting that Java
EE allows the injection of values from JNDI into Servlets, Filters etc. See
section 5 of the Java EE 8 spec.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org