bridge.utils.instantiate_utils#

Module Contents#

Functions#

_as_module_prefix

Ensure prefix ends with ‘.’ so allowlist matches at module boundaries.

_seed_allowlist

register_allowed_target_prefix

Register an additional allowed module prefix for target instantiation.

_validate_target_prefix

Validate that a target string is permitted by the allowlist.

Data#

API#

bridge.utils.instantiate_utils._ALLOWED_TARGET_PREFIXES: set[str]#

None

bridge.utils.instantiate_utils._as_module_prefix(prefix: str) str#

Ensure prefix ends with ‘.’ so allowlist matches at module boundaries.

bridge.utils.instantiate_utils._seed_allowlist() None#
bridge.utils.instantiate_utils.register_allowed_target_prefix(prefix: str) None#

Register an additional allowed module prefix for target instantiation.

This allows extending the default allowlist for use cases that require instantiating classes from other packages.

bridge.utils.instantiate_utils._validate_target_prefix(*, target: str, full_key: str) None#

Validate that a target string is permitted by the allowlist.