madhushreeag commented on code in PR #44365:
URL: https://github.com/apache/superset/pull/44365#discussion_r4198295541
##########
superset/config.py:
##########
@@ -384,6 +384,11 @@ def _try_json_readsha(filepath: str, length: int) -> str |
None:
"superset.dashboards.api.cache_dashboard_screenshot",
"superset.views.core.log",
"superset.views.datasource.views.samples",
+ # Minting a one-time login token is a server-to-server call from a trusted
+ # parent application's backend, authenticated by
+ # LOGIN_TOKEN_IDENTITY_RESOLVER rather than by a session cookie. There is
no
+ # session to forge against, and such a caller has no CSRF token to present.
+ "superset.security.api.login_token",
Review Comment:
Added `test_mint_is_csrf_exempt_with_protection_actually_on`. It turns real
protection on via a `csrf_enabled` context manager that runs the actual
`init_app`, rather than restating those defaults, which would mean
reimplementing part of what's being verified - then restores every `WTF_CSRF_*`
key, the `before_request` list, the context processors and `_exempt_views`. It
asserts: mint POSTs with no session and no CSRF token → 200, the token redeems
→ 302, and a declined caller → 401 rather than a CSRF error.
--
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]