You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by "muarine (via GitHub)" <gi...@apache.org> on 2023/02/01 12:30:48 UTC

[GitHub] [shenyu] muarine opened a new issue, #4343: [BUG] The original rule path still takes effect after modifying the rule

muarine opened a new issue, #4343:
URL: https://github.com/apache/shenyu/issues/4343

   ### Is there an existing issue for this?
   
   - [X] I have searched the existing issues
   
   ### Current Behavior
   
   i use plugins: jwt / divide
   local machine start Shenyu-Admin / Shenyu-Bootstrap / ShenyuTestHttpApplication
   
   1. step1:
   
   Configure matching rules in jwt plug-in condition uri pathPattern /http/shenyu/client/post/hi
   and Use the curl command to try to access the interface
   
   `curl --location --request POST 'http://localhost:9195/http/shenyu/client/post/hi' \
   --header 'authorization: eyJhbGciOiJIUzI1NiJ9.eyJwYXRoIjoiL2h0dHAvc2hlbnl1L2NsaWVudC9oZWxsbyIsIndlYiI6eyJzaGVueXUiOiIyLjUuMCIsInNvdXJjZSI6Im90aGVyVXNlciIsInRpbWVzdGFtcCI6MTY3Mzc1MDc3ODI3MX19.OhsQV2ar0szZAV44kiYh9uNMBoKHTqL8-rDoNVArG-g' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "aaa":"1111"
   }'`
   
   finally results:
   `[post method result]:hi! null! I'm Shenyu-Gateway System. Welcome!` 
   
   That's right
   
   2. step2:
   Then modify the matching conditions of the jwt plug-in  condition uri pathPattern /http/shenyu/client/post/11hi
   and Continue to access the curl script above
   
   ### Expected Behavior
   
   bad case: in step2 Response results
   `{
       "code": -401,
       "message": "Illegal authorization",
       "class": null
   }`
   
   expected result:jwt plug-in not match so Response results 
   `[post method result]:hi! null! I'm Shenyu-Gateway System. Welcome!`
   
   
   ### Steps To Reproduce
   
   1. jdk17 
   2. config: use default configuration and use websocket syncdata
   3. shenyu: 2.5.1
   
   ### Environment
   
   ```markdown
   ShenYu version(s):2.5.1
   ```
   
   
   ### Debug logs
   
   `Request Uri: http://localhost:9195/http/shenyu/client/post/hi
   Request Method: POST
   
   [Request Headers Start]
   Content-Type: application/json
   User-Agent: PostmanRuntime/7.30.1
   Accept: */*
   Cache-Control: no-cache
   Postman-Token: 5ebb9b06-6d5e-4beb-949d-3f101e2be78b
   Host: localhost:9195
   Accept-Encoding: gzip, deflate, br
   Connection: keep-alive
   content-length: 22
   [Request Headers End]
   
   
   
   
   Response Code: 200 OK
   
   [Response Headers Start]
   transfer-encoding: chunked
   Content-Type: application/json
   [Response Headers End]
   
   [Response Body Start]
   {"code":-401,"message":"Illegal authorization","class":null}
   [Response Body End]`
   
   ### Anything else?
   
   After checking whether the execute function in the abstract class AbstractShenyuPlugin gets the List<RuleData>from the cache when matching the Rule condition or the original condition rule
   
   I guess the shenyu-bootstrap service received the modified rule pushed by websocket. The code location is: org. apache.shenyu.plugin.base.trie.shenyuTrieRuleListener#onApplicationEvent shenyuTrie only processed the modified conditional rule. The original conditional rule is not processed


-- 
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: notifications-unsubscribe@shenyu.apache.org.apache.org

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


[GitHub] [shenyu] muarine commented on issue #4343: [BUG] The original rule path still takes effect after modifying the rule

Posted by "muarine (via GitHub)" <gi...@apache.org>.
muarine commented on issue #4343:
URL: https://github.com/apache/shenyu/issues/4343#issuecomment-1418336530

   > 
   
   Yes, let's discuss and further determine


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


[GitHub] [shenyu] muarine commented on issue #4343: [BUG] The original rule path still takes effect after modifying the rule

Posted by "muarine (via GitHub)" <gi...@apache.org>.
muarine commented on issue #4343:
URL: https://github.com/apache/shenyu/issues/4343#issuecomment-1447644981

   > 
   
   close


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


[GitHub] [shenyu] muarine closed issue #4343: [BUG] The original rule path still takes effect after modifying the rule

Posted by "muarine (via GitHub)" <gi...@apache.org>.
muarine closed issue #4343: [BUG] The original rule path still takes effect after modifying the rule
URL: https://github.com/apache/shenyu/issues/4343


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


[GitHub] [shenyu] iwangjie commented on issue #4343: [BUG] The original rule path still takes effect after modifying the rule

Posted by "iwangjie (via GitHub)" <gi...@apache.org>.
iwangjie commented on issue #4343:
URL: https://github.com/apache/shenyu/issues/4343#issuecomment-1417090311

   You're right. It seems that Shenyu uses Shenyutrie to store the tree information, and every time the rule information is updated, it simply inserts the changed rule directly into the tree without updating the historical element information. 


-- 
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: notifications-unsubscribe@shenyu.apache.org

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


[GitHub] [shenyu] muarine commented on issue #4343: [BUG] The original rule path still takes effect after modifying the rule

Posted by "muarine (via GitHub)" <gi...@apache.org>.
muarine commented on issue #4343:
URL: https://github.com/apache/shenyu/issues/4343#issuecomment-1447644410

   fixed. #4380


-- 
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: notifications-unsubscribe@shenyu.apache.org

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