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: accept old database payload #21923

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

betodealmeida
Copy link
Member

SUMMARY

#21248 fixed a vulnerability issue where credentials stored in encrypted_extra were being displayed to all users who could see the database. Unfortunately the PR changed the schema used for databases CRUD (create, update, validate parameters, etc.) since one of the fields was renamed from encrypted_extra to masked_encrypted_extra. This is a breaking change that affected clients talking to Superset APIs.

This PR adds some pre-load validation to the schema, so that the old payload with encrypted_extra is still supported.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

I added a unit test.

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 Oct 24, 2022

Codecov Report

Merging #21923 (2cb5874) into master (88e98d5) will decrease coverage by 9.93%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master   #21923      +/-   ##
==========================================
- Coverage   65.51%   55.58%   -9.94%     
==========================================
  Files        1807     1807              
  Lines       69183    69191       +8     
  Branches     7405     7405              
==========================================
- Hits        45325    38459    -6866     
- Misses      21948    28822    +6874     
  Partials     1910     1910              
Flag Coverage Δ
hive 52.92% <62.50%> (?)
mysql ?
postgres ?
presto 52.82% <62.50%> (?)
python 57.96% <100.00%> (-20.58%) ⬇️
sqlite ?
unit 51.09% <100.00%> (?)

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

Impacted Files Coverage Δ
superset/databases/schemas.py 84.87% <100.00%> (-10.18%) ⬇️
superset/utils/dashboard_import_export.py 0.00% <0.00%> (-100.00%) ⬇️
superset/tags/core.py 4.54% <0.00%> (-95.46%) ⬇️
superset/key_value/commands/update.py 0.00% <0.00%> (-90.91%) ⬇️
superset/key_value/commands/delete.py 0.00% <0.00%> (-87.88%) ⬇️
superset/key_value/commands/delete_expired.py 0.00% <0.00%> (-84.00%) ⬇️
superset/dashboards/commands/importers/v0.py 15.62% <0.00%> (-76.25%) ⬇️
superset/datasets/commands/create.py 30.61% <0.00%> (-69.39%) ⬇️
superset/datasets/commands/update.py 25.00% <0.00%> (-69.05%) ⬇️
superset/datasets/commands/importers/v0.py 24.03% <0.00%> (-69.00%) ⬇️
... and 319 more

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

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@betodealmeida betodealmeida merged commit 1388f21 into apache:master Oct 25, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants