Home / Class/ TestRealWorldURLs Class — langchain Architecture

TestRealWorldURLs Class — langchain Architecture

Architecture documentation for the TestRealWorldURLs class in test_ssrf_protection.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0038a104_105e_9624_5340_006f953539ac["TestRealWorldURLs"]
  0a8d2a49_20ba_b7b4_8bfd_e6c768864657["test_ssrf_protection.py"]
  0038a104_105e_9624_5340_006f953539ac -->|defined in| 0a8d2a49_20ba_b7b4_8bfd_e6c768864657
  7ec33d02_f91a_026c_d00c_1c2badcd912b["test_slack_webhook()"]
  0038a104_105e_9624_5340_006f953539ac -->|method| 7ec33d02_f91a_026c_d00c_1c2badcd912b
  d429b53d_265f_d400_8442_c9270d05464b["test_discord_webhook()"]
  0038a104_105e_9624_5340_006f953539ac -->|method| d429b53d_265f_d400_8442_c9270d05464b
  90014722_569b_3e5f_ef5f_008ae27c6142["test_webhook_site()"]
  0038a104_105e_9624_5340_006f953539ac -->|method| 90014722_569b_3e5f_ef5f_008ae27c6142
  6eff8988_f75e_785a_d269_4d5a0fbaab42["test_ngrok_url()"]
  0038a104_105e_9624_5340_006f953539ac -->|method| 6eff8988_f75e_785a_d269_4d5a0fbaab42

Relationship Graph

Source Code

libs/core/tests/unit_tests/test_ssrf_protection.py lines 274–297

class TestRealWorldURLs:
    """Tests with real-world webhook URLs."""

    def test_slack_webhook(self) -> None:
        """Test Slack webhook URL."""
        url = (
            "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXX"
        )
        assert is_safe_url(url) is True

    def test_discord_webhook(self) -> None:
        """Test Discord webhook URL."""
        url = "https://discord.com/api/webhooks/123456789012345678/abcdefghijklmnopqrstuvwxyz"
        assert is_safe_url(url) is True

    def test_webhook_site(self) -> None:
        """Test webhook.site URL."""
        url = "https://webhook.site/unique-id"
        assert is_safe_url(url) is True

    def test_ngrok_url(self) -> None:
        """Test ngrok URL (should be safe as it's public)."""
        url = "https://abc123.ngrok.io/webhook"
        assert is_safe_url(url) is True

Frequently Asked Questions

What is the TestRealWorldURLs class?
TestRealWorldURLs is a class in the langchain codebase, defined in libs/core/tests/unit_tests/test_ssrf_protection.py.
Where is TestRealWorldURLs defined?
TestRealWorldURLs is defined in libs/core/tests/unit_tests/test_ssrf_protection.py at line 274.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free