dify/api/tests/test_containers_integration...
Devbyteai 26444d8b6c fix(template-transform): use base64 encoding for Jinja2 templates
When Jinja2 templates containing special characters (quotes, newlines)
were embedded directly in the generated Python script using triple-quoted
strings, the script would break. This fix encodes the template as base64
before embedding, then decodes it at runtime.

Root cause: Templates were inserted via string replacement into a Python
script like `jinja2.Template('''...''')`. If the template contained `'''`,
the generated script had a syntax error.

Solution: Add serialize_code() method to base64-encode templates, then
override assemble_runner_script() in Jinja2TemplateTransformer to use
the encoded template with runtime decoding.

This specifically affects Jinja2 templates - Python3 and JavaScript
transformers insert user code at the top level (not inside strings),
so they don't have this vulnerability.

Fixes #26818
2025-12-26 20:08:12 +02:00
..
core Enhanced GraphEngine Pause Handling (#28196) 2025-11-26 19:59:34 +08:00
factories chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
libs/broadcast_channel/redis test: Stabilize sharded Redis broadcast multi-subscriber test (#29733) 2025-12-16 16:35:55 +08:00
services fix: validate first then save to db (#30107) 2025-12-25 19:36:52 +09:00
tasks Feat/support multimodal embedding (#29115) 2025-12-09 14:41:46 +08:00
trigger test(trigger): add container integration tests for trigger (#29527) 2025-12-12 11:31:34 +08:00
workflow fix(template-transform): use base64 encoding for Jinja2 templates 2025-12-26 20:08:12 +02:00
__init__.py Feat add testcontainers test (#23269) 2025-08-04 19:27:36 +08:00
conftest.py test: Consolidate API CI test runner (#29440) 2025-12-15 13:20:31 +08:00
test_workflow_pause_integration.py Enhanced GraphEngine Pause Handling (#28196) 2025-11-26 19:59:34 +08:00