This is an automated email from the ASF dual-hosted git repository.
more pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/master by this push:
new 60956d50f KNOX-3139: Add Support for Apache Pinot Integration in Knox
(#1034)
60956d50f is described below
commit 60956d50f02dc35fbc27c778bd304d3b94688aef
Author: Himanshu Verma <[email protected]>
AuthorDate: Wed Apr 30 18:43:54 2025 +0530
KNOX-3139: Add Support for Apache Pinot Integration in Knox (#1034)
* KNOX-3139: Add Support for Apache Pinot Integration in Knox
---------
Co-authored-by: Himanshu Verma <[email protected]>
---
.../resources/services/pinot/1.3.0/rewrite.xml | 147 +++++++++++++++++++++
.../resources/services/pinot/1.3.0/service.xml | 79 +++++++++++
.../home/assets/service-logos/pinot.png | Bin 0 -> 12252 bytes
3 files changed, 226 insertions(+)
diff --git
a/gateway-service-definitions/src/main/resources/services/pinot/1.3.0/rewrite.xml
b/gateway-service-definitions/src/main/resources/services/pinot/1.3.0/rewrite.xml
new file mode 100644
index 000000000..04e7720a3
--- /dev/null
+++
b/gateway-service-definitions/src/main/resources/services/pinot/1.3.0/rewrite.xml
@@ -0,0 +1,147 @@
+<!--
+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.
+-->
+
+
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<rules>
+
+ <!-- Root -->
+ <rule name="PINOT/inbound/ui-root" pattern="*://*:*/**/*/pinot/">
+ <rewrite template="{$serviceUrl[PINOT]}/"/>
+ </rule>
+
+ <rule name="PINOT/inbound/ui-rootu" pattern="*://*:*/**/*/pinot">
+ <rewrite template="{$serviceUrl[PINOT]}/"/>
+ </rule>
+ <!-- index.html -->
+ <rule name="PINOT/inbound/ui-index" pattern="*://*:*/**/pinot/index.html">
+ <rewrite template="{$serviceUrl[PINOT]}/index.html"/>
+ </rule>
+
+ <!-- assets -->
+ <rule name="PINOT/inbound/ui-assets"
pattern="*://*:*/**/pinot/assets/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/assets/{**}"/>
+ </rule>
+
+ <!-- static -->
+ <rule name="PINOT/inbound/ui-static"
pattern="*://*:*/**/pinot/static/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/static/{**}"/>
+ </rule>
+
+ <!-- js/main.js and other JS files -->
+ <rule name="PINOT/inbound/ui-js" pattern="*://*:*/**/pinot/js/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/js/{**}"/>
+ </rule>
+
+ <rule name="PINOT/inbound/ui-jsi" pattern="*://*:*/**/js/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/js/{**}"/>
+ </rule>
+
+ <!-- Auth info -->
+ <rule name="PINOT/auth-info" pattern="*://*:*/**/pinot/auth/info">
+ <rewrite template="{$serviceUrl[PINOT]}/auth/info"/>
+ </rule>
+
+ <!-- Pinot REST API Routes -->
+ <rule name="PINOT/api-tables-root" pattern="*://*:*/**/pinot/tables">
+ <rewrite template="{$serviceUrl[PINOT]}/tables"/>
+ </rule>
+ <rule name="PINOT/api-tables-sub" pattern="*://*:*/**/pinot/tables/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/tables/{**}"/>
+ </rule>
+
+ <rule name="PINOT/api-tenants" pattern="*://*:*/**/pinot/tenants">
+ <rewrite template="{$serviceUrl[PINOT]}/tenants"/>
+ </rule>
+
+ <rule name="PINOT/api-cluster" pattern="*://*:*/**/pinot/cluster/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/cluster/{**}"/>
+ </rule>
+
+ <!-- ZooKeeper API calls -->
+ <rule name="PINOT/zk-ls-root" pattern="*://*:*/**/pinot/zk/ls">
+ <rewrite template="{$serviceUrl[PINOT]}/zk/ls"/>
+ </rule>
+ <rule name="PINOT/zk-ls-sub" pattern="*://*:*/**/pinot/zk/ls/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/zk/ls/{**}"/>
+ </rule>
+ <rule name="PINOT/zk-api" pattern="*://*:*/**/pinot/zk/ls?{path=**}?{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/zk/ls?{path=**}?{**}"/>
+ </rule>
+
+ <rule name="PINOT/zk-get-api" pattern="*://*:*/**/pinot/zk/get?{path=**}">
+ <rewrite template="{$serviceUrl[PINOT]}/zk/get?{path=**}"/>
+ </rule>
+
+ <rule name="PINOT/zk-lsl-api" pattern="*://*:*/**/pinot/zk/lsl?{path=**}">
+ <rewrite template="{$serviceUrl[PINOT]}/zk/lsl?{path=**}"/>
+ </rule>
+
+ <rule name="PINOT/zk-stat-api"
pattern="*://*:*/**/pinot/zk/stat?{path=**}">
+ <rewrite template="{$serviceUrl[PINOT]}/zk/stat?{path=**}"/>
+ </rule>
+
+ <!-- Catch-all fallback -->
+ <rule name="PINOT/fallback" pattern="*://*:*/**/pinot/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/{**}"/>
+ </rule>
+ <!-- Swagger UI Help Endpoint -->
+ <rule name="PINOT/swagger-help" pattern="*://*:*/**/pinot/help">
+ <rewrite template="{$serviceUrl[PINOT]}/help"/>
+ </rule>
+
+ <!-- Swagger JSON -->
+ <rule dir="IN" name="PINOT/swagger-json"
pattern="*://*:*/**/pinot/swagger.json">
+ <rewrite template="{$serviceUrl[PINOT]}/swagger.json"/>
+ </rule>
+
+ <rule dir="OUT" name="PINOT/swagger-json-basepath">
+ <match pattern="{$serviceUrl[PINOT]}/swagger.json"/>
+ <filter type="response">
+ <content type="application/json">
+ <apply path="$.basePath" rule="pathModifier"/>
+ </content>
+ </filter>
+ <rewrite template="{$serviceUrl[PINOT]}/swagger.json"/>
+ </rule>
+
+ <!-- Rule to modify the basePath -->
+ <filter name="pathModifier">
+ <content type="text/plain">
+ <apply path="$" rule="updatePath"/>
+ </content>
+ </filter>
+
+ <rule name="updatePath" pattern="/">
+ <rewrite template="{$frontend[path]}/pinot/"/>
+ </rule>
+
+ <!-- Swagger UI Assets -->
+ <rule name="PINOT/swagger-assets"
pattern="*://*:*/**/pinot/swaggerui-dist/{**}">
+ <rewrite template="{$serviceUrl[PINOT]}/swaggerui-dist/{**}"/>
+ </rule>
+
+ <rule name="PINOT/swaggerui-dist-bundle"
pattern="*://*:*/**/pinot/swaggerui-dist/swagger-ui-bundle.js">
+ <rewrite
template="{$serviceUrl[PINOT]}/swaggerui-dist/swagger-ui-bundle.js"/>
+ </rule>
+
+ <rule name="PINOT/swagger-assets-preset"
pattern="*://*:*/**/pinot/swaggerui-dist/swagger-ui-standalone-preset.js">
+ <rewrite
template="{$serviceUrl[PINOT]}/swaggerui-dist/swagger-ui-standalone-preset.js"/>
+ </rule>
+
+
+</rules>
diff --git
a/gateway-service-definitions/src/main/resources/services/pinot/1.3.0/service.xml
b/gateway-service-definitions/src/main/resources/services/pinot/1.3.0/service.xml
new file mode 100644
index 000000000..d94548274
--- /dev/null
+++
b/gateway-service-definitions/src/main/resources/services/pinot/1.3.0/service.xml
@@ -0,0 +1,79 @@
+<!--
+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.
+-->
+
+
+
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<service name="pinot" role="PINOT" version="1.3.0">
+ <metadata>
+ <context>/pinot/</context>
+ <description>Apache Pinot UI only (no REST proxy)</description>
+ <shortDesc>Pinot Dashboard UI</shortDesc>
+ <type>UI</type>
+ </metadata>
+
+ <dispatch
classname="org.apache.knox.gateway.dispatch.ConfigurableDispatch"
use-two-way-ssl="false">
+ <param>
+ <name>responseExcludeHeaders</name>
+ <value>CONTENT-LENGTH</value>
+ </param>
+ </dispatch>
+
+ <routes>
+ <route path="/pinot/"/>
+ <route path="/pinot/index.html"/>
+ <route path="/pinot/assets/**"/>
+ <route path="/pinot/static/**"/>
+ <route path="/pinot/js/**"/>
+ <route path="/js/**"/>
+
+ <route path="/pinot/auth/info"/>
+ <!-- Pinot REST API Routes -->
+ <route path="/pinot/tables"/>
+ <route path="/pinot/tables/**"/>
+ <route path="/pinot/tenants"/>
+ <route path="/pinot/cluster/**"/>
+
+ <route path="/pinot/zk/**"/>
+ <route path="/pinot/zk/ls"/>
+ <route path="/pinot/zk/ls/**"/>
+ <route path="/pinot/help/**"/>
+ <route path="/pinot/**"/>
+ <route path="/pinot/zk/get"/>
+ <route path="/pinot/zk/get/**"/>
+
+ <route path="/pinot/zk/lsl"/>
+ <route path="/pinot/zk/lsl/**"/>
+
+ <route path="/pinot/zk/stat"/>
+ <route path="/pinot/zk/stat/**"/>
+
+ <route path="/help"/>
+
+ <route path="/swagger.json"/>
+ <route path="/swaggerui-dist/**"/>
+
+ <route path="/pinot/help"/>
+ <route path="/pinot/swagger.json"/>
+ <route path="/pinot/swaggerui-dist/**"/>
+ <route path="/pinot/swaggerui-dist/"/>
+ <route path="/pinot/swaggerui-dist/swagger-ui-bundle.js"/>
+ <route path="/pinot/swaggerui-dist/swagger-ui-standalone-preset.js"/>
+
+
+ </routes>
+</service>
diff --git a/knox-homepage-ui/home/assets/service-logos/pinot.png
b/knox-homepage-ui/home/assets/service-logos/pinot.png
new file mode 100644
index 000000000..116abd6e7
Binary files /dev/null and
b/knox-homepage-ui/home/assets/service-logos/pinot.png differ