You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/04/08 12:52:30 UTC

Re: [PR] Validate task identity token claims with a typed schema [airflow]

jason810496 commented on code in PR #63604:
URL: https://github.com/apache/airflow/pull/63604#discussion_r3051427024


##########
airflow-core/src/airflow/api_fastapi/execution_api/datamodels/token.py:
##########
@@ -17,16 +17,32 @@
 
 from __future__ import annotations
 
-from typing import Any
+from typing import Literal
 from uuid import UUID
 
+from pydantic import ConfigDict
+
 from airflow.api_fastapi.core_api.base import BaseModel
 
+TokenScope = Literal["execution", "workload"]
+
+
+class TIClaims(BaseModel):
+    """
+    Validated JWT claims for a task identity token.
+
+    Only fields used by the Execution API (sub, scope) are explicitly typed.
+    JWTValidator already validates exp/iat/nbf/aud/etc. Extra claims are allowed.
+    """
+
+    model_config = ConfigDict(extra="allow")
+
+    sub: UUID

Review Comment:
   ```suggestion
   ```



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