Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: db validate parameters permission #24185

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

dpgaspar
Copy link
Member

@dpgaspar dpgaspar commented May 23, 2023

SUMMARY

Restricts access to:

  • /api/v1/database/validate_parameters/, changes the necessary permission from can_read to can_write on Database

  • /api/v1/database/test_connection/, changes the necessary permission from can_read to can_write on Database

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #24185 (cee1529) into master (18d2257) will not change coverage.
The diff coverage is n/a.

❗ Current head cee1529 differs from pull request most recent head 4e2fd6f. Consider uploading reports for the commit 4e2fd6f to get more accurate results

@@           Coverage Diff           @@
##           master   #24185   +/-   ##
=======================================
  Coverage   57.24%   57.24%           
=======================================
  Files        1957     1957           
  Lines       75624    75624           
  Branches     8223     8223           
=======================================
  Hits        43294    43294           
  Misses      30222    30222           
  Partials     2108     2108           
Flag Coverage Δ
hive 53.39% <ø> (ø)
presto 53.32% <ø> (ø)
python 59.93% <ø> (ø)
unit 53.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/constants.py 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update any of the tests? Or add a new one?

@dpgaspar
Copy link
Member Author

Do we need to update any of the tests? Or add a new one?

Good point! probably a test to make sure Gamma user's don't access these. I'll add it

@john-bodley
Copy link
Member

john-bodley commented May 23, 2023

@dpgaspar why are we changing these from can_read to can_write for both these endpoints given (in theory) they're read requests, i.e., the underlying model is not being augmented.

Maybe providing a more detailed PR description would be helpful.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix 👍

@michael-s-molina
Copy link
Member

michael-s-molina commented May 23, 2023

@dpgaspar Can you add a note in the Breaking Changes section for this change?

@dpgaspar dpgaspar merged commit 8fab3db into apache:master Jun 5, 2023
29 checks passed
@dpgaspar dpgaspar deleted the fix/db-val-param-perms branch June 5, 2023 12:06
@mistercrunch mistercrunch added 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS v2.1 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants