OwlCyberSecurity - MANAGER
Edit File: debug.cpython-39.pyc
a ���eE � @ s, d dl mZ d dlmZ dd� Zdd� ZdS )� ��wraps)�HttpRequestc s0 t � �dkr t� d �r td��� fdd�}|S )a� Indicate which variables used in the decorated function are sensitive so that those variables can later be treated in a special way, for example by hiding them when logging unhandled exceptions. Accept two forms: * with specified variable names: @sensitive_variables('user', 'password', 'credit_card') def my_function(user): password = user.pass_word credit_card = user.credit_card_number ... * without any specified variable names, in which case consider all variables are sensitive: @sensitive_variables() def my_function() ... � r zzsensitive_variables() must be called to use it as a decorator, e.g., use @sensitive_variables(), not @sensitive_variables.c s t � �� ��fdd����S )Nc s �r��_ nd�_ � | i |��S )N�__ALL__)�sensitive_variables)Z func_argsZfunc_kwargs)�func�sensitive_variables_wrapper� variables� �^/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/views/decorators/debug.pyr $ s zKsensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperr )r �r )r r r � decorator# s z&sensitive_variables.<locals>.decorator��len�callable� TypeError)r r r r r r s �r c s0 t � �dkr t� d �r td��� fdd�}|S )a� Indicate which POST parameters used in the decorated view are sensitive, so that those parameters can later be treated in a special way, for example by hiding them when logging unhandled exceptions. Accept two forms: * with specified parameters: @sensitive_post_parameters('password', 'credit_card') def my_view(request): pw = request.POST['password'] cc = request.POST['credit_card'] ... * without any specified parameters, in which case consider all variables are sensitive: @sensitive_post_parameters() def my_view(request) ... r r z�sensitive_post_parameters() must be called to use it as a decorator, e.g., use @sensitive_post_parameters(), not @sensitive_post_parameters.c s t � ��� fdd��}|S )Nc s: t | t�std��� r� | _nd| _�| g|�R i |��S )Nz�sensitive_post_parameters didn't receive an HttpRequest object. If you are decorating a classmethod, make sure to use @method_decorator.r )� isinstancer r �sensitive_post_parameters)�request�args�kwargs)� parameters�viewr r �!sensitive_post_parameters_wrapperP s �zWsensitive_post_parameters.<locals>.decorator.<locals>.sensitive_post_parameters_wrapperr )r r �r )r r r O s z,sensitive_post_parameters.<locals>.decoratorr )r r r r r r 1 s �r N)� functoolsr Zdjango.httpr r r r r r r �<module> s +