[ 
https://issues.apache.org/jira/browse/KNOX-1157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310663#comment-16310663
 ] 

Larry McCay commented on KNOX-1157:
-----------------------------------

[~weihan] - I have assigned this to you since you have provided a patch.
I will try and review this in the next day or so and determine whether we need 
this in 1.0.0 or not.

We need to try and keep it as close to 0.14.0 as possible.
The initial idea was to only have items that fix issues that would be a problem 
with the backward compatibility implied by a 1.0.0 release and security related 
items.

It has since started some scope creep for low risk items.

> Scoped rewrite rules are treated as global rules in some cases
> --------------------------------------------------------------
>
>                 Key: KNOX-1157
>                 URL: https://issues.apache.org/jira/browse/KNOX-1157
>             Project: Apache Knox
>          Issue Type: Bug
>            Reporter: Wei Han
>            Assignee: Wei Han
>            Priority: Minor
>             Fix For: 1.0.0
>
>         Attachments: 
> 0001-bug-fix-use-a-map-to-store-all-rules-in-ScopedMatche.patch
>
>
> https://issues.apache.org/jira/browse/KNOX-711 introduced the concept of 
> 'scope' for rewrite rules. A rewrite rule can be applied to an input url only 
> if they share the same scope, unless the rule is explicitly defined as 
> 'global' rules. 
> However given the following rewrite.xml, and input url "/foo/bar" with role 
> service-1, the second rule(service-2) will win because the second rule is 
> more specific, even the scope is different from the input url. 
>     <rule name="service-1/test-rule-8" dir="OUT" pattern="/foo/{**}">
>         <rewrite template="/foo/service-1" />
>     </rule>
>     <rule name="service-2/test-rule-9" dir="OUT" pattern="/foo/bar">
>         <rewrite template="/foo/service-2" />
>     </rule>
> The root cause is the templates for these two rules are different, so in 
> ScopedMatcher.java(https://github.com/apache/knox/commit/286e02a44dfb5f9ee101007b46bcb8ee47fa62d7#diff-6cffc9c391024e27c73a85ba8e736e60R118),
>  we don't create a separate matcher and the two rules share the same matcher 
> object. 
> My proposal is to change the implementation to create a brand new matcher for 
> each scope, and store them in a map keyed by scope name.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to