You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shiro.apache.org by GitBox <gi...@apache.org> on 2020/08/26 18:55:58 UTC

[GitHub] [shiro] ricardolsmendes opened a new pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

ricardolsmendes opened a new pull request #255:
URL: https://github.com/apache/shiro/pull/255


   This PR closes [SHIRO-792](https://issues.apache.org/jira/browse/SHIRO-792). As agreed in the issue discussion, it only adds a `name` element to the `@ConditionalOnMissingBean` annotation of `org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration.filterShiroFilterRegistrationBean()`.
   
   Following this checklist to help us incorporate your contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SHIRO) filed 
          for the change (usually before you start working on it).  Trivial changes like typos do not 
          require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line and body.
    - [x] Format the pull request title like `[SHIRO-XXX] - Fixes bug in SessionManager`,
          where you replace `SHIRO-XXX` with the appropriate JIRA issue. Best practice
          is to use the JIRA issue title in the pull request title and in the first line of the commit message.
    - [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [x] Run `mvn clean install apache-rat:check` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If you have a group of commits related to the same change, please squash your commits into one and force push your branch using `git rebase -i`. N/A
    
   Trivial changes like typos do not require a JIRA issue (javadoc, comments...). 
   In this case, just format the pull request title like `(DOC) - Add javadoc in SessionManager`.
    
   If this is your first contribution, you have to read the [Contribution Guidelines](https://github.com/apache/shiro/blob/master/CONTRIBUTING.md)
   
   If your pull request is about ~20 lines of code you don't need to sign an [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) 
   if you are unsure please ask on the developers list.
   
   To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
    - [x] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-682075540


   Hi @bdemers!
   I didn't face any issues after this change in my development environment. I'm using other _Spring Boot Starters_ and get the following filters registered: `2020-08-27 13:48:05.679 DEBUG  235 --- [  restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: filterRegistrationBean urls=[/*] order=1, logoutFilter urls=[/security/logout] order=2147483647, javamelody urls=[/*] order=2147483647, OCPsoft Rewrite Filter urls=[/*] order=2147483647, characterEncodingFilter urls=[/*] order=-2147483648`.
   
   Just a final question: should we leverage this change to also set the filter name? Adding something similar to `registrationBean.setName("shiroFilter");` to `filterShiroFilterRegistrationBean()` would make it easier for users to identify the Shiro Filter in debug logs. By doing this, the above output log would become `2020-08-27 13:48:05.679 DEBUG  235 --- [  restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: shiroFilter urls=[/*] order=1, logoutFilter urls=[/security/logout] order=2147483647, javamelody urls=[/*] order=2147483647, OCPsoft Rewrite Filter urls=[/*] order=2147483647, characterEncodingFilter urls=[/*] order=-2147483648`. Please notice the change in the first filter name: `filterRegistrationBean` to `shiroFilter`. WDYT? 🤔 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] fpapon commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
fpapon commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-686705439


   I merge and I will cherry-pick on master.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes edited a comment on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes edited a comment on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-682075540


   Hi @bdemers!
   I didn't face any issues after this change in my development environment. I'm using other _Spring Boot Starters_ and get the following filters registered: `2020-08-27 13:48:05.679 DEBUG  235 --- [  restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: filterRegistrationBean urls=[/*] order=1, logoutFilter urls=[/security/logout] order=2147483647, javamelody urls=[/*] order=2147483647, OCPsoft Rewrite Filter urls=[/*] order=2147483647, characterEncodingFilter urls=[/*] order=-2147483648` (I suppressed some fillters from the actual log for security/readability reasons...).
   
   Just a final question: should we leverage this change to also set the filter name? Adding something similar to `registrationBean.setName("shiroFilter");` to `filterShiroFilterRegistrationBean()` would make it easier for users to identify the Shiro Filter in debug logs. By doing this, the above output log would become `2020-08-27 13:48:05.679 DEBUG  235 --- [  restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: shiroFilter urls=[/*] order=1, logoutFilter urls=[/security/logout] order=2147483647, javamelody urls=[/*] order=2147483647, OCPsoft Rewrite Filter urls=[/*] order=2147483647, characterEncodingFilter urls=[/*] order=-2147483648`. Please notice the change in the first filter name: `filterRegistrationBean` to `shiroFilter`. WDYT? 🤔 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-682104402


   Yeah, agree with you. I'll add that line then.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes edited a comment on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes edited a comment on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-682075540


   Hi @bdemers!
   I didn't face any issues after this change in my development environment. I'm using other _Spring Boot Starters_ and get the following filters registered: 
   
   ```txt
   2020-08-27 13:48:05.679 DEBUG  235 --- [  restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: filterRegistrationBean urls=[/*] order=1, logoutFilter urls=[/security/logout] order=2147483647, javamelody urls=[/*] order=2147483647, OCPsoft Rewrite Filter urls=[/*] order=2147483647, characterEncodingFilter urls=[/*] order=-2147483648
   ```
   (I suppressed some fillters from the actual log for security/readability reasons...).
   
   Just a final question: should we leverage this change to also set the filter name? Adding something similar to `registrationBean.setName("shiroFilter");` to `filterShiroFilterRegistrationBean()` would make it easier for users to identify the Shiro Filter in debug logs. By doing this, the above output log would become 
   
   ```txt
   2020-08-27 13:48:05.679 DEBUG  235 --- [  restartedMain] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: shiroFilter urls=[/*] order=1, logoutFilter urls=[/security/logout] order=2147483647, javamelody urls=[/*] order=2147483647, OCPsoft Rewrite Filter urls=[/*] order=2147483647, characterEncodingFilter urls=[/*] order=-2147483648
   ```
   Please notice the change in the first filter name: `filterRegistrationBean` to `shiroFilter`. WDYT? 🤔 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-686084753


   I don't think the test is flacky, it has been failing for all commits since I created this PR. But looking at the logs, I agree the failure doesn't seem to be related to the changes proposed here.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-685171907


   Hey @bdemers, done!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] fpapon commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
fpapon commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-685965120


   I checked in Jenkins and I don't think the error is related to the changes. The jdk8 build is ok but the jdk11 build failed.
   I re-launched the jdk11 build to see if the test is flacky.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] bdemers commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
bdemers commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-682102173


   @ricardolsmendes that sounds like a great idea to me 😄
   It's possible that could cause an issue if someone is looking up filters by name, but we can include a note in the release about that.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] fpapon commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
fpapon commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-682172426


   @bdemers @bmhm The JIRA is tag with 2.0.0 and 1.6.1 but the merge is on 1.6.x branch. We should merge on master too.
   Thoughts?


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] fpapon merged pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
fpapon merged pull request #255:
URL: https://github.com/apache/shiro/pull/255


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] bdemers commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
bdemers commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-685112871


   @ricardolsmendes that is a good idea!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-681069295


   Hey @bdemers, could you please take a look at this PR? Thanks!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] fpapon commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
fpapon commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-686283563


   We have some failing tests with some jdk vendors for java 11, but for the branch 1.6.x jdk8 is enough.
   @bdemers We can merge this PR.
   @ricardolsmendes thanks for your contribution!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] ricardolsmendes commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
ricardolsmendes commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-684077937


   Hi @bdemers,
   Since `FilterRegistrationBean` is a raw type, should we leverage this change and also change `filterShiroFilterRegistrationBean()` to return the generic type `FilterRegistrationBean<AbstractShiroFilter>`?
   I can improve the code a bit if you are ok with this.
   Best,


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] bdemers commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
bdemers commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-681992748


   Thanks @ricardolsmendes !
   
   Any other issues in your app after these changes? (if not we will get this into the next release) And backporting to 2.x will be trivial, so we will take care of that too 


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [shiro] bdemers commented on pull request #255: [SHIRO-792] Add name to ShiroFilter's @ConditionalOnMissingBean

Posted by GitBox <gi...@apache.org>.
bdemers commented on pull request #255:
URL: https://github.com/apache/shiro/pull/255#issuecomment-685960458


   There is a test error, but I don't think that is related to this change.  I'll take a look


----------------------------------------------------------------
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:
users@infra.apache.org