Thanks Larry,

I agree there’s no benefit for the user, I just thought there might already be 
a simple solution.

I actually already have an API gateway between the rest client and knox-server 
so I could just
adjust the mapping there (e.g.: append “/hive” to “/sqlservice/ABC”). Just 
would have been
nicer to have everything in knox instead.

--
Alan


From: larry mccay <[email protected]>
Reply-To: "[email protected]" <[email protected]>
Date: Tuesday, November 22, 2016 at 4:41 PM
To: "[email protected]" <[email protected]>
Subject: Re: rewrite rules

Hi Alan -

That is an interesting question...

So, basically, how do we make single service topologies default the context 
path to the single service route.
I believe if you were to want to hack around in the existing files that you 
would need change the routes and all the rewrite rules to be completely generic.

This will not likely work out well but might be interesting to try it. :)

If you ever needed to add a topology with any other service the rules would 
match other services too.
Also, I think rewrite may try and add the "hive" in.
Feels like it would be a mess.

It would probably be better to add some notion of single-service topology to 
the topology semantics.
Then configure what path context to "assume" and change the request on the way 
in to include the assumed path context.

From a user experience, I don't know that I really understand the overall 
benefit of not having to put hive on the end - sometimes.
What user (or JDBC/ODBC config) is really going to benefit from this feature 
enough to justify the effort to add it?
Is the motivation related to maybe making the fact that hive is being used in 
the backend less obvious?

Not against the idea - just trying to determine the itch that you are trying to 
scratch with this.

thanks,

--larry

On Tue, Nov 22, 2016 at 6:36 PM, Alan Miller 
<[email protected]<mailto:[email protected]>> wrote:
I have multiple topologies (one per customer, ABC, DEF, etc.) where I ONLY 
enable hive and
authenticate users via LDAP (and limit access to a specific group (e.g.: 
ABC-Hive-Users).
…
        <provider>
            <role>authorization</role>
            <name>AclsAuthz</name>
            <enabled>true</enabled>
            <param name="hive.acl" value="*;ABC-Hive-Users;*" />
        </provider>

    <service>
        <role>HIVE</role>
        <url>http://myinternalhiveserver:10010/cliservice</url>
    </service>


This all works fine and clients can access my hive service via 
/sqlservice/ABC/hive

Is it possible to add another “default” rule for “ABC” topology so that
“/sqlservice/ABC” and “/sqlservice/ABC/hive” point to the same service?

I see the routes & rule entries in service.xml and rewrite.xml files but it’s 
not clear to me which one to edit.

Service.xml
…
    <routes>
        <route path="/hive"/>
    </routes>


Rewrite.xml
…
<rules>
    <rule dir="IN" name="HIVE/hive/inbound" pattern="*://*:*/**/hive">
        <rewrite template="{$serviceUrl[HIVE]}"/>
    </rule>
</rules>

--
Alan


Reply via email to