[FEATURE] Support Multi-Catalog Authorization with Multiple Ranger Services
- Dominant language
- Scala
- Stars
- 2.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [x] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
### Describe the feature
Support authorization for multiple Spark catalogs in Kyuubi Spark AuthZ, with each Spark catalog mapped to a different Apache Ranger service.
For example:
```
Spark Catalog Ranger Service
------------------------------------
iceberg -> ranger_iceberg
paimon -> ranger_paimon
hive -> ranger_hive
```
Currently, Kyuubi Spark AuthZ does not provide a clear way to distinguish and authorize resources based on the Spark catalog and route authorization requests to different Ranger services.
### Motivation
Spark supports multiple catalogs in the same Spark session, for example:
```
SELECT * FROM iceberg.sales.orders;
SELECT * FROM paimon.sales.orders;
SELECT * FROM hive.default.customers;
```
In a multi-catalog environment, different catalogs may represent different platforms, table formats, or security domains and may need independent Ranger policies.
Using a single Ranger service makes it difficult to isolate and manage authorization policies for each catalog.
### Describe the solution
Add support for mapping Spark catalog names to Ranger services.
For example:
```
iceberg -> ranger_iceberg
paimon -> ranger_paimon
hive -> ranger_hive
```
When Kyuubi Spark AuthZ receives an authorization request for:
```
iceberg.sales.orders
```
it should:
```
catalog = iceberg
namespace = sales
table = orders
↓
Ranger service = ranger_iceberg
↓
Authorize sales.orders using ranger_iceberg
```
Similarly:
```
paimon.sales.orders
↓
Ranger service = ranger_paimon
↓
Authorize sales.orders using ranger_paimon
```
This would allow each Spark catalog to have its own Ranger service and independent authorization policies.
### Additional context
This is useful for Spark deployments that use multiple catalogs, such as Iceberg, Paimon, Hive, or other catalogs configured in the same Spark/Kyuubi session.
The expected mapping is:
```
Spark Catalog → Ranger Service
Namespace → Ranger Database
Table → Ranger Table
```
This would allow Kyuubi Spark AuthZ to support multi-catalog authorization without requiring users to combine policies from all catalogs into a single Ranger service.
### Are you willing to submit PR?
- [ ] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
- [x] No. I cannot submit a PR at this time.
Contributor guide
Research direction
Start by locating the Kyuubi Spark AuthZ authorization entry point and how catalog-qualified resources are represented. Use the stated catalog-to-Ranger-service and namespace-to-database mapping as acceptance criteria, and verify separate authorization requests for the iceberg, paimon, and hive examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, sql
- Domain
- authorization, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100