feat: OAuth2 client initial work #29109
Merged
+210
−27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
We're planning to introduce OAuth2 client management to Superset, so the clients can be configured on the app, and assigned to multiple databases.
This PR is a first step in that direction, allowing client configuration to be stored in a the database
encrypted_extra
parameter. This allows us to add support for OAuth2 to more DB engine specs before starting the work on a full UI solution.In addition to reading the client configuration from
encrypted_extra
this PR also refactors the logic for triggering OAuth2, introducing a new method calledneeds_oauth2
to the DB engine spec. This is needed to give more flexibility to account for different OAuth2 providers.The PR also introduces a new trigger for OAuth2, when the
raw_connection
fails due to needing a personal user token.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Added tests.
ADDITIONAL INFORMATION