You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "mikebridge (via GitHub)" <gi...@apache.org> on 2026/10/06 01:15:13 UTC

[PR] fix(security): bind contextual access checks to the datasource type and id [superset]

mikebridge opened a new pull request, #45002:
URL: https://github.com/apache/superset/pull/45002

   ### SUMMARY
   
   Contextual access checks (chart viewers, native-filter value requests, dashboard member charts and multi-layer chart children for embedded guests) now match a chart or filter target on both the datasource's type and its id, rather than on the id alone or on object identity. Native filter targets without a type, or whose stored type is null, continue to refer to SQL datasets, and the optional guest-token `datasets` allowlist applies to SQL datasets only. Drill By applies the same type-and-id check to its source chart, and guest-token minting with a dataset allowlist checks only the SQL datasets the allowlist can grant. Authorized guests can read member charts on semantic views in the same way as on SQL datasets. The embedding docs describe the scope.
   
   Depends on #44987; please merge after it.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A (backend).
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/unit_tests/security/typed_datasource_access_test.py tests/unit_tests/security/test_guest_token_dataset_allowlist.py tests/unit_tests/subjects/test_raise_for_access.py tests/unit_tests/security/manager_test.py`
   - Covers chart-viewer, native-filter (including legacy untyped and null-typed targets, and sort metrics), Drill By, guest member-chart and multi-layer child access, token minting, and the guest dataset allowlist, for both SQL datasets and semantic views, each allowed and denied.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   Risk: low to medium. Access checks become stricter where a type did not match; authorized semantic-view member charts become readable by embedded guests.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(security): bind contextual access checks to the datasource type and id [superset]

Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #45002:
URL: https://github.com/apache/superset/pull/45002#issuecomment-6007315118

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 5aad2f65d0b6a1802146e8cf1258f15ab9f3c7aa |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6ac44ba2e166fa0008d6dd61 |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-45002--superset-docs-preview.netlify.app](https://deploy-preview-45002--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQ1MDAyLS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.BiNeKJ98BD3qykCOWX6O9tX9IItU5xqqQgueFRR34Qs)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#Dcq7DYAgEADQXa6WBJBciBs4xsFhKFQInwKNu0v3ivdCLunKDTaABVyh28fp6oXSq1mtaCMHFkyNaurFB0G9xWdeDvlMY-e5kbwxjnRQiAdJKS0jMyr4fg) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-45002--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(security): bind contextual access checks to the datasource type and id [superset]

Posted by "rebenitez1802 (via GitHub)" <gi...@apache.org>.
rebenitez1802 merged PR #45002:
URL: https://github.com/apache/superset/pull/45002


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(security): bind contextual access checks to the datasource type and id [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #45002:
URL: https://github.com/apache/superset/pull/45002#issuecomment-6007285566

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(security): bind contextual access checks to the datasource type and id [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #45002:
URL: https://github.com/apache/superset/pull/45002#issuecomment-6007547363

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/45002?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `16.66667%` with `10 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 66.10%. Comparing base ([`0c6373c`](https://app.codecov.io/gh/apache/superset/commit/0c6373cd9f01326ac2cfe0bd96579d4daa8c8849?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5aad2f6`](https://app.codecov.io/gh/apache/superset/commit/5aad2f65d0b6a1802146e8cf1258f15ab9f3c7aa?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/45002?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [superset/security/manager.py](https://app.codecov.io/gh/apache/superset/pull/45002?src=pr&el=tree&filepath=superset%2Fsecurity%2Fmanager.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvc2VjdXJpdHkvbWFuYWdlci5weQ==) | 16.66% | [10 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/45002?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (0c6373c) and HEAD (5aad2f6). Click for more details.
   > 
   > <details><summary>HEAD has 4 uploads less than BASE</summary>
   >
   >| Flag | BASE (0c6373c) | HEAD (5aad2f6) |
   >|------|------|------|
   >|python|7|3|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #45002       +/-   ##
   ===========================================
   - Coverage   82.36%   66.10%   -16.26%     
   ===========================================
     Files        2997     2997               
     Lines      185519   185524        +5     
     Branches    42938    42939        +1     
   ===========================================
   - Hits       152795   122636    -30159     
   - Misses      29970    60204    +30234     
   + Partials     2754     2684       -70     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `36.30% <8.33%> (+<0.01%)` | :arrow_up: |
   | [mysql](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [postgres](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.17% <8.33%> (+<0.01%)` | :arrow_up: |
   | [python](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.14% <16.66%> (-31.16%)` | :arrow_down: |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.01% <16.66%> (+<0.01%)` | :arrow_up: |
   | [unit](https://app.codecov.io/gh/apache/superset/pull/45002/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/45002?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(security): bind contextual access checks to the datasource type and id [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #45002:
URL: https://github.com/apache/superset/pull/45002#issuecomment-6023712442

   ## CodeAnt PR Risk: Low Risk
   
   - The PR appears safe to merge; datasource authorization now matches both datasource type and ID.
   - Guest-token dataset allowlists are limited to SQL datasets, with focused tests covering chart, native-filter, and legacy-target access.
   
   **Assessed commit:** `36e55759d1df`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(security): bind contextual access checks to the datasource type and id [superset]

Posted by "mikebridge (via GitHub)" <gi...@apache.org>.
mikebridge commented on PR #45002:
URL: https://github.com/apache/superset/pull/45002#issuecomment-6025958821

   @aminghadersohi thanks — added one parametrized test (0db8cb0b69) covering a datasetId of `True`, `7.0` and a missing datasource. Removing the bool guard, the int guard or the None arm now makes the matching case fail.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org