You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "xxubai (via GitHub)" <gi...@apache.org> on 2026/06/02 10:16:14 UTC
[PR] [#11360] fix(server): Ignore quote-only custom filter entries [gravitino]
xxubai opened a new pull request, #11361:
URL: https://github.com/apache/gravitino/pull/11361
### What changes were proposed in this pull request?
This PR hardens the parsing of `gravitino.server.webserver.customFilters`.
The parsing now trims comma-separated entries and ignores invalid empty entries, including blank values, `""`, and `''`, before exposing the custom filter set to Jetty.
It also extends `TestJettyServerConfig` to cover quote-only and mixed custom filter values.
### Why are the changes needed?
If `gravitino.server.webserver.customFilters` is rendered or configured as `""`, Gravitino currently preserves that value as a filter class name. Jetty then attempts to load a class named `""`, causing the WebAppContext startup to fail with `ClassNotFoundException`.
The server should tolerate this malformed empty configuration and treat it as no custom filter.
Fix: #11360
### Does this PR introduce _any_ user-facing change?
No new configuration keys or APIs are introduced.
This only makes the existing `gravitino.server.webserver.customFilters` parsing more tolerant by ignoring quote-only empty values.
### How was this patch tested?
```text
./gradlew spotlessApply
./gradlew :server-common:test --tests org.apache.gravitino.server.web.TestJettyServerConfig -PskipITs -PskipDockerTests=false
git diff --check
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11360] fix(server): Ignore quote-only custom filter entries [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #11361:
URL: https://github.com/apache/gravitino/pull/11361#issuecomment-4604311635
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|66.8% **`+0.08%`**|:green_circle:|
|:-|:-|:-:|
|Files changed|89.46%|:green_circle:|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|1.72%|:red_circle:|
|api|46.82%|:green_circle:|
|authorization-common|85.96%|:green_circle:|
|aws|3.66%|:red_circle:|
|azure|2.47%|:red_circle:|
|catalog-common|10.04%|:red_circle:|
|catalog-fileset|80.33%|:green_circle:|
|catalog-glue|66.08%|:green_circle:|
|catalog-hive|79.55%|:green_circle:|
|catalog-jdbc-clickhouse|80.02%|:green_circle:|
|catalog-jdbc-common|45.31%|:green_circle:|
|catalog-jdbc-doris|80.28%|:green_circle:|
|catalog-jdbc-hologres|54.03%|:green_circle:|
|catalog-jdbc-mysql|79.23%|:green_circle:|
|catalog-jdbc-oceanbase|78.38%|:green_circle:|
|catalog-jdbc-postgresql|82.29%|:green_circle:|
|catalog-jdbc-starrocks|78.51%|:green_circle:|
|catalog-kafka|77.01%|:green_circle:|
|catalog-lakehouse-generic|44.89%|:green_circle:|
|catalog-lakehouse-hudi|79.1%|:green_circle:|
|catalog-lakehouse-iceberg|85.74%|:green_circle:|
|catalog-lakehouse-paimon|79.29%|:green_circle:|
|catalog-model|77.72%|:green_circle:|
|cli|44.51%|:green_circle:|
|client-java|77.91%|:green_circle:|
|common|49.99%|:green_circle:|
|core|82.49%|:green_circle:|
|filesystem-hadoop3|76.97%|:green_circle:|
|flink|0.0%|:red_circle:|
|flink-common|41.2%|:green_circle:|
|flink-runtime|0.0%|:red_circle:|
|gcp|14.12%|:red_circle:|
|hadoop-common|10.39%|:red_circle:|
|hive-metastore-common|53.26%|:green_circle:|
|iceberg-common|56.75%|:green_circle:|
|iceberg-rest-server|72.42%|:green_circle:|
|idp-basic|85.99%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|66.17%|:green_circle:|
|lance-common|20.83%|:red_circle:|
|lance-rest-server|60.27%|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|82.87%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|85.73%|:green_circle:|
|server-common|73.2% **`+2.18%`**|:green_circle:|
|spark|32.79%|:red_circle:|
|spark-common|39.75%|:red_circle:|
|trino-connector|39.44%|:red_circle:|
<details>
<summary>Files</summary>
|Module|File|Coverage||
|:-|:-|:-|:-:|
|server-common|[JettyServerConfig.java](https://github.com/xxubai/gravitino/blob/9adacbc4527219259d8fed4fc42b26f66894f3de/server-common/src/main/java/org/apache/gravitino/server/web/JettyServerConfig.java)|89.46%|:green_circle:|
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11360] fix(server): Ignore quote-only custom filter entries [gravitino]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #11361:
URL: https://github.com/apache/gravitino/pull/11361#discussion_r3345778324
##########
server-common/src/test/java/org/apache/gravitino/server/web/TestJettyServerConfig.java:
##########
@@ -62,8 +62,21 @@ public void testCipherAlgorithms() {
@Test
public void testCustomFilters() {
- Config emptyconfig = new Config() {};
- JettyServerConfig jettyServerConfig = JettyServerConfig.fromConfig(emptyconfig, "");
+ Config emptyConfig = new Config() {};
+ JettyServerConfig jettyServerConfig = JettyServerConfig.fromConfig(emptyConfig, "");
+ Assertions.assertNotNull(jettyServerConfig.getCustomFilters());
+ Assertions.assertTrue(jettyServerConfig.getCustomFilters().isEmpty());
+
+ Config quotedEmptyConfig = new Config() {};
+ quotedEmptyConfig.set(JettyServerConfig.CUSTOM_FILTERS, Optional.of("\"\""));
+ jettyServerConfig = JettyServerConfig.fromConfig(quotedEmptyConfig, "");
+ Assertions.assertNotNull(jettyServerConfig.getCustomFilters());
+ Assertions.assertTrue(jettyServerConfig.getCustomFilters().isEmpty());
+
+ Config singleQuotedEmptyConfig = new Config() {};
+ singleQuotedEmptyConfig.set(JettyServerConfig.CUSTOM_FILTERS, Optional.of("''"));
+ jettyServerConfig = JettyServerConfig.fromConfig(singleQuotedEmptyConfig, "");
+ Assertions.assertNotNull(jettyServerConfig.getCustomFilters());
Assertions.assertTrue(jettyServerConfig.getCustomFilters().isEmpty());
Review Comment:
`JettyServerConfig` now trims entries and filters out blank tokens in addition to quote-only values, but `testCustomFilters` only asserts the quote-only behavior. Adding a mixed/whitespace case (e.g., spaces + empty tokens + ""/'' entries) would ensure the new trimming/blank-filtering logic is covered and prevent regressions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11360] fix(server): Ignore quote-only custom filter entries [gravitino]
Posted by "xxubai (via GitHub)" <gi...@apache.org>.
xxubai commented on code in PR #11361:
URL: https://github.com/apache/gravitino/pull/11361#discussion_r3354189679
##########
server-common/src/main/java/org/apache/gravitino/server/web/JettyServerConfig.java:
##########
@@ -377,7 +379,15 @@ private JettyServerConfig(Map<String, String> configs) {
this.customFilters =
internalConfig
.get(CUSTOM_FILTERS)
Review Comment:
Updated
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11360] fix(server): Ignore quote-only custom filter entries [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao merged PR #11361:
URL: https://github.com/apache/gravitino/pull/11361
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [#11360] fix(server): Ignore quote-only custom filter entries [gravitino]
Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao commented on code in PR #11361:
URL: https://github.com/apache/gravitino/pull/11361#discussion_r3353342853
##########
server-common/src/main/java/org/apache/gravitino/server/web/JettyServerConfig.java:
##########
@@ -377,7 +379,15 @@ private JettyServerConfig(Map<String, String> configs) {
this.customFilters =
internalConfig
.get(CUSTOM_FILTERS)
Review Comment:
You can update the `CUSTOM_FILTERS` to use `toSequence()`, which will convert the string conf to list conf
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gravitino.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org