Skip to content

feat: OAuth2 database field#30126

Merged
betodealmeida merged 1 commit intomasterfrom
oauth2-client-field
Sep 4, 2024
Merged

feat: OAuth2 database field#30126
betodealmeida merged 1 commit intomasterfrom
oauth2-client-field

Conversation

@betodealmeida
Copy link
Member

SUMMARY

More work on Snowflake OAuth2 (this PR depends on #30082). This PR introduces a new field for the database configuration modal, allowing OAuth2 client information to be provided by the user:

Screenshot 2024-09-02 at 8 57 34 AM

The component combines the 5 different input fields, and then passes them inside the masked_encrypted_extra attribute on database CRUD:

{
  "oauth2_client_info": {
    "id": "123456",
    "secret": "XXXXXXXXXXXX",
    "authorization_request_uri": "https://account.snowflakecomputing.com/oauth/authorize",
    "token_request_uri": "https://account.snowflakecomputing.com/oauth/token-request",
    "scope": "refresh_token session:role:USERADMIN"
  }
}

(Note that ideally we would pass these in the parameters field, and let the DB engine spec build the object in encrypted_extra. But the build_sqlalchemy_uri method — as the name suggests — only builds an URI, so we would have to modify it to return a tuple with (uri, connect_args) if we passed them client information inside parameters, and also figure out a way to inform that these fields should be stored in encrypted_extra, not extra, so for now the frontend does the work. I left a small TODO for me to fix this in the future.)

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

See above.

TESTING INSTRUCTIONS

Adding tests.

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

@github-actions github-actions bot added the api Related to the REST API label Sep 2, 2024
validationErrors,
db,
}: FieldPropTypes) => {
console.error(db);
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed this.

@betodealmeida betodealmeida force-pushed the oauth2-client-field branch 2 times, most recently from 345d079 to fbeeb5a Compare September 3, 2024 13:56
@betodealmeida betodealmeida marked this pull request as ready for review September 3, 2024 13:56
@dosubot dosubot bot added authentication Related to authentication change:frontend Requires changing the frontend data:connect:snowflake Related to Snowflake labels Sep 3, 2024
@betodealmeida betodealmeida force-pushed the oauth2-client-field branch 2 times, most recently from 1cff541 to cea5d85 Compare September 3, 2024 14:50
@sadpandajoe
Copy link
Member

/testenv up

@sadpandajoe sadpandajoe requested a review from rtexelm September 3, 2024 18:52
@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2024

@sadpandajoe Ephemeral environment spinning up at http://34.222.11.9:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

Choose a reason for hiding this comment

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

This is super helpful!

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was surprised it didn't exist yet!

@betodealmeida betodealmeida changed the base branch from show-oauth2-errors to master September 4, 2024 00:12
@github-actions github-actions bot removed the api Related to the REST API label Sep 4, 2024
@betodealmeida betodealmeida merged commit ff449ad into master Sep 4, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2024

Ephemeral environment shutdown and build artifacts deleted.

@rusackas rusackas deleted the oauth2-client-field branch September 4, 2024 19:54
@sfirke sfirke mentioned this pull request Sep 5, 2024
9 tasks
nyohasstium pushed a commit to Webgains/superset that referenced this pull request Jan 2, 2025
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 5.0.0 First shipped in 5.0.0 labels Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

authentication Related to authentication 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:frontend Requires changing the frontend data:connect:snowflake Related to Snowflake size/L 🚢 5.0.0 First shipped in 5.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants