​Hello,

I've just read in detail the Knox dev guide. First of all, congrats ! Great
job for the doc !
But I face to an issue with logsearch on my HDP cluster.
This is a HDP 2.6.5 with Knox 0.12.0
I've created some XML files. These files are in PJs.
But I face to some 403 requests. In fact, some urls have been "urlencoded"
twice:

Rewrote URL:
http://XXX:80/gateway/default/logsearch/api/v1/service/logs/histogram?page=0&pageSize=999999999&startIndex=0&q=
**%3A**...
direction: IN
via implicit rule: LOGSEARCH/logsearch/inbound
to URL:
http://XXX:61888/api/v1/service/logs/histogram?q=**%253A**&startIndex=0...

Thus, we've got the string "q=%3A" replaced by "q=%253A"

How can I resolve this issue ?
I've written a custom dispatch class and reference it in the service.xml
but my class seems to be ignored.

<dispatch
classname="org.apache.hadoop.gateway.logsearch.LogsearchDispatch"/>

I've put my Jar that contains this class in the ext directory. Thus, it
should be in the classpath.

Thanks in advance
Regards,
David
<?xml version="1.0" encoding="utf-8"?>
<!--
       Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<rules>

  <rule dir="IN" name="LOGSEARCH/logsearch/inbound/root" pattern="*://*:*/**/logsearch/">
    <rewrite template="{$serviceUrl[LOGSEARCH]}/"/>
  </rule>

  <rule dir="IN" name="LOGSEARCH/logsearch/inbound" pattern="*://*:*/**/logsearch/{**}?{**}">
    <decrypt-query/>
    <rewrite template="{$serviceUrl[LOGSEARCH]}/{**}?{**}"/>
  </rule>

  <rule dir="OUT" name="LOGSEARCH/logsearch/outbound/basepath" pattern="/">
    <rewrite template='{$frontend[path]}/logsearch/'/>
  </rule>

</rules>
<?xml version="1.0" encoding="utf-8"?>
<!--
       Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<service role="LOGSEARCH" name="logsearch" version="0.5.0">
  
  <routes>

    <route path="/logsearch">
      <rewrite apply="LOGSEARCH/logsearch/outbound" to="response.body"/>
      <rewrite apply="LOGSEARCH/logsearch/inbound" to="request.url"/>
    </route>

    <route path="/logsearch/">
      <rewrite apply="LOGSEARCH/logsearch/outbound" to="response.body"/>
    </route>
    
    <route path="/logsearch/**?**">
      <rewrite apply="LOGSEARCH/logsearch/outbound" to="response.body"/>
    </route>
    
  </routes>

  <!--
  <dispatch classname="org.apache.hadoop.gateway.dispatch.PassAllHeadersDispatch"/>
  <dispatch classname="org.apache.hadoop.gateway.logsearch.LogsearchDispatch"/>
  -->

  <dispatch classname="org.apache.hadoop.gateway.logsearch.LogsearchDispatch"/>

</service>

Reply via email to