You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2025/03/27 16:44:50 UTC

[PR] Cookies in non TLS mode [airflow]

pierrejeambrun opened a new pull request, #48453:
URL: https://github.com/apache/airflow/pull/48453

   Continuation of https://github.com/apache/airflow/pull/47859 to extend it to all auth managers.
   
   Cookies shouldn't have the attribute secure if the cluster is not using https


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cookies in non TLS mode [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #48453:
URL: https://github.com/apache/airflow/pull/48453#issuecomment-2758801004

   Also added handling in the SAM /ui setCookie, and doc update.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cookies in non TLS mode [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #48453:
URL: https://github.com/apache/airflow/pull/48453#discussion_r2017182725


##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/routes/login.py:
##########
@@ -63,10 +63,12 @@ def create_token_all_admins() -> RedirectResponse:
     )
 
     response = RedirectResponse(url=conf.get("api", "base_url"))
+
+    secure = bool(conf.get("api", "ssl_cert"))

Review Comment:
   thanks done



##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/router/login.py:
##########
@@ -83,7 +83,9 @@ def login_callback(request: Request):
     url = conf.get("api", "base_url")
     token = get_auth_manager().generate_jwt(user)
     response = RedirectResponse(url=url, status_code=303)
-    response.set_cookie(COOKIE_NAME_JWT_TOKEN, token, secure=True)
+
+    secure = bool(conf.get("api", "ssl_cert"))

Review Comment:
   same, and all other places



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cookies in non TLS mode [airflow]

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #48453:
URL: https://github.com/apache/airflow/pull/48453#discussion_r2017153306


##########
airflow-core/src/airflow/api_fastapi/auth/managers/simple/routes/login.py:
##########
@@ -63,10 +63,12 @@ def create_token_all_admins() -> RedirectResponse:
     )
 
     response = RedirectResponse(url=conf.get("api", "base_url"))
+
+    secure = bool(conf.get("api", "ssl_cert"))

Review Comment:
   ```suggestion
       secure = conf.getboolean("api", "ssl_cert")
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cookies in non TLS mode [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #48453:
URL: https://github.com/apache/airflow/pull/48453


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Cookies in non TLS mode [airflow]

Posted by "vincbeck (via GitHub)" <gi...@apache.org>.
vincbeck commented on code in PR #48453:
URL: https://github.com/apache/airflow/pull/48453#discussion_r2017154658


##########
providers/amazon/src/airflow/providers/amazon/aws/auth_manager/router/login.py:
##########
@@ -83,7 +83,9 @@ def login_callback(request: Request):
     url = conf.get("api", "base_url")
     token = get_auth_manager().generate_jwt(user)
     response = RedirectResponse(url=url, status_code=303)
-    response.set_cookie(COOKIE_NAME_JWT_TOKEN, token, secure=True)
+
+    secure = bool(conf.get("api", "ssl_cert"))

Review Comment:
   ```suggestion
       secure = conf.getboolean("api", "ssl_cert")
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org