chore: replace selenium user with fixed user (#31844)

This commit is contained in:
Ville Brofeldt
2025-01-22 12:46:06 -08:00
committed by GitHub
parent 1d6423e71f
commit 7482b20f7b
25 changed files with 304 additions and 215 deletions

View File

@@ -177,10 +177,9 @@ By default, Alerts and Reports are executed as the owner of the alert/report obj
just change the config as follows (`admin` in this example):
```python
from superset.tasks.types import ExecutorType
from superset.tasks.types import FixedExecutor
THUMBNAIL_SELENIUM_USER = 'admin'
ALERT_REPORTS_EXECUTE_AS = [ExecutorType.SELENIUM]
ALERT_REPORTS_EXECUTORS = [FixedExecutor("admin")]
```
Please refer to `ExecutorType` in the codebase for other executor types.

View File

@@ -94,10 +94,9 @@ By default thumbnails are rendered per user, and will fall back to the Selenium
To always render thumbnails as a fixed user (`admin` in this example), use the following configuration:
```python
from superset.tasks.types import ExecutorType
from superset.tasks.types import FixedExecutor
THUMBNAIL_SELENIUM_USER = "admin"
THUMBNAIL_EXECUTE_AS = [ExecutorType.SELENIUM]
THUMBNAIL_EXECUTORS = [FixedExecutor("admin")]
```
@@ -130,8 +129,6 @@ def init_thumbnail_cache(app: Flask) -> S3Cache:
THUMBNAIL_CACHE_CONFIG = init_thumbnail_cache
# Async selenium thumbnail task will use the following user
THUMBNAIL_SELENIUM_USER = "Admin"
```
Using the above example cache keys for dashboards will be `superset_thumb__dashboard__{ID}`. You can