villebro opened a new pull request, #22328:
URL: https://github.com/apache/superset/pull/22328
### SUMMARY
This PR adds support for generating user-specific thumbnails. This is a
typical requirement in environments where some form of user impersonation is
being used, and sharing thumbnails across all users with access to the same
dashboards/charts could leak sensitive data.
### AFTER
This chart thumbnail was cached using the following query on a Trino
database connection using user impersonation with the following virtual dataset:
```sql
select current_user as user, 1 as num union all
select 'Jinja: {{ current_username() }}' as user, 2 as num
```

As can be seen, both the `current_user` (rendered by Trino) and `{{
current_username() }}` (rendered by Superset) both show the user as being
`v_brofeldt`, i.e. not a service account.
### BEFORE
When I changed the chart to reference a postgres database with basic auth
using the username `postgres` and `THUMBNAIL_EXECUTE_AS =
[ExecutorType.SELENIUM]` (=same as previous behavior), the result was as
follows:

### TESTING INSTRUCTIONS
### 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]