mirror of
https://github.com/langflow-ai/langflow.git
synced 2026-07-25 11:58:22 +08:00
fix: Fixed CodeQL security scan about Incomplete URL substring sanitization on watsonx test suite (#12212)
* fix: Fixed CodeQL security scan about Incomplete URL substring sanitization * fix coderabbitai comments * fix: nightly now properly gets 1.9.0 branch (#12215) before it was attempting to pull release-notes as letters are alphanumerically after numbers when we sort -V then grab tail now we only look at branch names that follow the pattern '^release-[0-9]+\.[0-9]+\.[0-9]+$' * fix failing action * docs: add search icon (#12216) add-back-svg * Revert "Merge branch 'main' into dev-fix-security-code-scan-watsonx" This reverts commit41eb034e11, reversing changes made to4e51f4d836. * Revert "Merge branch 'main' into dev-fix-security-code-scan-watsonx" This reverts commit4e51f4d836, reversing changes made to530bddd0a4. --------- Co-authored-by: Adam-Aghili <149833988+Adam-Aghili@users.noreply.github.com> Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
This commit is contained in:
@ -66,9 +66,19 @@ class TestWatsonxAIComponent:
|
||||
"""Test that API URLs are defined."""
|
||||
from lfx.components.ibm.watsonx import WatsonxAIComponent
|
||||
|
||||
expected_urls = [
|
||||
"https://us-south.ml.cloud.ibm.com",
|
||||
"https://eu-de.ml.cloud.ibm.com",
|
||||
"https://eu-gb.ml.cloud.ibm.com",
|
||||
"https://au-syd.ml.cloud.ibm.com",
|
||||
"https://jp-tok.ml.cloud.ibm.com",
|
||||
"https://ca-tor.ml.cloud.ibm.com",
|
||||
"https://ap-south-1.aws.wxai.ibm.com",
|
||||
]
|
||||
assert len(WatsonxAIComponent._urls) > 0
|
||||
assert "https://us-south.ml.cloud.ibm.com" in WatsonxAIComponent._urls
|
||||
assert "https://eu-de.ml.cloud.ibm.com" in WatsonxAIComponent._urls
|
||||
|
||||
for url in expected_urls:
|
||||
assert url in WatsonxAIComponent._urls, f"Expected URL {url} not found in WatsonxAIComponent._urls"
|
||||
|
||||
def test_inputs_defined(self, wx_component):
|
||||
"""Test that all required inputs are defined."""
|
||||
|
||||
@ -83,13 +83,18 @@ class TestWatsonxEmbeddingsComponent:
|
||||
"""Test that URL options are defined."""
|
||||
url_input = next(inp for inp in wx_embeddings_component.inputs if inp.name == "url")
|
||||
|
||||
assert "https://us-south.ml.cloud.ibm.com" in url_input.options
|
||||
assert "https://eu-de.ml.cloud.ibm.com" in url_input.options
|
||||
assert "https://eu-gb.ml.cloud.ibm.com" in url_input.options
|
||||
assert "https://au-syd.ml.cloud.ibm.com" in url_input.options
|
||||
assert "https://jp-tok.ml.cloud.ibm.com" in url_input.options
|
||||
assert "https://ca-tor.ml.cloud.ibm.com" in url_input.options
|
||||
assert "https://ap-south-1.aws.wxai.ibm.com" in url_input.options
|
||||
expected_urls = [
|
||||
"https://us-south.ml.cloud.ibm.com",
|
||||
"https://eu-de.ml.cloud.ibm.com",
|
||||
"https://eu-gb.ml.cloud.ibm.com",
|
||||
"https://au-syd.ml.cloud.ibm.com",
|
||||
"https://jp-tok.ml.cloud.ibm.com",
|
||||
"https://ca-tor.ml.cloud.ibm.com",
|
||||
"https://ap-south-1.aws.wxai.ibm.com",
|
||||
]
|
||||
|
||||
for url in expected_urls:
|
||||
assert url in url_input.options, f"Expected URL {url} not found in options"
|
||||
|
||||
@patch("lfx.base.models.model_utils.requests.get")
|
||||
def test_fetch_models_success(self, mock_get, mock_response):
|
||||
|
||||
Reference in New Issue
Block a user