Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-1321

Livy service.xml does not apply addusername rule to /batches endpoint

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 0.14.0
    • None
    • None
    • None

    Description

      When a request is made to Livy via Knox today:

      1, Spark Magic sends a JSON body to knox, ex: 

      {"driverMemory":"2G","executorCores":4,"executorMemory":"8G","proxyUser":"alice"}

      2, Knox's service.xml will rewrite the proxyUser "alice" to the actual authenticated username:

       

      <route path="/livy/v1/sessions">
      <rewrite apply="LIVYSERVER/livy/addusername/inbound" to="request.body"/>
      </route>
      <route path="/livy/v1/**?**"/>
      <route path="/livy/v1"/>
      <route path="/livy/v1/"/>

       

       

      Using the rewrite.xml rules:

       

      <rule name="LIVYSERVER/livy/user-name">
       <rewrite template="{$username}"/>
      </rule>
      <filter name="LIVYSERVER/livy/addusername/inbound">
       <content type="*/json">
       <apply path="$.proxyUser" rule="LIVYSERVER/livy/user-name"/>
       </content>
      </filter>
      

       

       

       The issue here is that requests made to knox:port/gateway/topology/livy/v1/batches will not apply the same rewrite rule. 

       

       

      https://livy.incubator.apache.org/docs/latest/rest-api.html

      Attachments

        Issue Links

          Activity

            People

              krisden Kevin Risden
              jesus.alv Jesus Alvarez
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: