You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2025/01/30 16:44:47 UTC
[PR] feat: improve GSheets OAuth2 [superset]
betodealmeida opened a new pull request, #32048:
URL: https://github.com/apache/superset/pull/32048
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
The GSheets database modal has some inconsistencies after OAuth2 was introduced. The current modal asks if the user wants to access "public sheets" or "public and private sheets":
<img width="491" alt="Screenshot 2025-01-30 at 11 02 16 AM" src="https://github.com/user-attachments/assets/db39a92a-efa6-4f8c-a3a6-121ee157a13b" />
If the user selects the latter a new input appears, so the user can provide service account credentials, either by uploading a JSON file or pasting the credentials:
<img width="492" alt="Screenshot 2025-01-30 at 11 04 05 AM" src="https://github.com/user-attachments/assets/80962255-6aba-48a0-a91e-535f83372970" />
With the introduction of OAuth2 (https://github.com/apache/superset/pull/27631) there's now a new way of accessing private sheets.
This PR does the following:
1. Remove the "public"/"public and private" dropdown.
2. Informs the user that in order to access private sheets they need to either provide service account credentials or OAuth2 client information.
3. Adds an explicit input for OAuth2 client information (instead of requiring the user to add it to "encrypted extra").
4. Removes the need for adding at least one "table" (a sheet URL with an associated name).
This is how it looks with this PR:
<img width="487" alt="Screenshot 2025-01-30 at 11 22 05 AM" src="https://github.com/user-attachments/assets/efc9d138-4d32-4537-a562-cc5ca6c9e06f" />
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
See above.
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: improve GSheets OAuth2 [superset]
Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on code in PR #32048:
URL: https://github.com/apache/superset/pull/32048#discussion_r1970623277
##########
superset/commands/database/validate.py:
##########
@@ -96,7 +96,7 @@ def run(self) -> None:
server_cert=self._properties.get("server_cert", ""),
extra=self._properties.get("extra", "{}"),
impersonate_user=self._properties.get("impersonate_user", False),
- encrypted_extra=serialized_encrypted_extra,
+ encrypted_extra=json.dumps(encrypted_extra),
Review Comment:
### Double JSON Encoding of encrypted_extra <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The `encrypted_extra` value is being double JSON encoded because `encrypted_extra` is already a parsed JSON object from `serialized_encrypted_extra`.
###### Why this matters
Double JSON encoding will cause issues when trying to decrypt or use the encrypted_extra values later, as it will contain escaped quotes and require double parsing.
###### Suggested change ∙ *Feature Preview*
Use the original serialized value instead of re-encoding:
```python
encrypted_extra=serialized_encrypted_extra
```
</details>
<sub>
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/8a11a32a-1737-4cf0-a336-6e00fbcf73c7?suggestedFixEnabled=true)
💬 Chat with Korbit by mentioning @korbit-ai.
</sub>
<!--- korbi internal id:4d4a4cdc-0681-4e4f-b5c9-3865192480fa -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: improve GSheets OAuth2 [superset]
Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on PR #32048:
URL: https://github.com/apache/superset/pull/32048#issuecomment-2625024570
Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment `/korbit-review`.
> Your admin can change your review schedule in the [Korbit Console](https://app.korbit.ai/settings)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: improve GSheets OAuth2 [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida commented on code in PR #32048:
URL: https://github.com/apache/superset/pull/32048#discussion_r1970671295
##########
superset/commands/database/validate.py:
##########
@@ -96,7 +96,7 @@ def run(self) -> None:
server_cert=self._properties.get("server_cert", ""),
extra=self._properties.get("extra", "{}"),
impersonate_user=self._properties.get("impersonate_user", False),
- encrypted_extra=serialized_encrypted_extra,
+ encrypted_extra=json.dumps(encrypted_extra),
Review Comment:
```python
encrypted_extra = json.loads(serialized_encrypted_extra)
```
Dumping again instead of using `serialized_encrypted_extra` because it might have changed in the call to `engine_spec.build_sqlalchemy_uri`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: improve GSheets OAuth2 [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida commented on PR #32048:
URL: https://github.com/apache/superset/pull/32048#issuecomment-2683374204
Updated CSS:
<img width="903" alt="Screenshot 2025-02-24 at 2 57 13 PM" src="https://github.com/user-attachments/assets/366505d5-cbc2-44ed-bcfa-669879110363" />
<img width="496" alt="Screenshot 2025-02-25 at 3 53 27 PM" src="https://github.com/user-attachments/assets/12871580-e506-4189-9206-c00e0173872d" />
<img width="498" alt="Screenshot 2025-02-25 at 4 12 10 PM" src="https://github.com/user-attachments/assets/12c55cbd-9428-4735-b0fa-2401b25a4764" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: improve GSheets OAuth2 [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida merged PR #32048:
URL: https://github.com/apache/superset/pull/32048
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org