Skip to content

[#13980] fix(iceberg): Authorize table metrics reports - #13981

Merged
roryqi merged 2 commits into
apache:mainfrom
qqqttt123:fix/iceberg-metrics-authorization
Oct 21, 2026
Merged

roryqi merged 2 commits into
apache:mainfrom
qqqttt123:fix/iceberg-metrics-authorization

Conversation

@roryqi

@roryqi roryqi commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • Require table read authorization before accepting Iceberg REST metrics reports.
  • Verify that the table exists and that the report names the addressed table, including supported qualified names.
  • Deny intercepted methods that lack an authorization expression, and keep local authorization for metrics stored by a REST-backed catalog.

Why are the changes needed?

An authenticated caller without table access could submit fabricated metrics because the report endpoint had no authorization annotation.

Fix: #13980

Does this PR introduce any user-facing change?

Unauthorized reports return 403. Reports for nonexistent tables return 404. Reports naming another table return 400.

How was this patch tested?

  • Ran Spotless for server-common and iceberg-rest-server.
  • Ran TestBaseMetadataAuthorizationMethodInterceptor, TestIcebergMetadataAuthorizationMethodInterceptor, and TestIcebergTableOperations.testReportTableMetrics with Gradle; all passed.

@roryqi
roryqi requested a review from yuqi1129 October 20, 2026 06:54
@roryqi roryqi added the branch-1.3 Automatically cherry-pick commit to branch-1.3 label Oct 20, 2026
@roryqi roryqi self-assigned this Oct 20, 2026
@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 72.31% +0.22% 🟢
Files changed 89.52% 🟢

Module Coverage
aliyun 19.74% 🔴
api 55.09% 🟢
authorization-common 85.96% 🟢
authorization-ranger 14.44% 🔴
aws 60.78% 🟢
aws-bundle 0.0% 🔴
azure 68.04% 🟢
azure-bundle 0.0% 🔴
catalog-common 29.49% 🔴
catalog-fileset 82.37% 🟢
catalog-glue 73.24% 🟢
catalog-hive 84.5% 🟢
catalog-jdbc-common 57.98% +5.09% 🟢
catalog-jdbc-doris 87.94% 🟢
catalog-jdbc-mysql 81.91% +11.17% 🟢
catalog-jdbc-postgresql 83.76% 🟢
catalog-jdbc-starrocks 79.72% 🟢
catalog-kafka 75.21% 🟢
catalog-lakehouse-generic 86.91% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 86.8% 🟢
catalog-lakehouse-paimon 84.36% 🟢
catalog-model 77.99% 🟢
cli 44.62% 🟢
client-java 79.44% 🟢
client-java-runtime 0.0% 🔴
common 60.9% 🟢
core 87.57% 🟢
filesystem-hadoop3 76.89% 🟢
flink 55.44% 🟢
flink-common 32.2% +8.37% 🔴
flink-runtime 0.0% 🔴
gcp 32.2% 🔴
hadoop-auth 68.0% 🟢
hadoop-common 17.84% 🔴
hive-metastore-common 62.3% 🟢
hive-metastore3-libs 58.8% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 67.14% 🟢
iceberg-rest-server 77.6% +0.38% 🟢
idp-basic 87.03% 🟢
integration-test-common 0.0% 🔴
jobs 71.35% 🟢
k8s-job-executor 97.84% 🟢
lance-common 40.73% 🟢
lance-rest-server 68.04% 🟢
lineage 59.39% 🟢
optimizer 84.27% 🟢
optimizer-api 46.58% 🟢
server 91.44% 🟢
server-common 84.03% +0.72% 🟢
spark 63.29% 🟢
tencent 81.78% 🟢
tms 80.04% 🟢
trino-connector 64.88% 🟢
Files
Module File Coverage
catalog-jdbc-common JdbcCatalogPropertiesMetadata.java 100.0% 🟢
DataSourceUtils.java 92.31% 🟢
catalog-jdbc-mysql MysqlTableOperations.java 87.28% 🟢
MysqlTablePropertiesMetadata.java 63.83% 🟢
flink-common JdbcPropertiesConverter.java 97.5% 🟢
iceberg-rest-server IcebergTableOperations.java 82.82% 🟢
IcebergMetadataAuthorizationMethodInterceptor.java 78.95% 🟢
server-common BaseMetadataAuthorizationMethodInterceptor.java 100.0% 🟢
JwksTokenValidator.java 93.1% 🟢
spark-common IcebergRestOAuthConfig.java 98.31% 🟢
JdbcPropertiesConverter.java 88.89% 🟢

@roryqi
roryqi merged commit f8cbcdd into apache:main Oct 21, 2026
43 checks passed
jerryshao pushed a commit that referenced this pull request Oct 21, 2026
…14043)

### What changes were proposed in this pull request?

Backport #13981 to `branch-1.3`: authorize Iceberg REST table metrics
reports, check that the table exists, and reject reports that name a
different table. Keep local authorization for metrics submitted through
a REST-backed catalog. The cherry-pick conflicts are resolved;
request-cache code unavailable on `branch-1.3` was omitted.

### Why are the changes needed?

An authenticated caller without table access could submit fabricated
metrics because the report endpoint lacked an authorization expression.

Fix: #13980

### Does this PR introduce _any_ user-facing change?

Unauthorized reports return 403, reports for missing tables return 404,
and reports naming another table return 400.

### How was this patch tested?

- Ran Spotless for `server-common` and `iceberg-rest-server`.
- Passed `TestBaseMetadataAuthorizationMethodInterceptor`,
`TestIcebergMetadataAuthorizationMethodInterceptor`, and
`TestIcebergTableOperations.testReportTableMetrics`.

---------

Co-authored-by: roryqi <roryqi@datastrato.com>
Co-authored-by: roryqi <roryqi@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch-1.3 Automatically cherry-pick commit to branch-1.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug report] Iceberg REST accepts table metrics reports without table authorization

2 participants