MCPcopy
hub / github.com/django/django / unsign_object

Method unsign_object

django/core/signing.py:253–264  ·  view source on GitHub ↗
(self, signed_obj, serializer=JSONSerializer, **kwargs)

Source from the content-addressed store, hash-verified

251 return self.sign(base64d)
252
253 def unsign_object(self, signed_obj, serializer=JSONSerializer, **kwargs):
254 # Signer.unsign() returns str but base64 and zlib compression operate
255 # on bytes.
256 base64d = self.unsign(signed_obj, **kwargs).encode()
257 decompress = base64d[:1] == b"."
258 if decompress:
259 # It's compressed; uncompress it first.
260 base64d = base64d[1:]
261 data = b64_decode(base64d)
262 if decompress:
263 data = zlib.decompress(data)
264 return serializer().loads(data)
265
266
267class TimestampSigner(Signer):

Callers 3

_decodeMethod · 0.80
loadsFunction · 0.80

Calls 5

unsignMethod · 0.95
b64_decodeFunction · 0.85
encodeMethod · 0.45
decompressMethod · 0.45
loadsMethod · 0.45

Tested by 1