ó
P'—^c           @@  s   d  Z  d d l m Z d d l m Z m Z d d l m Z d d l	 m
 Z
 d Z d Z d	 g Z d d d d d
 d d d „ Z d d „ Z d S(   sc   
    celery.security
    ~~~~~~~~~~~~~~~

    Module implementing the signing message serializer.

i    (   t   absolute_import(   t   registryt   disable_insecure_serializers(   t   ImproperlyConfiguredi   (   t   register_authsv   You need to install the pyOpenSSL library to use the auth serializer.
Please install by:

    $ pip install pyOpenSSL
sü   Sorry, but you have to configure the
    * CELERY_SECURITY_KEY
    * CELERY_SECURITY_CERTIFICATE, and the
    * CELERY_SECURITY_CERT_STORE
configuration settings to use the auth serializer.

Please see the configuration reference for more information.
t   setup_securityt   sha1t   jsonc         C@  s0  | d k r+ d d l m } | j ƒ  } n  t |  ƒ | j } | j d k rQ d Sy d d l m }	 Wn t	 k
 r„ t
 t ƒ ‚ n X| p‘ | j } | p  | j } | p¯ | j } | oÁ | oÁ | sÓ t
 t ƒ ‚ n  t | ƒ > }
 t | ƒ ) } t |
 j ƒ  | j ƒ  | | | ƒ Wd QXWd QXt j d ƒ d S(   s#   See :meth:`@Celery.setup_security`.i    (   t   current_appt   authN(   t   crypto(   t   Nonet   celeryR   t   _get_current_objectt   _disable_insecure_serializerst   conft   CELERY_TASK_SERIALIZERt   OpenSSLR
   t   ImportErrorR   t   SSL_NOT_INSTALLEDt   CELERY_SECURITY_KEYt   CELERY_SECURITY_CERTIFICATEt   CELERY_SECURITY_CERT_STOREt   SETTING_MISSINGt   openR   t   readR   t   _set_default_serializer(   t   allowed_serializerst   keyt   certt   storet   digestt
   serializert   appR   R   R
   t   kft   cf(    (    s:   /tmp/pip-unpacked-wheel-gV1wwp/celery/security/__init__.pyR   '   s(    
	.c         C@  s   t  d |  ƒ d  S(   Nt   allowed(   R   (   t	   whitelist(    (    s:   /tmp/pip-unpacked-wheel-gV1wwp/celery/security/__init__.pyt   disable_untrusted_serializersF   s    N(   t   __doc__t
   __future__R    t   kombu.serializationR   R   R   t   celery.exceptionsR   t   serializationR   R   R   t   __all__R   R   R&   (    (    (    s:   /tmp/pip-unpacked-wheel-gV1wwp/celery/security/__init__.pyt   <module>   s   
	