You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "Valerde (via GitHub)" <gi...@apache.org> on 2026/08/26 10:45:52 UTC
[PR] [#12642] fix(authz): add missing supportsScheme to JdbcCredentialProvider [gravitino]
Valerde opened a new pull request, #12644:
URL: https://github.com/apache/gravitino/pull/12644
# [#12642] fix(authz): add missing supportsScheme to JdbcCredentialProvider
### What changes were proposed in this pull request?
Add the missing `supportsScheme` override to `JdbcCredentialProvider`, so it
only claims support for the `jdbc` scheme instead of inheriting the default
`return true` from the `CredentialProvider` interface.
Add `TestCatalogCredentialManager` to cover path-based provider selection when
a catalog has multiple provider types, and add a `supportsScheme` unit test in
`TestJdbcCredentialProvider`.
### Why are the changes needed?
When an Iceberg catalog uses a JDBC backend and stores table data in object
storage (e.g. S3), both `jdbc-user-password` and `s3-secret-key` credential
providers are configured. The path-based credential lookup in
`CatalogCredentialManager#getCredentialByPath` selects a provider by URI scheme.
Because `JdbcCredentialProvider` did not override `supportsScheme`, it inherited
the default implementation that returns `true` for every scheme. As a result,
a request for an S3 table path matched two providers and threw:
```
UnsupportedOperationException: Multiple credential providers found for path
s3://bucket/warehouse/table with scheme s3:
[s3-secret-key, jdbc-user-password]
```
Restricting the JDBC provider to the `jdbc` scheme resolves the conflict, while
type-based JDBC credential fetching remains unaffected.
Fix: #12642
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
- `./gradlew spotlessApply`
- `./gradlew :core:test \
--tests org.apache.gravitino.credential.TestJdbcCredentialProvider \
--tests org.apache.gravitino.credential.TestCatalogCredentialManager \
-PskipITs`
--
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] [#12642] fix(authz): add missing supportsScheme to JdbcCredentialProvider [gravitino]
Posted by "roryqi (via GitHub)" <gi...@apache.org>.
roryqi commented on PR #12644:
URL: https://github.com/apache/gravitino/pull/12644#issuecomment-5432947151
@Valerde Thanks for your contribution! Welcome to join the Gravitino community!
--
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] [#12642] fix(authz): add missing supportsScheme to JdbcCredentialProvider [gravitino]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #12644:
URL: https://github.com/apache/gravitino/pull/12644#issuecomment-5425373588
<!-- coverage-report -->
### Code Coverage Report
|Overall Project|68.28%|:green_circle:|
|:-|:-|:-:|
|Files changed|100.0%|:green_circle:|
<br>
|Module|Coverage||
|:-|:-|:-:|
|aliyun|19.74%|:red_circle:|
|api|52.87%|:green_circle:|
|authorization-common|85.96%|:green_circle:|
|authorization-ranger|4.38%|:red_circle:|
|aws|53.54%|:green_circle:|
|azure|32.1%|:red_circle:|
|catalog-common|9.9%|:red_circle:|
|catalog-fileset|80.17%|:green_circle:|
|catalog-glue|69.24%|:green_circle:|
|catalog-hive|82.96%|:green_circle:|
|catalog-jdbc-common|45.69%|:green_circle:|
|catalog-jdbc-doris|82.44%|:green_circle:|
|catalog-jdbc-mysql|79.33%|:green_circle:|
|catalog-jdbc-postgresql|83.39%|:green_circle:|
|catalog-jdbc-starrocks|79.16%|:green_circle:|
|catalog-kafka|76.99%|:green_circle:|
|catalog-lakehouse-generic|60.55%|:green_circle:|
|catalog-lakehouse-hudi|79.1%|:green_circle:|
|catalog-lakehouse-iceberg|85.86%|:green_circle:|
|catalog-lakehouse-paimon|84.26%|:green_circle:|
|catalog-model|77.99%|:green_circle:|
|cli|44.48%|:green_circle:|
|client-java|78.16%|:green_circle:|
|common|52.29%|:green_circle:|
|core|83.74% **`+0.01%`**|:green_circle:|
|filesystem-hadoop3|76.45%|:green_circle:|
|flink|0.0%|:red_circle:|
|flink-common|50.29%|:green_circle:|
|flink-runtime|0.0%|:red_circle:|
|gcp|32.2%|:red_circle:|
|hadoop-auth|68.0%|:green_circle:|
|hadoop-common|17.84%|:red_circle:|
|hive-metastore-common|53.4%|:green_circle:|
|iceberg-aliyun-bundle|0.0%|:red_circle:|
|iceberg-common|64.75%|:green_circle:|
|iceberg-rest-server|75.31%|:green_circle:|
|idp-basic|85.98%|:green_circle:|
|integration-test-common|0.0%|:red_circle:|
|jobs|62.92%|:green_circle:|
|lance-common|32.81%|:red_circle:|
|lance-rest-server|64.78%|:green_circle:|
|lineage|53.02%|:green_circle:|
|optimizer|83.17%|:green_circle:|
|optimizer-api|21.95%|:red_circle:|
|server|87.54%|:green_circle:|
|server-common|79.59%|:green_circle:|
|spark|28.57%|:red_circle:|
|spark-common|48.92%|:green_circle:|
|tencent|69.84%|:green_circle:|
|trino-connector|47.41%|:green_circle:|
<details>
<summary>Files</summary>
|Module|File|Coverage||
|:-|:-|:-|:-:|
|core|[JdbcCredentialProvider.java](https://github.com/Valerde/gravitino/blob/fc9591c483a9e1867e0a01f7d831d2c33c79b280/core/src/main/java/org/apache/gravitino/credential/JdbcCredentialProvider.java)|100.0%|: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] [#12642] fix(authz): add missing supportsScheme to JdbcCredentialProvider [gravitino]
Posted by "roryqi (via GitHub)" <gi...@apache.org>.
roryqi merged PR #12644:
URL: https://github.com/apache/gravitino/pull/12644
--
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