[jira] [Commented] (KNOX-1157) Scoped rewrite rules are treated as global rules in some cases

2018-05-16 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on KNOX-1157:
---

Commit a1640b99e667687f370c4760e37959d99cc6a578 in knox's branch 
refs/heads/master from Wei Han
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=a1640b9 ]

KNOX-1157 - Scoped rewrite rules are treated as global rules in some cases (Wei 
Han via Phil Zampino)


> 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.1.0
>
> Attachments: NewScopedMatcher.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. 
> 
> 
> 
> 
> 
> 
> 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
(v7.6.3#76005)


[jira] [Commented] (KNOX-1157) Scoped rewrite rules are treated as global rules in some cases

2018-05-10 Thread Wei Han (JIRA)

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

Wei Han commented on KNOX-1157:
---

[~pzampino] Could you try the new patch attached?

> 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.1.0
>
> Attachments: NewScopedMatcher.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. 
> 
> 
> 
> 
> 
> 
> 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
(v7.6.3#76005)


[jira] [Commented] (KNOX-1157) Scoped rewrite rules are treated as global rules in some cases

2018-05-10 Thread Wei Han (JIRA)

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

Wei Han commented on KNOX-1157:
---

[~pzampino] sure.

> 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.1.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. 
> 
> 
> 
> 
> 
> 
> 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
(v7.6.3#76005)


[jira] [Commented] (KNOX-1157) Scoped rewrite rules are treated as global rules in some cases

2018-05-08 Thread Phil Zampino (JIRA)

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

Phil Zampino commented on KNOX-1157:


[~weihan] Would you please provide an updated patch, rebased agains the latest 
source? The packages are no longer consistent with Knox 1.0.0+ 

> 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.1.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. 
> 
> 
> 
> 
> 
> 
> 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
(v7.6.3#76005)


[jira] [Commented] (KNOX-1157) Scoped rewrite rules are treated as global rules in some cases

2018-01-08 Thread Larry McCay (JIRA)

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

Larry McCay commented on KNOX-1157:
---

Going to move this out to 1.1.0 as it will possibly introduce behavioral 
differences between 1.0.0 and 0.14.0.

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


[jira] [Commented] (KNOX-1157) Scoped rewrite rules are treated as global rules in some cases

2018-01-03 Thread Larry McCay (JIRA)

[ 
https://issues.apache.org/jira/browse/KNOX-1157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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. 
> 
> 
> 
> 
> 
> 
> 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)