o-nikolas commented on code in PR #77209:
URL: https://github.com/apache/airflow/pull/77209#discussion_r4604887156
##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/routes/login.py:
##########
@@ -205,6 +207,27 @@ def _start_login(request: Request, mode: str) ->
RedirectResponse:
}
)
_write_pending_logins(request, response, pending)
+ if mode == LOGIN_MODE_REDIRECT:
+ cookie_path = get_cookie_path()
+ secure = _is_secure_request(request)
+ next_url = request.query_params.get("next")
+ if next_url and is_safe_url(next_url, request=request):
+ response.set_cookie(
+ COOKIE_NAME_LOGIN_NEXT_URL,
Review Comment:
+1 to moving `next` into the pending entry. One thing to watch when you do:
the cookie can hold up to five entries and nothing caps its size, so a few long
`next` URLs (base64 adds about a third) could push it past the ~4 KB browser
limit. The browser then ignores the new cookie, and that tab's callback finds
no matching login and 401s. Capping the stored length, or not storing `next`
past a few hundred characters and falling back to `base_url`, would avoid that.
--
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]