B
    ª0H[	
  ã               @   s(   d dl Z d dlmZ dd„ Zdd„ ZdS )é    N)ÚHttpRequestc                 s   ‡ fdd„}|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()
            ...
    c                s   t  ˆ ¡‡ ‡‡fdd„ƒ‰ˆS )Nc                 s   ˆrˆˆ_ ndˆ_ ˆ | |ŽS )NÚ__ALL__)Úsensitive_variables)Ú	func_argsZfunc_kwargs)ÚfuncÚsensitive_variables_wrapperÚ	variables© úaC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-6bm3nxem\django\django\views\decorators\debug.pyr      s    zKsensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapper)Ú	functoolsÚwraps)r   )r   )r   r   r
   Ú	decorator   s    z&sensitive_variables.<locals>.decoratorr	   )r   r   r	   )r   r
   r      s    	r   c                 s   ‡ fdd„}|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)
            ...
    c                s   t  ˆ ¡‡‡ fdd„ƒ}|S )Nc                s4   t | tƒstdƒ‚ˆ rˆ | _nd| _ˆ| f|ž|ŽS )Nzsensitive_post_parameters didn't receive an HttpRequest. If you are decorating a classmethod, be sure to use @method_decorator.r   )Ú
isinstancer   ÚAssertionErrorÚsensitive_post_parameters)ÚrequestÚargsÚkwargs)Ú
parametersÚviewr	   r
   Ú!sensitive_post_parameters_wrapperA   s    zWsensitive_post_parameters.<locals>.decorator.<locals>.sensitive_post_parameters_wrapper)r   r   )r   r   )r   )r   r
   r   @   s    z,sensitive_post_parameters.<locals>.decoratorr	   )r   r   r	   )r   r
   r   )   s    r   )r   Zdjango.httpr   r   r   r	   r	   r	   r
   Ú<module>   s   #