
    MȂi	                         S SK Jr  S SKJr  S SKJrJr  S SKJr  \" \5      r	S\	l
        S\	l         " S S\5      r\" \5      rS	\l
        S
\l         " S S\5      r\" \5      rS\l
        S\l        S rg)    )wraps)iscoroutinefunction)CsrfViewMiddleware	get_token)decorator_from_middlewarecsrf_protectz
This decorator adds CSRF protection in exactly the same way as
CsrfViewMiddleware, but it can be used on a per view basis. Using both, or
using the decorator multiple times, is harmless and efficient.
c                       \ rS rSrS rSrg)_EnsureCsrfToken   c                     g N selfrequestreasons      MD:\sksbv-state-backend\venv\Lib\site-packages\django/views/decorators/csrf.py_reject_EnsureCsrfToken._reject           r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__r   r   r   r
   r
      s    r   r
   requires_csrf_tokenz
Use this decorator on views that need a correct csrf_token available to
RequestContext, but without the CSRF protection that csrf_protect
enforces.
c                   .   ^  \ rS rSrS rU 4S jrSrU =r$ )_EnsureCsrfCookie    c                     g r   r   r   s      r   r   _EnsureCsrfCookie._reject!   r   r   c                 >   > [         TU ]  XX45      n[        U5        U$ r   )superprocess_viewr   )r   r   callbackcallback_argscallback_kwargsretval	__class__s         r   r%   _EnsureCsrfCookie.process_view$   s!    %gX'r   r   )r   r   r   r   r   r%   r   __classcell__)r*   s   @r   r   r       s     r   r   ensure_csrf_cookiez
Use this decorator to ensure that a view sets a CSRF cookie, whether or not it
uses the csrf_token template tag, or the CsrfViewMiddleware is used.
c                 n   ^  [        T 5      (       a  U 4S jnOU 4S jnSUl        [        T 5      " U5      $ )zCMark a view function as being exempt from the CSRF view protection.c                 8   >#    T" U /UQ70 UD6I S h  vN $  N7fr   r   r   argskwargs	view_funcs      r   _view_wrapper"csrf_exempt.<locals>._view_wrapper;   s!     "7<T<V<<<<s   c                    > T" U /UQ70 UD6$ r   r   r0   s      r   r4   r5   @   s    W6t6v66r   T)r   csrf_exemptr   )r3   r4   s   ` r   r7   r7   3   s4     9%%	=
	7 !%MM**r   N)	functoolsr   asgiref.syncr   django.middleware.csrfr   r   django.utils.decoratorsr   r   r   __doc__r
   r   r   r-   r7   r   r   r   <module>r=      s     , @ =();<&  )  00@A 4    *  //@A 2    +r   