Files
wg-backend-django/dell-env/lib/python3.11/site-packages/flask/__pycache__/sessions.cpython-311.pyc

189 lines
18 KiB
Plaintext
Raw Normal View History

2023-10-30 14:40:43 +07:00
<EFBFBD>
~]?e7><00><00>P<00>ddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm
Z
ddl m Z dd l mZdd
lmZejrddlZdd lmZdd lmZmZGd <0A>de<05><00>ZGd<0F>de e<19><00>ZGd<11>de<1A><00>ZGd<13>d<14><00>Ze<10><00>ZGd<15>de<1C><00>ZdS)<17>N)<01>MutableMapping)<01>datetime)<01>timezone)<01> BadSignature)<01>URLSafeTimedSerializer)<01> CallbackDict<63>)<01>is_ip)<01>TaggedJSONSerializer)<01>Flask)<02>Request<73>Responsec<00>d<00>eZdZdZedefd<03><04><00>Zejdeddfd<06><04><00>ZdZdZ dZ
dS) <09> SessionMixinz3Expands a basic dictionary with session attributes.<2E>returnc<00>.<00>|<00>dd<02><00>S)z3This reflects the ``'_permanent'`` key in the dict.<2E>
_permanentF)<01>get<65><01>selfs <20>g/home/infidel/Sync/TIP/WireGuard/ocp-wg-backend/dell-env/lib/python3.11/site-packages/flask/sessions.py<70> permanentzSessionMixin.permanents<00><00><14>x<EFBFBD>x<EFBFBD> <0C>e<EFBFBD>,<2C>,<2C>,<2C><00>valueNc<00>*<00>t|<01><00>|d<dS)Nr)<01>bool)rrs rrzSessionMixin.permanents<00><00>!<21>%<25>[<5B>[<5B><04>\<5C><1A><1A>rFT) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>propertyrr<00>setter<65>new<65>modified<65>accessed<65>rrrrs<><00><00><00><00><00><00>=<3D>=<3D> <0A>-<2D>4<EFBFBD>-<2D>-<2D>-<2D><0E>X<EFBFBD>-<2D><0F><15>)<29>t<EFBFBD>)<29><04>)<29>)<29>)<29><16><15>)<29> <10>C<EFBFBD>
<14>H<EFBFBD>
<14>H<EFBFBD>H<EFBFBD>Hrrc<00><><00><00>eZdZdZdZdZd dejddf<04>fd<06> Zde dejf<04>fd<08> Z
d de d ejdejf<06>fd
<EFBFBD> Z d de d ejdejf<06>fd <0B> Z <0C>xZ S) <0A>SecureCookieSessiona Base class for sessions based on signed cookies.
This session backend will set the :attr:`modified` and
:attr:`accessed` attributes. It cannot reliably track whether a
session is new (vs. empty), so :attr:`new` remains hard coded to
``False``.
FN<46>initialrc<00>T<00><01>dd<02>}t<00><00><00>||<02><00>dS)Nrc<00>"<00>d|_d|_dS<00>NT)r$r%rs r<00> on_updatez/SecureCookieSession.__init__.<locals>.on_updateHs<00><00> <20>D<EFBFBD>M<EFBFBD> <20>D<EFBFBD>M<EFBFBD>M<EFBFBD>Mr)rN)<02>super<65>__init__)rr)r-<00> __class__s <20>rr/zSecureCookieSession.__init__Gs9<00><><00> !<21> !<21> !<21> !<21> <0E><07><07><18><18><17>)<29>,<2C>,<2C>,<2C>,<2C>,r<00>keyc<00>T<00><01>d|_t<00><00><00>|<01><00>Sr,)r%r.<00> __getitem__)rr1r0s <20>rr3zSecureCookieSession.__getitem__Ns"<00><><00><1C><04> <0A><14>w<EFBFBD>w<EFBFBD>"<22>"<22>3<EFBFBD>'<27>'<27>'r<00>defaultc<00>V<00><01>d|_t<00><00><00>||<02><00>Sr,)r%r.r<00>rr1r4r0s <20>rrzSecureCookieSession.getRs"<00><><00><1C><04> <0A><14>w<EFBFBD>w<EFBFBD>{<7B>{<7B>3<EFBFBD><07>(<28>(<28>(rc<00>V<00><01>d|_t<00><00><00>||<02><00>Sr,)r%r.<00>
setdefaultr6s <20>rr8zSecureCookieSession.setdefaultVs$<00><><00><1C><04> <0A><14>w<EFBFBD>w<EFBFBD>!<21>!<21>#<23>w<EFBFBD>/<2F>/<2F>/r)N)rrrr r$r%<00>t<>Anyr/<00>strr3rr8<00> __classcell__)r0s@rr(r(1s<00><><00><00><00><00><00><08><08><15>H<EFBFBD> <15>H<EFBFBD>-<2D>-<2D><01><05>-<2D><14>-<2D>-<2D>-<2D>-<2D>-<2D>-<2D>(<28>s<EFBFBD>(<28>q<EFBFBD>u<EFBFBD>(<28>(<28>(<28>(<28>(<28>(<28>)<29>)<29>s<EFBFBD>)<29>Q<EFBFBD>U<EFBFBD>)<29>a<EFBFBD>e<EFBFBD>)<29>)<29>)<29>)<29>)<29>)<29>0<>0<>c<EFBFBD>0<>A<EFBFBD>E<EFBFBD>0<>Q<EFBFBD>U<EFBFBD>0<>0<>0<>0<>0<>0<>0<>0<>0<>0rr(c<00>X<00>eZdZdZdejdejddfd<06>ZexZxZxZ xZ
xZ xZ Z [dS)<08> NullSessionz<6E>Class used to generate nicer error messages if sessions are not
available. Will still allow read-only access to the empty session
but fail on setting.
<20>args<67>kwargsrz te.NoReturnc<00> <00>td<01><00><00>)Nz<4E>The session is unavailable because no secret key was set. Set the secret_key on the application to something unique and secret.)<01> RuntimeError)rr?r@s r<00>_failzNullSession._failas<00><00><1A> :<3A>
<EFBFBD>
<EFBFBD>
rN)rrrr r9r:rC<00> __setitem__<5F> __delitem__<5F>clear<61>pop<6F>popitem<65>updater8r&rrr>r>[so<00><00><00><00><00><00><08><08>

<EFBFBD>1<EFBFBD>5<EFBFBD>
<EFBFBD>A<EFBFBD>E<EFBFBD>
<EFBFBD>m<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD>OT<01>S<>K<EFBFBD>S<>+<2B>S<><05>S<><03>S<>g<EFBFBD>S<><06><1A> <0A><05>rr>c<00>0<00>eZdZdZeZdZdddefd<06>Zdede fd<08>Z
ddde fd <09>Z ddde je fd
<EFBFBD>Zddde fd <0B>Zddde fd <0C>Zddde fd <0A>Zddde fd<0E>Zdddede jefd<10>Zdddede fd<11>Zddddde jefd<14>Zdddeddddfd<18>ZdS)<19>SessionInterfacea4The basic interface you have to implement in order to replace the
default session interface which uses werkzeug's securecookie
implementation. The only methods you have to implement are
:meth:`open_session` and :meth:`save_session`, the others have
useful defaults which you don't need to change.
The session object returned by the :meth:`open_session` method has to
provide a dictionary like interface plus the properties and methods
from the :class:`SessionMixin`. We recommend just subclassing a dict
and adding that mixin::
class Session(dict, SessionMixin):
pass
If :meth:`open_session` returns ``None`` Flask will call into
:meth:`make_null_session` to create a session that acts as replacement
if the session support cannot work because some requirement is not
fulfilled. The default :class:`NullSession` class that is created
will complain that the secret key was not set.
To replace the session interface on an application all you have to do
is to assign :attr:`flask.Flask.session_interface`::
app = Flask(__name__)
app.session_interface = MySessionInterface()
Multiple requests with the same session may be sent and handled
concurrently. When implementing a new session interface, consider
whether reads or writes to the backing store must be synchronized.
There is no guarantee on the order in which the session for each
request is opened or saved, it will occur in the order that requests
begin and end processing.
.. versionadded:: 0.8
F<>appr rc<00>*<00>|<00><00><00>S)a<>Creates a null session which acts as a replacement object if the
real session support could not be loaded due to a configuration
error. This mainly aids the user experience because the job of the
null session is to still support lookup without complaining but
modifications are answered with a helpful error message of what
failed.
This creates an instance of :attr:`null_session_class` by default.
)<01>null_session_class<73>rrLs r<00>make_null_sessionz"SessionInterface.make_null_session<6F>s<00><00><14>&<26>&<26>(<28>(<28>(r<00>objc<00>,<00>t||j<00><00>S)z<>Checks if a given object is a null session. Null sessions are
not asked to be saved.
This checks if the object is an instance of :attr:`null_session_class`
by default.
)<02>
isinstancerN)rrQs r<00>is_null_sessionz SessionInterface.is_null_session<6F>s<00><00><1A>#<23>t<EFBFBD>6<>7<>7<>7rc<00><00>|jdS)zJThe name of the session cookie. Uses``app.config["SESSION_COOKIE_NAME"]``.<2E>SESSION_COOKIE_NAME<4D><01>configrOs r<00>get_cookie_namez SessionInterface.get_cookie_name<6D>s<00><00><12>z<EFBFBD>/<2F>0<>0rc<00><><00>|jd}|<02>|r|ndS|jd}|s d|jd<dS|<02>dd<06><00>d<00>d<08><00>}d|vr&tj|<02>d |<02>d
<EFBFBD><04><00>d|jd<dSt |<02><00>}|rtjd <0B><00>|<00>|<01><00>d kr|sd|<02><00>}||jd<|S) aMReturns the domain that should be set for the session cookie.
Uses ``SESSION_COOKIE_DOMAIN`` if it is configured, otherwise
falls back to detecting the domain based on ``SERVER_NAME``.
Once detected (or if not set at all), ``SESSION_COOKIE_DOMAIN`` is
updated to avoid re-running the logic.
<20>SESSION_COOKIE_DOMAINN<4E> SERVER_NAMEF<45>:r r<00>.zd is not a valid cookie domain, it must contain a '.'. Add an entry to your hosts file, for example 'z$.localdomain', and use that instead.z<>The session cookie domain is an IP address. This may not work as intended in some browsers. Add an entry to your hosts file, for example "localhost.localdomain", and use that instead.<2E>/)rX<00>rsplit<69>lstrip<69>warnings<67>warnr
<00>get_cookie_path)rrL<00>rv<72>ips r<00>get_cookie_domainz"SessionInterface.get_cookie_domain<69>s2<00><00><11>Z<EFBFBD>/<2F> 0<><02> <0E>><3E><1B>%<25>2<EFBFBD>2<EFBFBD><14> %<25> <10>Z<EFBFBD> <0A> &<26><02><12> <18>27<32>C<EFBFBD>J<EFBFBD>.<2E> /<2F><17>4<EFBFBD><10>Y<EFBFBD>Y<EFBFBD>s<EFBFBD>A<EFBFBD> <1E> <1E>q<EFBFBD> !<21> (<28> (<28><13> -<2D> -<2D><02> <0E>b<EFBFBD>=<3D>=<3D> <15>M<EFBFBD><15>><3E>><3E><17>><3E>><3E>><3E> <0E> <0E> <0E>
38<33>C<EFBFBD>J<EFBFBD>.<2E> /<2F><17>4<EFBFBD> <12>2<EFBFBD>Y<EFBFBD>Y<EFBFBD><02> <0A> <0E> <14>M<EFBFBD><1C> <0E> <0E> <0E> <10> <1F> <1F><03> $<24> $<24><03> +<2B> +<2B>B<EFBFBD> +<2B><19>R<EFBFBD><18><18>B<EFBFBD>.0<EFBFBD><03>
<EFBFBD>*<2A>+<2B><11> rc<00>6<00>|jdp |jdS)aReturns the path for which the cookie should be valid. The
default implementation uses the value from the ``SESSION_COOKIE_PATH``
config var if it's set, and falls back to ``APPLICATION_ROOT`` or
uses ``/`` if it's ``None``.
<20>SESSION_COOKIE_PATH<54>APPLICATION_ROOTrWrOs rrdz SessionInterface.get_cookie_path<74>s<00><00> <13>z<EFBFBD>/<2F>0<>R<>C<EFBFBD>J<EFBFBD>?Q<>4R<34>Rrc<00><00>|jdS)z<>Returns True if the session cookie should be httponly. This
currently just returns the value of the ``SESSION_COOKIE_HTTPONLY``
config var.
<20>SESSION_COOKIE_HTTPONLYrWrOs r<00>get_cookie_httponlyz$SessionInterface.get_cookie_httponly<6C><00><00><00>
<13>z<EFBFBD>3<>4<>4rc<00><00>|jdS)z<>Returns True if the cookie should be secure. This currently
just returns the value of the ``SESSION_COOKIE_SECURE`` setting.
<20>SESSION_COOKIE_SECURErWrOs r<00>get_cookie_securez"SessionInterface.get_cookie_secures<00><00><13>z<EFBFBD>1<>2<>2rc<00><00>|jdS)z<>Return ``'Strict'`` or ``'Lax'`` if the cookie should use the
``SameSite`` attribute. This currently just returns the value of
the :data:`SESSION_COOKIE_SAMESITE` setting.
<20>SESSION_COOKIE_SAMESITErWrOs r<00>get_cookie_samesitez$SessionInterface.get_cookie_samesiternr<00>sessionc<00>`<00>|jr&tjtj<00><00>|jzSdS)aA helper method that returns an expiration date for the session
or ``None`` if the session is linked to the browser session. The
default implementation returns now + the permanent session
lifetime configured on the application.
N)rr<00>nowr<00>utc<74>permanent_session_lifetime<6D>rrLrus r<00>get_expiration_timez$SessionInterface.get_expiration_time s/<00><00> <13> <1C> O<01><1B><<3C><08> <0C>-<2D>-<2D><03>0N<30>N<> N<><13>trc<00>8<00>|jp|jo |jdS)a<>Used by session backends to determine if a ``Set-Cookie`` header
should be set for this session cookie for this response. If the session
has been modified, the cookie is set. If the session is permanent and
the ``SESSION_REFRESH_EACH_REQUEST`` config is true, the cookie is
always set.
This check is usually skipped if the session was deleted.
.. versionadded:: 0.11
<20>SESSION_REFRESH_EACH_REQUEST)r$rrXrzs r<00>should_set_cookiez"SessionInterface.should_set_cookies'<00><00><17><1F>
<EFBFBD> <13> <1D> L<>#<23>*<2A>-K<>"L<>
r<00>requestr c<00><00>t<00><00><00>)a<>This is called at the beginning of each request, after
pushing the request context, before matching the URL.
This must return an object which implements a dictionary-like
interface as well as the :class:`SessionMixin` interface.
This will return ``None`` to indicate that loading failed in
some way that is not immediately an error. The request
context will fall back to using :meth:`make_null_session`
in this case.
<20><01>NotImplementedError)rrLrs r<00> open_sessionzSessionInterface.open_session)s<00><00>"<22>#<23>#<23>#r<00>responserNc<00><00>t<00><00><00>)z<>This is called at the end of each request, after generating
a response, before removing the request context. It is skipped
if :meth:`is_null_session` returns ``True``.
r<>)rrLrur<>s r<00> save_sessionzSessionInterface.save_session9s<00><00>"<22>#<23>#<23>#r)rrrr r>rN<00> pickle_basedrP<00>objectrrTr;rYr9<00>Optionalrgrdrmrqrtrrr{r~r<>r<>r&rrrKrKls<00><00><00><00><00><00>"<08>"<08>P%<25><16><19>L<EFBFBD>
)<29>W<EFBFBD>
)<29><1B>
)<29>
)<29>
)<29>
)<29>8<>6<EFBFBD>8<>d<EFBFBD>8<>8<>8<>8<>1<>7<EFBFBD>1<>s<EFBFBD>1<>1<>1<>1<>8<12>W<EFBFBD>8<12><11><1A>C<EFBFBD><1F>8<12>8<12>8<12>8<12>tS<01>7<EFBFBD>S<01>s<EFBFBD>S<01>S<01>S<01>S<01>5<>w<EFBFBD>5<>4<EFBFBD>5<>5<>5<>5<>3<>W<EFBFBD>3<><14>3<>3<>3<>3<> 5<>w<EFBFBD>5<>3<EFBFBD>5<>5<>5<>5<>
<14><1A>
<14>%1<>
<14>
<EFBFBD><1A>H<EFBFBD> <1D>
<14>
<14>
<14>
<14>
<EFBFBD>W<EFBFBD>
<EFBFBD>|<7C>
<EFBFBD><04>
<EFBFBD>
<EFBFBD>
<EFBFBD>
<EFBFBD> $<24><1A>$<24>%.<2E>$<24>
<EFBFBD><1A>L<EFBFBD> !<21>$<24>$<24>$<24>$<24> $<24><1A>$<24>%1<>$<24>=G<>$<24> <0A>$<24>$<24>$<24>$<24>$<24>$rrKc<00><><00>eZdZdZdZeej<00><00>ZdZ e
Z e Z dddejefd<07>Zdddd deje fd
<EFBFBD>Zddd ed d ddfd<0F>ZdS)<10>SecureCookieSessionInterfacezuThe default session interface that stores sessions in signed cookies
through the :mod:`itsdangerous` module.
zcookie-session<6F>hmacrLr rc<00><><00>|jsdSt|j|j<00><01><00>}t |j|j|j|<02><02><00>S)N)<02>key_derivation<6F> digest_method)<03>salt<6C>
serializer<EFBFBD> signer_kwargs)<07>
secret_key<EFBFBD>dictr<74>r<>rr<>r<>)rrLr<>s r<00>get_signing_serializerz3SecureCookieSessionInterface.get_signing_serializerYs]<00><00><13>~<7E> <18><17>4<EFBFBD><1C><1F>.<2E>d<EFBFBD>>P<>
<EFBFBD>
<EFBFBD>
<EFBFBD> <0A>&<26> <0F>N<EFBFBD><15><19><1B><EFBFBD>'<27> 
<EFBFBD>
<EFBFBD>
<EFBFBD>
rrr c<00><><00>|<00>|<01><00>}|<03>dS|j<00>|<00>|<01><00><00><00>}|s|<00><00><00>St |j<00><00><00><00><00>} |<03>||<05><01><00>}|<00>|<06><00>S#t$r|<00><00><00>cYSwxYw)N)<01>max_age)
r<EFBFBD><00>cookiesrrY<00> session_class<73>intry<00> total_seconds<64>loadsr)rrLr<00>s<>valr<6C><00>datas rr<>z)SecureCookieSessionInterface.open_sessionhs<><00><00> <11> '<27> '<27><03> ,<2C> ,<2C><01> <0C>9<EFBFBD><17>4<EFBFBD><15>o<EFBFBD>!<21>!<21>$<24>"6<>"6<>s<EFBFBD>";<3B>";<3B><<3C><<3C><03><12> (<28><17>%<25>%<25>'<27>'<27> '<27><15>c<EFBFBD>4<>B<>B<>D<>D<>E<>E<><07> (<28><14>7<EFBFBD>7<EFBFBD>3<EFBFBD><07>7<EFBFBD>0<>0<>D<EFBFBD><17>%<25>%<25>d<EFBFBD>+<2B>+<2B> +<2B><><1B> (<28> (<28> (<28><17>%<25>%<25>'<27>'<27> '<27> '<27> '<27> (<28><><EFBFBD>s<00>+B0<00>0C<03>Crur<>rNc
<00><><00>|<00>|<01><00>}|<00>|<01><00>}|<00>|<01><00>}|<00>|<01><00>}|<00>|<01><00>}|<00>|<01><00>} |jr|j<00>d<01><00>|s>|j r5|<03>
|||||| <09><02><00>|j<00>d<01><00>dS|<00> ||<02><00>sdS|<00> ||<02><00>}
|<00> |<01><00><00>t|<02><00><00><00>} |<03>|| |
| ||||<08><03><00>|j<00>d<01><00>dS)N<>Cookie)<05>domain<69>path<74>secure<72>samesite<74>httponly)<06>expiresr<73>r<>r<>r<>r<>)rYrgrdrqrtrmr%<00>vary<72>addr$<00> delete_cookier~r{r<><00>dumpsr<73><00>
set_cookie) rrLrur<><00>namer<65>r<>r<>r<>r<>r<>r<>s rr<>z)SecureCookieSessionInterface.save_sessionxs<><00><00><14>#<23>#<23>C<EFBFBD>(<28>(<28><04><15>'<27>'<27><03>,<2C>,<2C><06><13>#<23>#<23>C<EFBFBD>(<28>(<28><04><15>'<27>'<27><03>,<2C>,<2C><06><17>+<2B>+<2B>C<EFBFBD>0<>0<><08><17>+<2B>+<2B>C<EFBFBD>0<>0<><08> <13> <1B> (<28> <14>M<EFBFBD> <1D> <1D>h<EFBFBD> '<27> '<27> '<27><17> <13><16><1F> ,<2C><18>&<26>&<26><18>!<21><1D>!<21>%<25>%<25> '<27><12><12><12><19> <0A>!<21>!<21>(<28>+<2B>+<2B>+<2B> <12>F<EFBFBD><13>%<25>%<25>c<EFBFBD>7<EFBFBD>3<>3<> <13> <12>F<EFBFBD><16>*<2A>*<2A>3<EFBFBD><07>8<>8<><07><12>)<29>)<29>#<23>.<2E>.<2E>4<>4<>T<EFBFBD>'<27>]<5D>]<5D>C<>C<><03><10><1B><1B> <10> <0F><1B><1D><19><15><19><1D> <1C>
<EFBFBD>
<EFBFBD>
<EFBFBD> <11> <0A><19><19>(<28>#<23>#<23>#<23>#<23>#r)rrrr r<><00> staticmethod<6F>hashlib<69>sha1r<31>r<><00>session_json_serializerr<72>r(r<>r9r<>rr<>r<>rr<>r&rrr<>r<>Fs<><00><00><00><00><00><00><08><08> <1C>D<EFBFBD> <20>L<EFBFBD><17><1C>.<2E>.<2E>M<EFBFBD><1C>N<EFBFBD>)<29>J<EFBFBD>'<27>M<EFBFBD> 
<EFBFBD><1A> 
<EFBFBD>
<EFBFBD><1A>*<2A> +<2B> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD> 
<EFBFBD>(<28><1A>(<28>%.<2E>(<28>
<EFBFBD><1A>'<27> (<28>(<28>(<28>(<28>(<28> -$<24><1A>-$<24>%1<>-$<24>=G<>-$<24> <0A>-$<24>-$<24>-$<24>-$<24>-$<24>-$rr<>)r<><00>typingr9rb<00>collections.abcrrr<00> itsdangerousrr<00>werkzeug.datastructuresr<00>helpersr
<00>json.tagr <00> TYPE_CHECKING<4E>typing_extensions<6E>terLr <00>wrappersr rrr(r>rKr<>r<>r&rr<00><module>r<>s<><00><01><0E><0E><0E><0E><12><12><12><12><0F><0F><0F><0F>*<2A>*<2A>*<2A>*<2A>*<2A>*<2A><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D><1D>%<25>%<25>%<25>%<25>%<25>%<25>/<2F>/<2F>/<2F>/<2F>/<2F>/<2F>0<>0<>0<>0<>0<>0<><1A><1A><1A><1A><1A><1A>*<2A>*<2A>*<2A>*<2A>*<2A>*<2A><04>?<3F>,<2C>"<22>"<22>"<22>"<22><1A><1A><1A><1A><1A><1A>+<2B>+<2B>+<2B>+<2B>+<2B>+<2B>+<2B>+<2B><14><14><14><14><14>><3E><14><14><14>8'0<>'0<>'0<>'0<>'0<>,<2C> <0C>'0<>'0<>'0<>T<0E><0E><0E><0E><0E>%<25><0E><0E><0E>"T$<24>T$<24>T$<24>T$<24>T$<24>T$<24>T$<24>T$<24>n/<2F>.<2E>0<>0<><17>_$<24>_$<24>_$<24>_$<24>_$<24>#3<>_$<24>_$<24>_$<24>_$<24>_$r