-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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(ssh_tunnel): SQLAlchemy Form UI #22513
Conversation
…te-sshtunnelconfig-tbl
…erset into create-sshtunnelconfig-tbl
- Add visual test to confirm the new SSH Tunnel form fields are present if we click the toggle button
- Add extra UI tests for our SSH Tunnel Form
- Add new test to consider changing the login method used in SSH Tunnel Form
superset/databases/ssh_tunnel/dao.py
Outdated
The masked values should be unmasked before the ssh tunnel is updated. | ||
""" | ||
if properties.get("password") == PASSWORD_MASK: | ||
properties["password"] = model.password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should move this logic to the frontend, basically if the field hasn't been updated we shouldn't send it in the payload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, our API supports PATCH kind of updates, however, the response of the GET already has the masked password thus it's stored in the reducer, so when calling the API to update let's say the server_port
, we send the whole ssh_tunnel
object, not just updated properties. Because of that, the API would assume you're trying to update the password when you were not. Pretty much like we are doing for other masked values in our forms.
superset-frontend/src/views/CRUD/data/database/DatabaseModal/index.tsx
Outdated
Show resolved
Hide resolved
- Hide the entire form behind the feature flag
- Fix TestConnection when editing a DB with SSH Tunnel attached to it - Add new unmask_password_info util method for SSH Tunnels
- Add ssh_tunnel id in our response for the GET endpoint of DB so we can call test_connection endpoint without depending on DB's name
@@ -73,6 +73,7 @@ export interface FieldPropTypes { | |||
onRemoveTableCatalog: (idx: number) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also we need to check the available endpoint to see if a given engine allows ssh tunneling
https://github.com/apache/superset/blob/master/superset/db_engine_specs/base.py#L196
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Ok, yeah, IIRC there a engine_information
property we are getting in the UI with the supports_file_upload
, so we might need to include this one there and use it. Thanks!
- Use the allow_ssh_tunneling flag from the db_engine along with the feature flag to display the SSH Tunnel form, so, if a DB engine does not support SSH Tunnels, nothing gets displayed. Right now, only Postgres does
- Fix tests with proper flag values
- More fixes to tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- Fix test
SUMMARY
Add our a new
SSHTunnelForm
component that will be used to set tunnels for our Databases, right now only works when using SQLAlchemy URIs.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION