rmannibucau commented on pull request #399:
URL: https://github.com/apache/tomcat/pull/399#issuecomment-751987522


   @arjantijms I see, my point is that the facade is about preventing the user 
to access the internals (request here) or any API not from the spec so I don't 
think it should be broken. It is done for all servlet code (look for all 
*Facade instances) and it generally prevents to access any internal from a spec 
code (you see it the other way for your case but it is designed the other way). 
I see a few options to help - there are probably more:
   
   1. Add an "app valve" in tomcat code, it would reuse tomcat reflection 
factory to instantiate lazily - when app loader exists - a valve. it is close 
to 
https://github.com/apache/tomee/blob/master/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/valve/LazyValve.java
 but only using tomcat internal. It enables you to write a valve in your war 
without tomcat tuning. Similar solution would enable a valve to fail to be 
created from the context.xml but it would be retried when the app loader exists 
(I prefer previous option which is clearer on when it must work). I know it is 
not tomcat habit to enable internals from the app but I agree it is not 
uncommon so having some wrappers enabling it can help - tomee also has the real 
wrapper since you mentionned it.
   2. Use reflection as several other integrators
   3. Drop jaspic from tomcat and use plain servlet filters (big +1 from me 
since it would also make jaspic optional for tomcat embed)
   4. Use GenericPrincipal (or TomcatPrincipal/ a new JaspicWrappingPrincipal) 
to host the subject instead of a note
   5. add in base authenticator an attribute to set it in a request attribute 
too (likely the easiest)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to