Skip to main content

setup_security

See :meth:@Celery.setup_security.

def setup_security(
allowed_serializers: list = None,
key: string = None,
key_password: string = None,
cert: string = None,
store: string = None,
digest: string = None,
serializer: string = 'json',
app: Celery = None
) - > null

See :meth:@Celery.setup_security.

Parameters

NameTypeDescription
allowed_serializerslist = NoneA list of serializer names to permit; if provided, insecure serializers not in this list will be disabled.
keystring = NoneThe file path to the private key used for signing messages.
key_passwordstring = NoneThe password or passphrase used to decrypt the private key file.
certstring = NoneThe file path to the public certificate corresponding to the private key.
storestring = NoneA directory path or glob pattern containing trusted public certificates used to verify incoming messages.
digeststring = NoneThe hashing algorithm used for message signatures, such as 'sha256'.
serializerstring = 'json'The name of the inner serializer to use for the message payload before it is signed.
appCelery = NoneThe Celery application instance to configure; defaults to the current_app if not specified.

Returns

TypeDescription
nullNothing is returned; the function modifies the global Celery application state and serializer registry.