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

Larry McCay commented on KNOX-711:
----------------------------------

This looks quite good to me.

Some minor nits below:
* UrlRewriteRuleProcessorHolder - let's add some commentary in there around the 
use of the beginning of the rulename as the scope
* GatewayConfigImpl - can we parse the configured list upfront rather than do 
so on every rewrite rule initialize? How often are they initialized?
* ScopedMatcher.findBestMatcher - this seems like it might have room for 
optimization. Is scope normally null here though and this is only for when it 
is specified at the rule level?
* ScopedMatcher - could use some comments in general

Due to the complexity of the rewrite, I think that we need to comment it 
whenever we touch it as best we can. Unless the code is extremely obvious let's 
call out what we are doing and why.

> Global Rewrite Rules for a Topology are Problematic
> ---------------------------------------------------
>
>                 Key: KNOX-711
>                 URL: https://issues.apache.org/jira/browse/KNOX-711
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>            Reporter: Larry McCay
>            Assignee: Sumit Gupta
>             Fix For: 0.9.1
>
>         Attachments: KNOX_711.patch
>
>
> Due to the fact that the rewrite rules for a topology are global, matching 
> patterns that are more generic may cause indeterminate URL rewriting. This is 
> more of a problem for proxying UIs than it is for services but since the 
> patterns are up to the discretion of the developer they could certainly also 
> apply to service definitions.
> For instance, the JOBHISTORY UI rewrite.xml contains a pattern like 
> "/static/**". This pattern will match an root relative URLs that start with 
> "static". Since other hadoop UIs that may be proxied through the same 
> topology will reference similar resources, the URL rewriting may match the 
> pattern from the wrong application and interject the service/UI name into the 
> URL which will result in 404's.
> This has been observed for the HBase UI when the JOBHISTORY UI is also in the 
> same topology.
> The workaround for this issue is to deploy separate topologies for UIs that 
> have overlapping matching patterns.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to