GayathriSrividya commented on code in PR #67944:
URL: https://github.com/apache/airflow/pull/67944#discussion_r3354883639


##########
airflow-core/src/airflow/api_fastapi/execution_api/app.py:
##########
@@ -141,7 +148,18 @@ async def dispatch(self, request: Request, call_next):
             try:
                 async with svcs.Container(request.app.state.svcs_registry) as 
services:
                     validator: JWTValidator = await services.aget(JWTValidator)
-                    claims = await validator.avalidated_claims(token, {})
+                    try:
+                        claims = await validator.avalidated_claims(token, {})
+                    except pyjwt.ExpiredSignatureError:
+                        # Token may have expired between the auth check and 
here
+                        # (e.g. token lifetime boundary crossed during request
+                        # processing). Re-validate with a short grace period so
+                        # the client receives a fresh replacement token and can
+                        # retry automatically. The signature and all other
+                        # claims are still fully verified.
+                        claims = await validator.avalidated_claims(
+                            token, {}, extra_leeway=self.REISSUE_GRACE_LEEWAY
+                        )

Review Comment:
   Since we do not seem to be aligned on the fix for this issue, and the 
discussion is no longer feeling productive while I am trying to explain my 
reasoning, I am going to close this PR.
   
   I also want to clarify that this is not “LLM slop,” as assumed. I manually 
review everything before posting anything, including the code, tests, and 
comments. I contributed this in good faith and would have been happy to address 
specific technical concerns with the implementation.



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