Init validators for deserialization security.
This module contains extra validators that are called during deserialization, ex. to prevent security issues such as SSRF attacks.
Each validator is a callable matching the InitValidator protocol: it takes a
class path tuple and kwargs dict, returns None on success, and raises
ValueError if the deserialization should be blocked.
Type alias for a callable that validates kwargs during deserialization.
The callable receives:
class_path: A tuple of strings identifying the class being instantiated
(e.g., ('langchain', 'schema', 'messages', 'AIMessage')).kwargs: The kwargs dict that will be passed to the constructor.The validator should raise an exception if the object should not be deserialized.