MCPcopy Create free account
hub / github.com/celery/celery / deserialize

Method deserialize

celery/security/serialization.py:48–58  ·  view source on GitHub ↗

Deserialize data structure from string.

(self, data)

Source from the content-addressed store, hash-verified

46 signer=self._cert.get_id())
47
48 def deserialize(self, data):
49 """Deserialize data structure from string."""
50 assert self._cert_store is not None
51 with reraise_errors('Unable to deserialize: {0!r}', (Exception,)):
52 payload = self._unpack(data)
53 signature, signer, body = (payload['signature'],
54 payload['signer'],
55 payload['body'])
56 self._cert_store[signer].verify(body, signature, self._digest)
57 return loads(body, payload['content_type'],
58 payload['content_encoding'], force=True)
59
60 def _pack(self, body, content_type, content_encoding, signer, signature,
61 sep=DEFAULT_SEPARATOR):

Callers 7

test_serializeMethod · 0.80
test_deserializeMethod · 0.80
test_unknown_sourceMethod · 0.80
test_self_sendMethod · 0.80
test_separate_endsMethod · 0.80
test_lots_of_signMethod · 0.80

Calls 3

_unpackMethod · 0.95
reraise_errorsFunction · 0.85
verifyMethod · 0.80

Tested by 7

test_serializeMethod · 0.64
test_deserializeMethod · 0.64
test_unknown_sourceMethod · 0.64
test_self_sendMethod · 0.64
test_separate_endsMethod · 0.64
test_lots_of_signMethod · 0.64