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

Shi Wang commented on KNOX-931:
-------------------------------

Yes, there is existing example code in services/ambari/2.2.0 that include this 
asType case, but to reproduce need to manually delete the 
    <policies>
        <policy role="webappsec"/>
        <policy role="authentication" name="Anonymous"/>
        <policy role="rewrite"/>
        <policy role="authorization"/>
    </policies>
because it is not using IdentityAsserter filter. 

It is not a client error although a workaround could be specify a different 
content type in the command, because if we set content type as 
application/x-www-form-urlencoded in the curl command, intended to encode the 
request url using application/x-www-form-urlencoded, but wanna use 
application/json for the body. So we define it in the rewrite rule. However, 
IdentityAsserter filter will make this asType setting invalid, which will 
encode the body with urlencoding anyway.

I think this is a minor defect and you can decide to fix it for now or not. But 
please let me know the cases that will break and let's see if there is better 
solutions, thanks!

> asType will not work for body filter when using IdentityAsserterFilter
> ----------------------------------------------------------------------
>
>                 Key: KNOX-931
>                 URL: https://issues.apache.org/jira/browse/KNOX-931
>             Project: Apache Knox
>          Issue Type: Bug
>    Affects Versions: 0.11.0
>            Reporter: Shi Wang
>            Assignee: Shi Wang
>             Fix For: 0.13.0
>
>         Attachments: 
> 0001-KNOX-931-asType-will-not-work-for-body-filter-when-u.patch
>
>
> In IdentityAsserterHttpServletsWrapper.java, method getInputStream(),
> The body will always be urlEncoded if the contentType is 
> "application/x-www-form-urlencoded"
> And self defined filter that change "application/x-www-form-urlencoded" as 
> other contentType for requestbody will be invalid.



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

Reply via email to