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

feat: split database information #24067

Merged
merged 4 commits into from
May 22, 2023
Merged

feat: split database information #24067

merged 4 commits into from
May 22, 2023

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented May 15, 2023

SUMMARY

Move potentially sensitive database information (SQLAlchemy URI, eg) to a separate endpoint that can be only accessed by the admin (can_write on Database).

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

Added new test, updated old one.

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 18, 2023

Codecov Report

Merging #24067 (1e273bd) into master (d96b72d) will increase coverage by 0.00%.
The diff coverage is 75.52%.

❗ Current head 1e273bd differs from pull request most recent head cae6057. Consider uploading reports for the commit cae6057 to get more accurate results

@@           Coverage Diff            @@
##           master   #24067    +/-   ##
========================================
  Coverage   68.18%   68.18%            
========================================
  Files        1941     1952    +11     
  Lines       75287    75390   +103     
  Branches     8177     8206    +29     
========================================
+ Hits        51332    51405    +73     
- Misses      21860    21878    +18     
- Partials     2095     2107    +12     
Flag Coverage Δ
hive ?
javascript 54.68% <73.76%> (+0.14%) ⬆️
mysql 78.94% <67.92%> (?)
postgres 79.01% <67.92%> (+0.04%) ⬆️
presto 53.25% <36.98%> (+0.15%) ⬆️
python 82.64% <78.49%> (-0.07%) ⬇️
sqlite 77.55% <66.41%> (+0.05%) ⬆️
unit 53.29% <43.39%> (+0.30%) ⬆️

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

Impacted Files Coverage Δ
...chart-controls/src/shared-controls/dndControls.tsx 58.33% <ø> (ø)
...set-ui-core/src/ui-overrides/ExtensionsRegistry.ts 100.00% <ø> (ø)
...ackages/superset-ui-core/src/utils/featureFlags.ts 100.00% <ø> (ø)
...hart-echarts/src/MixedTimeseries/transformProps.ts 0.00% <0.00%> (ø)
...lugin-chart-echarts/src/Timeseries/transformers.ts 56.95% <ø> (-0.29%) ⬇️
...n-chart-handlebars/src/plugin/controls/columns.tsx 15.78% <0.00%> (+0.78%) ⬆️
superset-frontend/src/SqlLab/actions/sqlLab.js 66.41% <ø> (-2.35%) ⬇️
...frontend/src/SqlLab/components/ResultSet/index.tsx 63.05% <ø> (+0.39%) ⬆️
superset-frontend/src/components/Modal/Modal.tsx 85.89% <ø> (ø)
...et-frontend/src/components/TableSelector/index.tsx 81.08% <0.00%> (ø)
... and 149 more

... and 13 files with indirect coverage changes

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

superset/databases/api.py Outdated Show resolved Hide resolved
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/google-spreadsheets-demo-servi%40black-sanctum-314419.iam.gserviceaccount.com",
},
Copy link
Member

Choose a reason for hiding this comment

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

is this a real google account?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is, with the private key omitted.

superset/databases/api.py Outdated Show resolved Hide resolved
tests/unit_tests/databases/api_test.py Outdated Show resolved Hide resolved
Copy link
Member

@dpgaspar dpgaspar 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 doing this!

Do you think non Admin users still need access to /api/v1/database/<id> ?

superset/databases/api.py Outdated Show resolved Hide resolved
@betodealmeida
Copy link
Member Author

Thanks for doing this!

Do you think non Admin users still need access to /api/v1/database/<id> ?

Yeah, SQL Lab broke when I removed the access.

@betodealmeida betodealmeida merged commit c3b96d1 into master May 22, 2023
54 checks passed
@eschutho eschutho added the risk:breaking-change Issues or PRs that will introduce breaking changes label Oct 2, 2023
@eschutho
Copy link
Member

eschutho commented Oct 2, 2023

@betodealmeida I added a label for breaking-change on this PR since it removes some properties from the API response. LMK if you think otherwise, though.

@mistercrunch mistercrunch added 🏷️ 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
@mistercrunch mistercrunch deleted the improve_perms branch March 26, 2024 17:56
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 risk:breaking-change Issues or PRs that will introduce breaking changes size/L 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants