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

   ### SUMMARY
   
   The legacy ``Api.query_form_data`` (``GET /api/v1/form_data/?slice_id=``)
   returned ``slc.form_data`` verbatim with only ``@has_access_api`` as the
   gate, which is satisfied by any authenticated user (and by ``Public``
   role on deployments using ``PUBLIC_ROLE_LIKE``). The sibling
   ``Api.query()`` already validates via
   ``query_context.raise_for_access()``, and the modern ``ChartRestApi.get``
   returns 404 to callers without ``datasource_access``. This brings
   ``query_form_data`` to the same bar.
   
   To avoid introducing a status-code-based existence oracle (where a
   non-existent ``slice_id`` returns 200 + ``{}`` while a forbidden one
   returns 403), the ``SupersetSecurityException`` is caught and
   normalised to the same 404 ``ChartRestApi.get`` uses, so callers
   cannot distinguish ``missing`` from ``forbidden``.
   
   ### BEFORE/AFTER SCREENSHOTS
   
   N/A (server-side authorisation change).
   
   ### TESTING INSTRUCTIONS
   
   ```
   pytest tests/integration_tests/charts/api_tests.py -k query_form_data -v
   ```
   
   The added ``test_query_form_data_no_data_access`` mirrors the canonical
   ``test_get_chart_no_data_access`` pattern (Gamma user, "Girl Name Cloud"
   chart, 404 assertion) and adds defence-in-depth body assertions so a
   regression that returned a partial form_data dict inside an error
   envelope is still caught.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to