Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
6404faa
fix: add ssrf protection to url component
Adam-Aghili Jun 3, 2026
2961345
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 3, 2026
e62d2a8
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Jun 3, 2026
a5bb46f
[autofix.ci] apply automated fixes (attempt 3/3)
autofix-ci[bot] Jun 3, 2026
a16490a
chore: address ruff errors
Adam-Aghili Jun 3, 2026
100b8ce
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 3, 2026
048a09e
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Jun 3, 2026
8455dbf
Merge branch 'release-1.10.0' into url-ssrf
Adam-Aghili Jun 3, 2026
4832157
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 3, 2026
44d305a
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Jun 3, 2026
b4e55f3
chore: update starter projects and component_index
Adam-Aghili Jun 3, 2026
a9687b6
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 3, 2026
461d453
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Jun 3, 2026
83064ff
Merge branch 'release-1.10.0' into url-ssrf
Adam-Aghili Jun 4, 2026
43f793c
fix: url component sync and async
erichare Jun 4, 2026
9a6552e
Merge branch 'release-1.10.0' into url-ssrf
erichare Jun 4, 2026
736b151
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 4, 2026
260aebf
[autofix.ci] apply automated fixes (attempt 2/3)
autofix-ci[bot] Jun 4, 2026
d1c9feb
Merge branch 'release-1.10.0' into url-ssrf
Adam-Aghili Jun 5, 2026
fe6f8bc
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

396 changes: 394 additions & 2 deletions src/backend/tests/unit/components/data_source/test_dns_rebinding.py

Large diffs are not rendered by default.

529 changes: 177 additions & 352 deletions src/backend/tests/unit/components/data_source/test_url_component.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,11 @@ def test_split_text_with_dataframe_input(self):
assert "Another text" in results["text"][2], f"Expected 'Another text', got '{results['text'][2]}'"
assert "Another line" in results["text"][3], f"Expected 'Another line', got '{results['text'][3]}'"

def test_with_url_loader(self):
async def test_with_url_loader(self):
"""Test splitting text with URL loader."""
component = SplitTextComponent()
url = ["https://en.wikipedia.org/wiki/London", "https://en.wikipedia.org/wiki/Paris"]
data_frame = URLComponent(urls=url, format="Text").fetch_content()
data_frame = await URLComponent(urls=url, format="Text").fetch_content()
assert isinstance(data_frame, DataFrame), "Expected DataFrame instance"
assert len(data_frame) == 2, f"Expected DataFrame with 2 rows, got {len(data_frame)}"

Expand Down
16 changes: 6 additions & 10 deletions src/lfx/src/lfx/_assets/component_index.json

Large diffs are not rendered by default.

344 changes: 263 additions & 81 deletions src/lfx/src/lfx/components/data_source/url.py

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions src/lfx/tests/unit/test_flow_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,21 +716,19 @@ def test_basic_prompting_with_anthropic_provider(self, basic_prompting_flow):
assert "lfx" in result
assert "langchain-anthropic" in result

def test_simple_agent_has_community(self, simple_agent_flow):
"""Simple Agent's URLComponent imports langchain_community.

When lfx provides langchain-community transitively (e.g. via
OpenDsStar in some environments) it is filtered out of generated
requirements as already-provided; otherwise it should appear.
def test_simple_agent_requirements(self, simple_agent_flow):
"""Simple Agent requires lfx and no longer drags in langchain-community.

The Simple Agent ships the URL component, which historically imported
``langchain_community`` via ``RecursiveUrlLoader``. The URL component was
rewritten to fetch with ``httpx`` plus DNS-pinned SSRF protection and no
longer imports ``langchain_community``, so the generated requirements
include ``lfx`` but never ``langchain-community`` (regardless of whether
lfx happens to provide it transitively in a given environment).
"""
from lfx.utils.flow_requirements import _get_lfx_provided_imports

result = generate_requirements_from_flow(simple_agent_flow, pin_versions=False)
assert "lfx" in result
if "langchain_community" in _get_lfx_provided_imports():
assert "langchain-community" not in result
else:
assert "langchain-community" in result
assert "langchain-community" not in result

def test_basic_prompting_from_file(self):
"""Test the file-based API.
Expand Down
Loading