|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /usr/local/lib/python3.9/site-packages/celery/security/__pycache__/ |
a
��Sh; � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ dZ dZ
d Zd
Zzddl
Z
W n eyj ee ��Y n0 dd
d�Zddd�ZdS )zMessage Signing Serializer.� )�disable_insecure_serializers)�registry)�ImproperlyConfigured� )�
register_authz|You need to install the cryptography library to use the auth serializer.
Please install by:
$ pip install cryptography
z�Sorry, but you have to configure the
* security_key
* security_certificate, and the
* security_cert_store
configuration settings to use the auth serializer.
Please see the configuration reference for more information.
a You have to configure a special task serializer
for signing and verifying tasks:
* task_serializer = 'auth'
You have to accept only tasks which are serialized with 'auth'.
There is no point in signing messages if they are not verified.
* accept_content = ['auth']
)�setup_securityN�jsonc C s |du rddl m} |�� }t| � |j} | jdks@| jdgkrHtt��|pP| j }|pZ| j
}|pd| j}|pn| j}|px| j
}|r�|r�|s�tt��t|��R}
t|��*}t|
�� ||�� |||� W d � n1 s�0 Y W d � n1 s�0 Y t�d� dS )z#See :meth:`@Celery.setup_security`.Nr )�current_app�auth)Zceleryr Z_get_current_object�_disable_insecure_serializers�confZtask_serializerZaccept_contentr �SETTING_MISSINGZsecurity_keyZsecurity_key_passwordZsecurity_certificateZsecurity_cert_storeZsecurity_digest�SECURITY_SETTING_MISSING�openr �readr Z_set_default_serializer)Zallowed_serializers�key�key_password�cert�store�digest�
serializerZappr r Zkf�cf� r �B/usr/local/lib/python3.9/site-packages/celery/security/__init__.pyr , s$
Vr c C s t | d� d S )N)�allowed)r )� whitelistr r r �disable_untrusted_serializersI s r )NNNNNNr N)N)�__doc__Zkombu.serializationr r r Zcelery.exceptionsr Z
serializationr ZCRYPTOGRAPHY_NOT_INSTALLEDr r
�__all__Zcryptography�ImportErrorr r r r r r �<module> s
�