관리-도구
편집 파일: lookup.cpython-311.opt-1.pyc
� IMgE � �� � d dl Z d dlmZmZmZ ddlmZ ddlmZ ddl m Z ddlmZ e � � Zd ed ee dedef d ededef f d�Z dd ed ee deegef fd�ZdS )� N)�Any�Callable�List� )�MyImunifyConfig)�wraps� )� check_feature)�UserArgumentNotFound�name�permissions�func.�user_key�returnc �R � ������ � t j �� � }�|j vrt d��� � �|j � � � j � j u ��� ���� fd��t �� � ��fd�� � }t �� � ��fd�� � }t j �� � r|S |S )z� Wrapper to enable feature management for func :param name: feature name :param func: function/method to wrap :param user_key: parameter name which contains user name :return: new callable object zExpecting argument '%s' for %sc � �� �r�| vrt d��� � �t j r d S | � ��j � � }t ��|� � d S )Nz3Argument '%s' for '%s' must be specified explicitly)r r �ENABLED�get�defaultr )�kwargs�userr r r r �user_key_required� user_params �������^/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/feature_management/lookup.py�checkerz_wrapper.<locals>.checker ss �� �� ���!7�!7�&�E���� � � �"� �>��F��z�z�(�J�$6�7�7���d�K��.�.�.�.�.� c �$ �� �di |�� �| i |��S �N� r ��argsr r r s ��r �wrapperz_wrapper.<locals>.wrapper/ s. �� �����&�����t�T�$�V�$�$�$r c � �4 �K � �di |�� �| i |��� d {V ��S r r r s ��r � async_wrapperz_wrapper.<locals>.async_wrapper4 sD �� � � �����&�����T�4�*�6�*�*�*�*�*�*�*�*�*r )�inspect� signature� parametersr r �emptyr �iscoroutinefunction) r r r r r&