| <!-- |
| 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="HBASEJARS" name="hbasejars" version="2.2.0"> |
| <metadata> |
| <type>API</type> |
| <context>/hbase/jars</context> |
| <shortDesc>Jar hosting for HBase</shortDesc> |
| <description>Static hosting of HBase client jars from the backend HBase UI.</description> |
| </metadata> |
| <!-- This service assumes that HBase UI is hosting a "mini" maven repo at |
| http://<hbase-master>:16010/static/maven and we expose this via Knox |
| at https://<knox>/sandbox/topology/hbase/jars --> |
| <routes> |
| <!-- Define routes for our embedded maven repo --> |
| <route path="/hbase/jars"> |
| <rewrite apply="HBASEJARS/inbound/jars" to="request.url"/> |
| <rewrite apply="HBASEJARS/outbound/jars" to="response.body"/> |
| </route> |
| <route path="/hbase/jars/**"> |
| <rewrite apply="HBASEJARS/inbound/jars/path" to="request.url"/> |
| <rewrite apply="HBASEJARS/outbound/jars" to="response.body"/> |
| <!-- For the Jetty HTTP/302 redirects --> |
| <rewrite apply="HBASEJARS/outbound/jars/headers" to="response.headers"/> |
| </route> |
| </routes> |
| <!-- This is extremely important yet looks out of place. Knox IN rules ending in {**} will drop a trailing-slash |
| character which will result in the HTTP/302 redirect to a URL with a trailing-slash that Jetty does with |
| the ResourceHandler. Without this custom dispatch to re-add that trailing-slash, Knox will create in |
| redirect-loop when trying to traverse this via the UI. This is only important when traversing the dirlisting |
| via a browser or HTTP client. Maven does not traverse the directory structure when pulling artifacts.--> |
| <dispatch classname="org.apache.knox.gateway.hbase.HBaseUIDispatch" ha-classname="org.apache.knox.gateway.hbase.HBaseUIHaDispatch"/> |
| </service> |