Repository navigation
Fixes #35078: authorize VIEW_BASIC on lineage edge-details read endpoints - #35140
Closed
detail-app[bot] wants to merge 1 commit into
Closed
detail-app[bot] wants to merge 1 commit into
detail-app[bot] wants to merge 1 commit into
Conversation
Contributor
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
mohityadav766
approved these changes
Oct 15, 2026
mohityadav766
added this pull request to the merge queue
Oct 15, 2026
4 tasks done
Contributor
|
Superseded by #35537, which combines this change with other queued fixes. |
github-merge-queue
Bot
removed this pull request from the merge queue due to a manual request
Oct 15, 2026
Contributor
🚦 Removed from the merge queue —
|
mohityadav766
added a commit
that referenced
this pull request
Oct 16, 2026
…dav-prs-combine #34838 on main already authorizes VIEW_BASIC on both lineage edge-details reads through LineageRepository.getLineageEdgeEnds, and removed getLineageEdgeByFQN. LineageResource and LineageRepository take main's version, which drops #35140's duplicate check and its now-unused getLineageEdgeRecord. The #35140 unit tests now target getLineageEdgeEnds and getLineageEdge; its LineageResourceIT cases are unchanged.
timothybrush
pushed a commit
to timothybrush/OpenMetadata
that referenced
this pull request
Oct 16, 2026
…, SAML tenant GUIDs, dead-code removals (open-metadata#35537) * Fixes open-metadata#35106: gate certification tag strip on supportsCertification in BundleWarmupBatcher (open-metadata#35167) * chore(searchIndex): remove unused ReindexingMetrics methods (open-metadata#35392) * chore: remove unused TeamsMessage Fact/Action model classes (open-metadata#35386) * chore: remove unused awaitVectorCompletionWithDetails and VectorCompletionResult (open-metadata#35389) * Fixes open-metadata#35078: authorize VIEW_BASIC on lineage edge-details read endpoints (open-metadata#35140) * Fixes open-metadata#34464: Accept upper/mixed-case Azure AD tenant GUIDs in SAML validation (open-metadata#34522) --------- Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com>
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.



Detail bug report: View on Detail
Describe your changes:
Fixes #35078
The
getLineageEdge(by-id) andgetLineageEdgeByName(by-FQN) read endpoints inLineageResourcecalled the DAO directly with noauthorizer.authorize(...)and nogetSubjectContext(...), so any authenticated caller could read the rawLineageDetails(includingsqlQuery,columnsLineage,pipeline) for arbitrary entity pairs. This bypassed both the per-entityVIEW_BASICauthorization and theDomainOnlyAccessRoledomain isolation thatget/getByNameenforce viapruneLineageByDomain. Every sibling PUT/PATCH/DELETE endpoint in the same resource already authorizes both endpoints; the two GETs were the only read endpoints that performed zero authorization.I worked on closing this authorization gap because the edge-details endpoints are the sole read path through which a
DomainOnlyAccessRoleuser can exfiltrate cross-domain lineage (the graph reads prune foreign-domain nodes, but the edge reads returned the raw edge data with no check).Type of change:
High level design:
The by-id path (
/{fromId}/{toId}) has no entity-type segments in the URL, so the fix resolvesfromEntity/toEntityfrom the storedentity_relationshiprow via a newLineageRepository.getLineageEdgeRecord(UUID, UUID)(using the existingrelationshipDAO().getRecord(...)already called in 5+ places). If the record is absent the endpoint returns 404 before any authz check, preserving the prior behavior. Both endpoints then call the existing three-argumentauthorizeLineageReference(securityContext, entityReference, MetadataOperation.VIEW_BASIC)helper on both endpoints before the DAO read.VIEW_BASICis used (notEDIT_LINEAGE) to match the scene API's focus-entity read (authorizeLineageSceneFocus, line 144) —EDIT_LINEAGEwould 403 the view-onlyDataConsumerusers who legitimately click a visible edge in the Lineage Map. The by-FQN variant resolves references withInclude.NON_DELETED, matching the DAO's own lookup so authz succeeds/fails on exactly the entity the DAO queries.Tests:
Use cases covered
DomainOnlyAccessRoleuser confined to domain A is denied (403) when reading edge details for an edge where either endpoint lies in a foreign domain B — both by-id and by-FQN.DomainOnlyAccessRoleuser can still read edge details for edges within their own domain (no over-restriction).VIEW_BASICfor foreign-domain tables is denied edge details touching a denied table — both by-id and by-FQN.VIEW_BASIC(notEDIT_LINEAGE) for both endpoints.getLineageEdgeByName; PATCH +getLineageEdgeByName; by-id GET inTableResourceIT) continue to pass.Unit tests
openmetadata-service/src/test/java/org/openmetadata/service/resources/lineage/LineageResourceGetLineageEdgeAuthorizationTest.java— 10 cases covering the by-id and by-FQN endpoints: deny-on-from, deny-on-to, allow-both, 404-before-authz, andVIEW_BASIC-not-EDIT_LINEAGEcapture; plusInclude.NON_DELETEDscope verification.LineageRepositoryTest.java— 3 new cases forgetLineageEdgeRecord: delegates togetRecordwithRelationship.UPSTREAM, null passthrough, and entity-type carriage.Backend integration tests
openmetadata-integration-tests/for the changed API endpoints.LineageResourceIT.testGetLineageEdgeEnforcesDomainIsolationForEdgeReads— cross-domainDomainOnlyAccessRoledenial (by-id and by-FQN), with graph-pruning positive control, same-domain readability, and admin regression check.LineageResourceIT.testGetLineageEdgeEnforcesViewBasicPolicyDenyForEdgeReads— policy-deniedVIEW_BASICdenial (by-id and by-FQN), with admin control.Ran locally (Testcontainers MySQL + Elasticsearch):
LineageResourceIT— 62 tests, 0 failures, 3 pre-existing skips.ServiceLineageRefcountIT— 4 tests, 0 failures (404 regression).TableResourceIT— 346 tests, 0 failures (admin by-id edge read regression).DomainIsolationIT— 9 tests, 0 failures (domain isolation regression).LineageResourceGetLineageEdgeAuthorizationTest+LineageRepositoryTest— 39 tests, 0 failures.LineagePermissionFilterTest,LineageDomainFilterTest,LineageSceneResolverTest,LineageGraphPrunerTest,LineageScene*Test) — 127 tests total, 0 failures.mvn spotless:checkonopenmetadata-serviceandopenmetadata-integration-tests— clean.Manual testing performed
N/A — coverage is via the unit and integration tests above.
UI screen recording / screenshots:
Not applicable.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Automatic Fixes PRs can be configured here.