You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2021/07/21 12:09:01 UTC

[GitHub] [knox] zeroflag opened a new pull request #472: KNOX-2638 - Shiro propererties are missing after topology deployment

zeroflag opened a new pull request #472:
URL: https://github.com/apache/knox/pull/472


   ## What changes were proposed in this pull request?
   
   STR:
   
   1. Have an existing topology (test.xml), see if blockSemicolon/blockBackslash/blockNonAscii are in the get topology output:
   
   ```bash
   $ curl -u admin:admin-password -k -X GET https://localhost:8443/gateway/admin/api/v1/topologies/test grep blockSemicolon
   <name>main.invalidRequest.blockSemicolon</name>
   ```
   
   2. Deploy a new topology file (test2.xml)
   
   ```bash
   cp ./conf/topologies/test.xml ./conf/topologies/test2.xml 
   ```
   
   3. blockSemicolon/blockBackslash/blockNonAscii are no longer in the orignial test.xml output:
   
   ```bash
   $ curl -u admin:admin-password  -k -X GET https://localhost:8443/gateway/admin/api/v1/topologies/test | grep  blockSemicolon 
   ```
   
   The reason why these shiro properties are missing is because we only add these after a topology deployment to the in memory representation of a topology. When we deploy a new topology we also reload all the existing topologies but only redeploy the newly added one.
   
   ```java
   @Override
   public void reloadTopologies() {
     try {
       synchronized (this) {
         Map<File, Topology> oldTopologies = topologies;
         Map<File, Topology> newTopologies = loadTopologies(topologiesDirectory); // <= parse everything from disk
         List<TopologyEvent> events = createChangeEvents(oldTopologies, newTopologies);
         topologies = newTopologies;
         notifyChangeListeners(events); // <= this will redeploy the new topology and add the shiro properties, but those will be missing from all other existing topologies
       }
     } catch (Exception e) {
       // Maybe it makes sense to throw exception
       log.failedToReloadTopologies(e);
     }
   } 
   ```
   
   ## How was this patch tested?
   
   This was discovered while investigating the flakiness of an existing test: GatewayAdminTopologyFuncTest.
   After the fixed I verified that GatewayAdminTopologyFuncTest is no longer flaky.
   
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@knox.apache.org

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



[GitHub] [knox] zeroflag commented on pull request #472: KNOX-2638 - Shiro propererties are missing after topology deployment

Posted by GitBox <gi...@apache.org>.
zeroflag commented on pull request #472:
URL: https://github.com/apache/knox/pull/472#issuecomment-884174807


   cc: @smolnar82 @moresandeep @pzampino @lmccay4 


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@knox.apache.org

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



[GitHub] [knox] zeroflag closed pull request #472: KNOX-2638 - Shiro propererties are missing after topology deployment

Posted by GitBox <gi...@apache.org>.
zeroflag closed pull request #472:
URL: https://github.com/apache/knox/pull/472


   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@knox.apache.org

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



[GitHub] [knox] zeroflag edited a comment on pull request #472: KNOX-2638 - Shiro propererties are missing after topology deployment

Posted by GitBox <gi...@apache.org>.
zeroflag edited a comment on pull request #472:
URL: https://github.com/apache/knox/pull/472#issuecomment-884174807


   cc: @smolnar82 @moresandeep @pzampino @lmccay 


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@knox.apache.org

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



[GitHub] [knox] smolnar82 merged pull request #472: KNOX-2638 - Shiro propererties are missing after topology deployment

Posted by GitBox <gi...@apache.org>.
smolnar82 merged pull request #472:
URL: https://github.com/apache/knox/pull/472


   


-- 
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.

To unsubscribe, e-mail: dev-unsubscribe@knox.apache.org

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