[Cherry-pick to branch-1.3] [#12840] fix(lineage): Validate and authorize lineage events (#12850) - #12911
Merged
Merged
Conversation
### 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
Author
Code Coverage Report
Files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick Information:
branch-1.3The cherry-pick conflicts have been manually resolved and validated.