1▶"""SSRF Protection - thin wrapper raising ValueError for internal callers.
2
3Delegates all validation to `langchain_core._security._policy`.
· · ·
15)
16
17▶from langchain_core._security._exceptions import SSRFBlockedError
18from langchain_core._security._policy import (
19 SSRFPolicy,
· · ·
60
61 Raises:
62▶ ValueError: If URL is invalid or potentially dangerous.
63 """
64 url_str = str(url)
· · ·
79 try:
80 _validate_url_sync(url_str, policy)
81▶ except SSRFBlockedError as exc:
82 raise ValueError(str(exc)) from exc
83
· · ·
82▶ raise ValueError(str(exc)) from exc
83
84 # DNS resolution and IP validation
+ 8 more matches in this file