
    qh                         S r  " S S\5      rg)zI
This module contains the definition of the C{L{OpenIDStore}}
interface.
c                   F    \ rS rSrSrS rSS jrS rS rS r	S	 r
S
 rSrg)OpenIDStore   a  
This is the interface for the store objects the OpenID library
uses.  It is a single class that provides all of the persistence
mechanisms that the OpenID library needs, for both servers and
consumers.

@change: Version 2.0 removed the C{storeNonce}, C{getAuthKey}, and C{isDumb}
    methods, and changed the behavior of the C{L{useNonce}} method
    to support one-way nonces.  It added C{L{cleanupNonces}},
    C{L{cleanupAssociations}}, and C{L{cleanup}}.

@sort: storeAssociation, getAssociation, removeAssociation,
    useNonce
c                     [         e)a  
This method puts a C{L{Association
<openid.association.Association>}} object into storage,
retrievable by server URL and handle.


@param server_url: The URL of the identity server that this
    association is with.  Because of the way the server
    portion of the library uses this interface, don't assume
    there are any limitations on the character set of the
    input string.  In particular, expect to see unescaped
    non-url-safe characters in the server_url field.

@type server_url: C{str}


@param association: The C{L{Association
    <openid.association.Association>}} to store.

@type association: C{L{Association
    <openid.association.Association>}}


@return: C{None}

@rtype: C{NoneType}
NotImplementedError)self
server_urlassociations      H/var/www/html/env/lib/python3.13/site-packages/openid/store/interface.pystoreAssociationOpenIDStore.storeAssociation   
    8 "!    Nc                     [         e)aj  
This method returns an C{L{Association
<openid.association.Association>}} object from storage that
matches the server URL and, if specified, handle. It returns
C{None} if no such association is found or if the matching
association is expired.

If no handle is specified, the store may return any
association which matches the server URL.  If multiple
associations are valid, the recommended return value for this
method is the one most recently issued.

This method is allowed (and encouraged) to garbage collect
expired associations when found. This method must not return
expired associations.


@param server_url: The URL of the identity server to get the
    association for.  Because of the way the server portion of
    the library uses this interface, don't assume there are
    any limitations on the character set of the input string.
    In particular, expect to see unescaped non-url-safe
    characters in the server_url field.

@type server_url: C{str}


@param handle: This optional parameter is the handle of the
    specific association to get.  If no specific handle is
    provided, any valid association matching the server URL is
    returned.

@type handle: C{str} or C{NoneType}


@return: The C{L{Association
    <openid.association.Association>}} for the given identity
    server.

@rtype: C{L{Association <openid.association.Association>}} or
    C{NoneType}
r   r   r	   handles      r   getAssociationOpenIDStore.getAssociation5   s    V "!r   c                     [         e)a,  
This method removes the matching association if it's found,
and returns whether the association was removed or not.


@param server_url: The URL of the identity server the
    association to remove belongs to.  Because of the way the
    server portion of the library uses this interface, don't
    assume there are any limitations on the character set of
    the input string.  In particular, expect to see unescaped
    non-url-safe characters in the server_url field.

@type server_url: C{str}


@param handle: This is the handle of the association to
    remove.  If there isn't an association found that matches
    both the given URL and handle, then there was no matching
    handle found.

@type handle: C{str}


@return: Returns whether or not the given association existed.

@rtype: C{bool} or C{int}
r   r   s      r   removeAssociationOpenIDStore.removeAssociationb   r   r   c                     [         e)aS  Called when using a nonce.

This method should return C{True} if the nonce has not been
used before, and store it for a while to make sure nobody
tries to use the same value again.  If the nonce has already
been used or the timestamp is not current, return C{False}.

You may use L{openid.store.nonce.SKEW} for your timestamp window.

@change: In earlier versions, round-trip nonces were used and
   a nonce was only valid if it had been previously stored
   with C{storeNonce}.  Version 2.0 uses one-way nonces,
   requiring a different implementation here that does not
   depend on a C{storeNonce} call.  (C{storeNonce} is no
   longer part of the interface.)

@param server_url: The URL of the server from which the nonce
    originated.

@type server_url: C{str}

@param timestamp: The time that the nonce was created (to the
    nearest second), in seconds since January 1 1970 UTC.
@type timestamp: C{int}

@param salt: A random string that makes two nonces from the
    same server issued during the same second unique.
@type salt: str

@return: Whether or not the nonce was valid.

@rtype: C{bool}
r   )r   r	   	timestampsalts       r   useNonceOpenIDStore.useNonce   s    D "!r   c                     [         e)ab  Remove expired nonces from the store.

Discards any nonce from storage that is old enough that its
timestamp would not pass L{useNonce}.

This method is not called in the normal operation of the
library.  It provides a way for store admins to keep
their storage from filling up with expired data.

@return: the number of nonces expired.
@returntype: int
r   r   s    r   cleanupNoncesOpenIDStore.cleanupNonces   s
     "!r   c                     [         e)a  Remove expired associations from the store.

This method is not called in the normal operation of the
library.  It provides a way for store admins to keep
their storage from filling up with expired data.

@return: the number of associations expired.
@returntype: int
r   r   s    r   cleanupAssociationsOpenIDStore.cleanupAssociations   s
     "!r   c                 B    U R                  5       U R                  5       4$ )zShortcut for C{L{cleanupNonces}()}, C{L{cleanupAssociations}()}.

This method is not called in the normal operation of the
library.  It provides a way for store admins to keep
their storage from filling up with expired data.
)r   r"   r   s    r   cleanupOpenIDStore.cleanup   s!     !!#T%=%=%???r    )N)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r"   r%   __static_attributes__r'   r   r   r   r      s-    "<+"Z"<""H"
"@r   r   N)r,   objectr   r'   r   r   <module>r/      s   @& @r   