KH-Coder865 opened a new pull request, #59611:
URL: https://github.com/apache/airflow/pull/59611

   ## Problem:
   Currently, calling auth_user_oauth() outside a Flask request context 
triggers RuntimeError: Working outside request context. The only workaround is 
overriding the private _rotate_session_id method, which is not recommended.
   
   ## Solution:
   
   Add a rotate_session_id=False option to skip session rotation safely.
   
   Implement TheOverrideFabAuthManager.create_token() that wraps the token 
creation in an application and request context.
   
   This approach avoids touching private methods while enabling token 
generation for API clients or background processes.
   
   ## Testing:
   
   Verified token generation works without a request context.
   
   Tested compatibility with Airflow API v2 calls.
   
   Existing FAB authentication tests pass.
   
   ## Notes:
   
   No backwards-incompatible changes.
   
   No new dependencies.
   
   ## Closes / Related Issues:
   
   Closes: #59600


-- 
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]

Reply via email to