ó
®â0_c           @   s0  d  d l  m Z d d l m Z m Z m Z d d l m Z d „  Z e e d ƒ d d ƒZ	 e e d	 ƒ d d
 ƒZ
 e e d ƒ d d ƒZ d „  Z e e d ƒ d d ƒZ e e d ƒ d d ƒZ e e d ƒ d d ƒZ e e j d e ƒd „  ƒ Z e e j d e ƒd „  ƒ Z d „  Z d „  Z d S(   iÿÿÿÿ(   t   settingsi   (   t   Tagst   Warningt   register(   t   patch_middleware_messagec         C   s   |  d S(   Nsq    Using a secure-only session cookie makes it more difficult for network traffic sniffers to hijack user sessions.(    (   t   message(    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyt   add_session_cookie_message   s    sn   You have 'django.contrib.sessions' in your INSTALLED_APPS, but you have not set SESSION_COOKIE_SECURE to True.t   ids   security.W010s‡   You have 'django.contrib.sessions.middleware.SessionMiddleware' in your MIDDLEWARE, but you have not set SESSION_COOKIE_SECURE to True.s   security.W011s)   SESSION_COOKIE_SECURE is not set to True.s   security.W012c         C   s   |  d S(   Nss    Using an HttpOnly session cookie makes it more difficult for cross-site scripting attacks to hijack user sessions.(    (   R   (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyt   add_httponly_message%   s    sp   You have 'django.contrib.sessions' in your INSTALLED_APPS, but you have not set SESSION_COOKIE_HTTPONLY to True.s   security.W013s‰   You have 'django.contrib.sessions.middleware.SessionMiddleware' in your MIDDLEWARE, but you have not set SESSION_COOKIE_HTTPONLY to True.s   security.W014s+   SESSION_COOKIE_HTTPONLY is not set to True.s   security.W015t   deployc         K   sl   g  } t  j sh t ƒ  r( | j t ƒ n  t ƒ  rG | j t t ƒ ƒ n  t | ƒ d k rh t	 g } qh n  | S(   Ni   (
   R    t   SESSION_COOKIE_SECUREt   _session_appt   appendt   W010t   _session_middlewareR   t   W011t   lent   W012(   t   app_configst   kwargst   errors(    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyt   check_session_cookie_secureC   s    			c         K   sl   g  } t  j sh t ƒ  r( | j t ƒ n  t ƒ  rG | j t t ƒ ƒ n  t | ƒ d k rh t	 g } qh n  | S(   Ni   (
   R    t   SESSION_COOKIE_HTTPONLYR   R   t   W013R   R   t   W014R   t   W015(   R   R   R   (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyt   check_session_cookie_httponlyP   s    			c           C   s%   d t  j k p$ t  j o$ d t  j k S(   Ns4   django.contrib.sessions.middleware.SessionMiddleware(   R    t   MIDDLEWARE_CLASSESt
   MIDDLEWARE(    (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyR   ]   s    c           C   s   d t  j k S(   Ns   django.contrib.sessions(   R    t   INSTALLED_APPS(    (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyR   b   s    N(   t   django.confR    t    R   R   R   t   utilsR   R   R   R   R   R   R   R   R   t   securityt   TrueR   R   R   R   (    (    (    sF   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/sessions.pyt   <module>   s<   													