Skip to content

[Cherry-pick to branch-1.3] [#12840] fix(lineage): Validate and authorize lineage events (#12850) - #12911

Merged
roryqi merged 2 commits into
branch-1.3from
cherry-pick-c0871fa5-to-branch-1.3
Sep 4, 2026
Merged

[Cherry-pick to branch-1.3] [#12840] fix(lineage): Validate and authorize lineage events (#12850)#12911
roryqi merged 2 commits into
branch-1.3from
cherry-pick-c0871fa5-to-branch-1.3

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Cherry-pick Information:

  • Original commit: c0871fa
  • Target branch: branch-1.3
  • Status: ✅ Conflicts resolved

The cherry-pick conflicts have been manually resolved and validated.

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

- Validate required OpenLineage RunEvent fields before dispatch.
- Register LineageOperations with the standard authorization
interception flow.
- Treat job.namespace as the event metalake (organization) when
authorization is enabled and reject input or output datasets from
another namespace.
- Resolve and validate every dataset target before authorization, with a
missing datasetType defaulting to TABLE.
- Reuse one request authorization context for the single event
organization while keeping current-user and active-role validation in
the shared interceptor.
- Authorize every input and output dataset with metadata-visibility
permissions.
- Document the identifier, type, and HTTP response contracts in the
OpenAPI specification.

### Why are the changes needed?

The lineage ingest endpoint accepted malformed events and allowed
authenticated callers to name datasets they could not access.

Fix: #12840

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

Yes.

- Invalid RunEvents and invalid authorization targets are rejected with
HTTP 400.
- Events referencing unauthorized datasets are rejected with HTTP 403.
- Authorization infrastructure and dispatcher failures return HTTP 500.
- Behavior remains unchanged when authorization is disabled.

### How was this patch tested?

- ./gradlew :server:test --tests
org.apache.gravitino.server.web.filter.authorization.TestLineageAuthorizationExecutor
-PskipITs --no-build-cache
- ./gradlew :server:test --tests
org.apache.gravitino.server.web.filter.TestGravitinoInterceptionService
-PskipITs --no-build-cache
- ./gradlew :lineage:test --tests
org.apache.gravitino.lineage.source.TestLineageOperations --tests
org.apache.gravitino.lineage.source.rest.TestLineageEventValidator
-PskipITs --no-build-cache
- ./gradlew :docs:build --no-build-cache
# Conflicts:
#	docs/open-api/lineage.yaml
#	server/src/main/java/org/apache/gravitino/server/web/filter/GravitinoInterceptionService.java
#	server/src/test/java/org/apache/gravitino/server/web/filter/TestGravitinoInterceptionService.java
@github-actions github-actions Bot added cherry-pick Automatically opened cherry-pick PR cherry-pick-conflict Cherry-pick has conflicts; needs human resolution before merge labels Sep 4, 2026
@github-actions
github-actions Bot requested a review from jerryshao September 4, 2026 06:21
@roryqi roryqi removed the cherry-pick-conflict Cherry-pick has conflicts; needs human resolution before merge label Sep 4, 2026
@roryqi roryqi changed the title [DO NOT MERGE] [Cherry-pick to branch-1.3] [#12840] fix(lineage): Validate and authorize lineage events (#12850) [Cherry-pick to branch-1.3] [#12840] fix(lineage): Validate and authorize lineage events (#12850) Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Author

Code Coverage Report

Overall Project 68.7% -0.09% 🟢
Files changed 67.62% 🟢

Module Coverage
aliyun 19.74% 🔴
api 47.62% 🟢
authorization-common 85.96% 🟢
aws 53.54% 🟢
azure 32.1% 🔴
catalog-common 10.4% -0.02% 🔴
catalog-fileset 80.51% 🟢
catalog-glue 69.24% 🟢
catalog-hive 79.42% 🟢
catalog-jdbc-clickhouse 84.7% 🟢
catalog-jdbc-common 45.47% 🟢
catalog-jdbc-doris 82.61% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.33% 🟢
catalog-jdbc-oceanbase 78.6% 🟢
catalog-jdbc-postgresql 83.39% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 77.27% 🟢
catalog-lakehouse-generic 59.35% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.86% -1.68% 🟢
catalog-lakehouse-paimon 82.17% 🟢
catalog-model 77.99% 🟢
cli 44.51% 🟢
client-java 78.31% 🟢
common 50.74% 🟢
core 82.96% -1.75% 🟢
filesystem-hadoop3 77.3% 🟢
flink 0.0% 🔴
flink-common 49.22% 🟢
flink-runtime 0.0% 🔴
gcp 32.2% 🔴
hadoop-common 15.43% 🔴
hive-metastore-common 53.77% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 58.18% -6.41% 🟢
iceberg-rest-server 73.87% -2.17% 🟢
idp-basic 86.02% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 24.42% 🔴
lance-rest-server 60.13% 🟢
lineage 59.39% +8.01% 🟢
optimizer 82.87% 🟢
optimizer-api 21.95% 🔴
server 88.77% -0.17% 🟢
server-common 76.25% +2.14% 🟢
spark 28.57% 🔴
spark-common 41.66% -3.04% 🟢
trino-connector 51.18% +2.07% 🟢
Files
Module File Coverage
catalog-common IcebergConstants.java 0.0% 🔴
catalog-lakehouse-iceberg IcebergCatalogOperations.java 79.86% 🟢
core FunctionMetaService.java 100.0% 🟢
ViewMetaService.java 100.0% 🟢
SchemaHookDispatcher.java 92.0% 🟢
FilesetHookDispatcher.java 85.29% 🟢
TableOperationDispatcher.java 84.22% 🟢
TopicHookDispatcher.java 82.61% 🟢
ViewOperationDispatcher.java 82.33% 🟢
PolicyManager.java 81.09% 🟢
PolicyMetadataObjectRelBaseSQLProvider.java 76.92% 🟢
FunctionHookDispatcher.java 71.43% 🟢
PolicyMetadataObjectRelPostgreSQLProvider.java 70.0% 🟢
CatalogManager.java 69.36% 🟢
AuthorizationUtils.java 63.86% 🟢
JobHookDispatcher.java 59.26% 🔴
MetadataObjectUtil.java 58.02% 🔴
ModelHookDispatcher.java 56.82% 🔴
TagHookDispatcher.java 47.62% 🔴
PolicyHookDispatcher.java 41.67% 🔴
MetalakeHookDispatcher.java 40.62% 🔴
AccessControlHookDispatcher.java 38.27% 🔴
CatalogHookDispatcher.java 33.33% 🔴
GravitinoEnv.java 12.5% 🔴
iceberg-common IcebergCatalogUtil.java 66.3% 🟢
IcebergCatalogWrapper.java 29.15% 🔴
iceberg-rest-server IcebergTableRenameOperations.java 93.75% 🟢
IcebergTableOperations.java 81.11% 🟢
IcebergCatalogWrapperManager.java 70.49% 🟢
DynamicIcebergConfigProvider.java 38.84% 🔴
RenameTableAuthzHandler.java 0.0% 🔴
lineage LineageEventValidator.java 100.0% 🟢
LineageOperations.java 100.0% 🟢
server AuthorizationExecutor.java 100.0% 🟢
GroupOperations.java 100.0% 🟢
UserOperations.java 100.0% 🟢
VersioningFilter.java 97.56% 🟢
TableOperations.java 97.37% 🟢
LineageAuthorizationExecutor.java 95.83% 🟢
GravitinoInterceptionService.java 92.57% 🟢
StatisticOperations.java 90.8% 🟢
GravitinoServer.java 61.36% 🟢
AuthorizeExecutorFactory.java 33.33% 🔴
server-common JcasbinAuthorizer.java 88.34% 🟢
MetadataAuthzHelper.java 60.69% 🟢
AuthorizationRequest.java 0.0% 🔴
AuthorizationExpressionConstants.java 0.0% 🔴
spark-common IcebergPropertiesConverter.java 86.36% 🟢
GravitinoCatalogManager.java 53.12% 🔴
GravitinoDriverPlugin.java 15.15% 🔴
GravitinoSparkConfig.java 0.0% 🔴
GravitinoIcebergCatalog.java 0.0% 🔴
IcebergPropertiesConstants.java 0.0% 🔴
trino-connector GravitinoSystemTable.java 100.0% 🟢
GravitinoConfig.java 88.34% 🟢
CatalogRegister.java 68.89% 🟢
GravitinoConnectorFactory.java 68.75% 🟢
GravitinoSystemTableFactory.java 63.64% 🟢
DropCatalogStoredProcedure.java 53.85% 🔴
CatalogConnectorManager.java 49.73% 🔴
GravitinoSystemConnector.java 30.23% 🔴
GravitinoSystemTableCatalog.java 22.5% 🔴
CreateCatalogStoredProcedure.java 12.82% 🔴
AlterCatalogStoredProcedure.java 9.26% 🔴
GravitinoSystemConnectorMetadata.java 0.0% 🔴

@roryqi
roryqi merged commit 954bc1f into branch-1.3 Sep 4, 2026
39 of 41 checks passed
@roryqi
roryqi deleted the cherry-pick-c0871fa5-to-branch-1.3 branch September 4, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick Automatically opened cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant