Ë
    uPêj­  ã                   óh   — d Z ddlZddlZddlmZ ddlZddlmZ ddl	m
Z
 ddlmZ d
dedz  ddfd	„Zy)zw
Loader for custom secret managers.

Handles dynamic loading of user-defined secret manager classes from Python files.
é    N)ÚFinal)Úverbose_proxy_logger)ÚCustomSecretManager)ÚKeyManagementSystemÚconfig_file_pathÚreturnc                 ó,  — | st        d«      ‚t        j                  €t        d«      ‚t        t        j                  dd«      }|st        d«      ‚|j	                  d«      \  }}t        j                  d|||«       t        j                  j                  | «      }t        j                  j                  ||«      dz   }t        j                  j                  ||«      }|st        d	|› �«      ‚t        j                  j                  |«      }|j                   j#                  |«       t        ||«      }t%        |t&        «      st)        d
|› d�«      ‚ |«       }	|	t        _        t,        j.                  t        _        t        j2                  d|«       y)a£  
    Load and initialize a custom secret manager from a python file.

    Similar to how custom guardrails are loaded - loads the class from
    the custom_secret_manager field in key_management_settings.

    Args:
        config_file_path: Path to the config.yaml file

    Raises:
        ValueError: If required configuration is missing
        ImportError: If the custom secret manager module cannot be loaded
    zYCustomSecretManagerException - config_file_path is required to load custom secret managerNzcCustomSecretManagerException - key_management_settings is required with custom_secret_manager fieldÚcustom_secret_managerzaCustomSecretManagerException - custom_secret_manager field is required in key_management_settingsú.zEInitializing custom secret manager: %s, file_name: %s, class_name: %sz.pyz*Could not find a module specification for zCustomSecretManagerException - z* must be a subclass of CustomSecretManagerz2Successfully initialized custom secret manager: %s)Ú
ValueErrorÚlitellmÚ_key_management_settingsÚgetattrÚsplitr   ÚdebugÚosÚpathÚdirnameÚjoinÚ	importlibÚutilÚspec_from_file_locationÚImportErrorÚmodule_from_specÚloaderÚexec_moduleÚ
issubclassr   Ú	TypeErrorÚsecret_manager_clientr   ÚCUSTOMÚ_key_management_systemÚinfo)
r   Úcustom_secret_manager_pathÚ
_file_nameÚ_class_nameÚ	directoryÚmodule_file_pathÚspecÚmoduleÚ_secret_manager_classÚ_secret_manager_instances
             úy/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/secret_managers/custom_secret_manager_loader.pyÚload_custom_secret_managerr-      s|  € ñ ÜÐtÓuÐuô ×'Ñ'Ð/ÜØqó
ð 	
ô )0´×0PÑ0PÐRiÐkoÓ(pÐá%ÜØoó
ð 	
ð
 9×>Ñ>¸sÓCÑ€J�Ü×ÑØOØ"ØØô	ô —w‘w—‘Ð'7Ó8€IÜ Ÿg™gŸl™l¨9°jÓAÀEÑIÐä—.‘.×8Ñ8¸ÐFVÓW€DÙÜÐFÐGWÐFXÐYÓZÐZä—N‘N×3Ñ3°DÓ9€FØ‡K�K×Ñ˜FÔ#Ü#*¨6°;Ó#?Ðô Ð+Ô-@ÔAÜÐ9¸+¸ÐFpÐqÓrÐrñ '<Ó&=Ðð %=„GÔ!ô &9×%?Ñ%?„GÔ"ä×ÑØ<Ø"õó    )N)Ú__doc__Úimportlib.utilr   r   Útypingr   r   Úlitellm._loggingr   Ú*litellm.integrations.custom_secret_managerr   Ú"litellm.types.secret_managers.mainr   Ústrr-   © r.   r,   ú<module>r7      s;   ðñó Û 	Ý ã Ý 1Ý JÝ BñD°°t±ð DÀtô Dr.   