ashb commented on code in PR #74586:
URL: https://github.com/apache/airflow/pull/74586#discussion_r4248386286


##########
task-sdk/src/airflow/sdk/importers/yaml_importer/models.py:
##########
@@ -132,11 +146,39 @@ class XComRef(_MarkerRef):
 
 
 class TemplateRef(_MarkerRef):
-    """A Jinja template."""
+    """
+    A Jinja template, rendered server-side.
+
+    ``source`` is a Jinja string, or a :class:`FileRef` to load a template 
file.
+    """
 
     _marker_keys = TEMPLATE_KEYS
 
-    source: str = Field(serialization_alias="$t", 
validation_alias=AliasChoices(*TEMPLATE_KEYS))
+    source: str | FileRef = Field(serialization_alias="$t", 
validation_alias=AliasChoices(*TEMPLATE_KEYS))
+
+
+class FileRef(_MarkerRef):

Review Comment:
   This probably needs protection to ensure that this doesn't leave the bundle, 
else you can do things like `{"$f": "/etc/passwd"}` which feels like something 
we shouldn't allow, either directly, or via symlinks?



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