[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2017-06-17 Thread ASF subversion and git services (JIRA)

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

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

Commit 5bbc4f9ea80021f331039ffee3e92b1199886e34 in knox's branch 
refs/heads/master from [~lmccay]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=5bbc4f9 ]

Revert "Revert "KNOX-690 fixing the encoding/decoding in the parser and 
template""

This reverts commit dfb96e1b4335a133007f9868f68a488a39c343ac.


> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: 0.9.0
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2017-06-17 Thread ASF subversion and git services (JIRA)

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

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

Commit dfb96e1b4335a133007f9868f68a488a39c343ac in knox's branch 
refs/heads/master from [~lmccay]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=dfb96e1 ]

Revert "KNOX-690 fixing the encoding/decoding in the parser and template"

This reverts commit c28224c876f1b646ddefeb66b94d517a2f170935.


> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: 0.9.0
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2017-06-17 Thread ASF subversion and git services (JIRA)

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

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

Commit 1314f1dccdc3db132b71b400d96a61a09073224c in knox's branch 
refs/heads/master from [~lmccay]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=1314f1d ]

Revert "KNOX-690 quick unit test for toEncodedString method"

This reverts commit d435c1eba6e2309b107d89f8bdc2cd17f18a60fd.


> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: 0.9.0
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2017-06-17 Thread ASF subversion and git services (JIRA)

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

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

Commit 4eeff1a6d156db860245916fa44e2a1505247e43 in knox's branch 
refs/heads/master from [~lmccay]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=4eeff1a ]

Revert "KNOX-690 fixing the encoding/decoding in the parser and template"

This reverts commit 994836cb656252128d26117d95320f69a35779d5.


> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: 0.9.0
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2017-06-06 Thread Larry McCay (JIRA)

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

Larry McCay commented on KNOX-690:
--

Just for history - this issue came about as a result of rc testing on the 0.9.0 
release - the following findings by Sumit led to the filing of this JIRA and 
the subsequent fix:

"-1 (binding)

I tested the release candidate by building the sources and running unit
tests. Also verified signatures and functionally tested some services like
WehbHDFS, Hive, Hbase and Yarn.

All that looked good but when testing the new UI proxy support for Ambari
I did find an issue with some of the widgets that was caused by the
inability to properly encode request URLs dispatched from Knox with
Œunwise¹ characters in them. I thought I had fixed this before but the fix
was improper. The appropriate fix for
https://issues.apache.org/jira/browse/KNOX-690 however does fix this issue.

I¹d like to propose cherry picking the commits in master for KNOX-690 into
the 0.9.0 branch and cutting another RC."

> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: 0.9.0
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2016-04-07 Thread ASF subversion and git services (JIRA)

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

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

Commit d435c1eba6e2309b107d89f8bdc2cd17f18a60fd in knox's branch 
refs/heads/v0.9.0 from [~sumit.gupta]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=d435c1e ]

KNOX-690 quick unit test for toEncodedString method


> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: Future
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2016-04-07 Thread Sumit Gupta (JIRA)

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

Sumit Gupta commented on KNOX-690:
--

Sorry for that miss. I added a quick test for it.

> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: Future
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2016-04-07 Thread ASF subversion and git services (JIRA)

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

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

Commit 9bc05de0763b653e001cd3aa2e4a73c7a3584de9 in knox's branch 
refs/heads/master from [~sumit.gupta]
[ https://git-wip-us.apache.org/repos/asf?p=knox.git;h=9bc05de ]

KNOX-690 quick unit test for toEncodedString method


> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: Future
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2016-04-07 Thread Kevin Minder (JIRA)

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

Kevin Minder commented on KNOX-690:
---

[~sumit.gupta] < Looks ok.  I'd like to see a unit test for 
Template.toEncodedString though.

> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: Future
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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


[jira] [Commented] (KNOX-690) URL Template matching not properly handling encoded URLs

2016-04-07 Thread Sumit Gupta (JIRA)

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

Sumit Gupta commented on KNOX-690:
--

[~kevin.minder], please review the changes when you get a chance.

> URL Template matching not properly handling encoded URLs
> 
>
> Key: KNOX-690
> URL: https://issues.apache.org/jira/browse/KNOX-690
> Project: Apache Knox
>  Issue Type: Bug
>  Components: Server
>Affects Versions: 0.9.0
>Reporter: Kevin Minder
>Assignee: Sumit Gupta
> Fix For: Future
>
>
> For example as shown below the literal "test-scheme://test-host:42/%7C" does 
> not match the template "*://*:*/|" as it probably should.  The test below can 
> be added to 
> knox-url-decode/gateway-util-urltemplate/src/test/java/org/apache/hadoop/gateway/util/urltemplate/MatcherTest.java
>  to help work on the issue.
> {code}
>   @Test
>   public void testEncodedUrlMatching() throws Exception {
> Template template;
> Template input;
> Matcher matcher;
> Matcher.Match match;
> matcher = new Matcher();
> template = Parser.parseTemplate( "*://*:*/example" );
> matcher.add( template, "test-example" );
> template = Parser.parseTemplate( "*://*:*/|" );
> matcher.add( template, "test-pipe-in-path" );
> template = Parser.parseTemplate( "*://*:*/test-path?{|=*}" );
> matcher.add( template, "test-pipe-in-query-param-name" );
> template = Parser.parseTemplate( "*://*:*/test-path?{test-param-name=*}" 
> );
> matcher.add( template, "test-pipe-in-query-param-value" );
> template = Parser.parseTemplate( "*://*:*/path#|" );
> matcher.add( template, "test-pipe-in-fragment" );
> input = Parser.parseLiteral( "test-scheme://test-host:42/example" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-example" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-path" ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?%7C=test-param-value" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-query-param-name" 
> ) );
> input = Parser.parseLiteral( 
> "test-scheme://test-host:42/test-path?test-param-name=%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( 
> "test-pipe-in-query-param-value" ) );
> input = Parser.parseLiteral( "test-scheme://test-host:42/test-path#%7C" );
> match = matcher.match( input );
> assertThat( match, notNullValue() );
> assertThat( (String)match.getValue(), is( "test-pipe-in-fragment" ) );
>   }
> {code}



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