dify/api/tests/integration_tests
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
..
controllers/console feat: Allow Editor role to use Trigger Plugin subscriptions (#29292) 2025-12-09 10:24:56 +08:00
factories chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
model_runtime/__mock chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
plugin more httpx (#25651) 2025-09-22 23:07:09 +08:00
services remove .value (#26633) 2025-10-11 09:08:29 +08:00
storage ruff check preview (#25653) 2025-09-16 12:58:12 +08:00
tasks feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
tools use model_validate (#26182) 2025-10-10 17:30:13 +09:00
utils chore: apply flake8-pytest-style linter rules (#8307) 2024-09-12 18:09:16 +08:00
vdb feat: Add InterSystems IRIS vector database support (#29480) 2025-12-15 10:20:43 +08:00
workflow fix(template-transform): use base64 encoding for Jinja2 templates 2025-12-26 20:08:12 +02:00
.env.example feat: Add InterSystems IRIS vector database support (#29480) 2025-12-15 10:20:43 +08:00
.gitignore Enhance Code Consistency Across Repository with `.editorconfig` (#19023) 2025-04-29 18:04:33 +08:00
__init__.py feat: server multi models support (#799) 2023-08-12 00:57:00 +08:00
conftest.py test: Consolidate API CI test runner (#29440) 2025-12-15 13:20:31 +08:00