[
https://issues.apache.org/jira/browse/KNOX-380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Minder updated KNOX-380:
------------------------------
Description:
This came up while trying to implement functions for rewriting a host:port in a
RM REST API response body. The client is supposed to take that host:port and
add it to the end of a URL as a path. So the encrypted needed to turn
host:port into a single encrypted value that could be part of the path. The
thinking for the rule was something like this:
{code}
<rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/nodeId/outbound">
<match pattern="{host=*}:{port=*}"/>
<rewrite template="{$encrypt(host,':', port)}"/>
</rule>
{code}
It looks like this should start with Evaluator and work its way outward.
{code}
package org.apache.hadoop.gateway.util.urltemplate;
import java.util.List;
public interface Evaluator {
//List<String> evaluate( String function, List<String> parameters );
List<String> evaluate( String function, List<String> parameters, Resolver
resolver );
}
{code}
This would transition the responsibility of resolving the parameter names in
List<String> parameters to the function implementation.
was:
This came up while trying to implement functions for rewriting a host:port in a
RM REST API response body. The client is supposed to take that host:port and
add it to the end of a URL as a path. So the encrypted needed to turn
host:port into a single encrypted value that could be part of the path. The
thinking for the rule was something like this:
{code}
<rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/nodeId/outbound">
<match pattern="{host=*}:{port=*}"/>
<rewrite template="{$encrypt(host,':', port)}"/>
</rule>
{code}
> Rewrite functions should accept multiple parameters and retain param names
> --------------------------------------------------------------------------
>
> Key: KNOX-380
> URL: https://issues.apache.org/jira/browse/KNOX-380
> Project: Apache Knox
> Issue Type: Improvement
> Components: Server
> Affects Versions: 0.4.0
> Reporter: Kevin Minder
> Fix For: 0.5.0
>
>
> This came up while trying to implement functions for rewriting a host:port in
> a RM REST API response body. The client is supposed to take that host:port
> and add it to the end of a URL as a path. So the encrypted needed to turn
> host:port into a single encrypted value that could be part of the path. The
> thinking for the rule was something like this:
> {code}
> <rule dir="OUT" name="RESOURCEMANAGER/resourcemanager/nodeId/outbound">
> <match pattern="{host=*}:{port=*}"/>
> <rewrite template="{$encrypt(host,':', port)}"/>
> </rule>
> {code}
> It looks like this should start with Evaluator and work its way outward.
> {code}
> package org.apache.hadoop.gateway.util.urltemplate;
> import java.util.List;
> public interface Evaluator {
> //List<String> evaluate( String function, List<String> parameters );
> List<String> evaluate( String function, List<String> parameters, Resolver
> resolver );
> }
> {code}
> This would transition the responsibility of resolving the parameter names in
> List<String> parameters to the function implementation.
--
This message was sent by Atlassian JIRA
(v6.2#6252)