bgfddlZddlZddlmZddlmZddlmZmZddl m Z GddeZ dS) N)fernet) InvalidToken)AbstractStorageSession)logc VeZdZdZddddddejejdfd ZdZd Z xZ S) EncryptedCookieStoragezEncrypted JSON storage. AIOHTTP_SESSIONN/T cookie_namedomainmax_agepathsecurehttponlyencoderdecoderc t|||||||| t|trn0t|tt frt j|}tj ||_ dS)Nr ) super__init__ isinstancestrbytes bytearraybase64urlsafe_b64encoderFernet_fernet) self secret_keyrrrrrrrr __class__s o/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/aiohttp_session/cookie_storage.pyrzEncryptedCookieStorage.__init__s [!(tF"*!('  ; ; ; j# & & >   UI$6 7 7 >1*==J}Z00 cK||}|tddd|jS ||j|d|jd}td|d|jS#t$r/tj dtddd|jcYSwxYw)NT)datanewrutf-8)ttlFz7Cannot decrypt cookie value, create a new fresh session) load_cookierr_decoderr decryptencodedecoderrwarning)r!requestcookier's r$ load_sessionz#EncryptedCookieStorage.load_sessions !!'** >4ddlKKK K P}}L(( g.. L)fWoo  t$#($,@@@@ P P P 9:::t$D$,OOOOOO PsA1B%%6CCcXK|jr||d|jS|||d}|||j|d|jdS)N)rr)) empty save_cookier_encoder_get_session_datar.r encryptr/)r!r1responsesession cookie_datas r$ save_sessionz#EncryptedCookieStorage.save_session1s = =##Hb,3O$== =mm  " "7 + +  &//    L  - - 4 4W = =O      r%) __name__ __module__ __qualname____doc__jsondumpsloadsrr3r> __classcell__)r#s@r$r r s3DdtTZ 1 1 1 1 1 1 1PPP&        r%r ) rCr cryptographyrcryptography.fernetrr5rrrr r%r$rJs ,,,,,,&&&&&&&&2 2 2 2 2 _2 2 2 2 2 r%