<commit_before>"""
This module contains an C{L{OpenIDStore}} implementation with no
persistent backing, for use only by limited consumers.
"""

from openid.store.interface import OpenIDStore

class DumbStore(OpenIDStore):
    """
    This is a store for use in the worst case, when you have no way of
    saving state on the consumer site. Using this store with protocol
    version 1 makes the consumer vulnerable to replay attacks, as it's
    unable to use nonces. In protocol version 2, the server will
    prevent replay attacks in stateless mode.

    Most of the methods of this class are implementation details.
    Users of this class need to worry only about the C{L{__init__}}
    method.
    """

    def storeAssociation(self, server_url, association):
        """
        This implementation does nothing.
        """
        pass

    def getAssociation(self, server_url, handle=None):
        """
        This implementation always returns C{None}.


        @return: C{None}

        @rtype: C{None}
        """
        return None

    def removeAssociation(self, server_url, handle):
        """
        This implementation always returns C{False}.


        @return: C{False}

        @rtype: C{bool}
        """
        return False

    def useNonce(self, server_url, timestamp, salt):
        """
        In a system truly limited to dumb mode, nonces must all be
        accepted.  This therefore always returns C{True}, which makes
        replay attacks feasible during the lifespan of the token.


        @return: C{True}

        @rtype: C{bool}
        """
        return True
<commit_msg>[project @ Wording in docs for openid.store.dumbstore.DumbStore.useNonce]<commit_after>"""
This module contains an C{L{OpenIDStore}} implementation with no
persistent backing, for use only by limited consumers.
"""

from openid.store.interface import OpenIDStore

class DumbStore(OpenIDStore):
    """
    This is a store for use in the worst case, when you have no way of
    saving state on the consumer site. Using this store with protocol
    version 1 makes the consumer vulnerable to replay attacks, as it's
    unable to use nonces. In protocol version 2, the server will
    prevent replay attacks in stateless mode.

    Most of the methods of this class are implementation details.
    Users of this class need to worry only about the C{L{__init__}}
    method.
    """

    def storeAssociation(self, server_url, association):
        """
        This implementation does nothing.
        """
        pass

    def getAssociation(self, server_url, handle=None):
        """
        This implementation always returns C{None}.


        @return: C{None}

        @rtype: C{None}
        """
        return None

    def removeAssociation(self, server_url, handle):
        """
        This implementation always returns C{False}.


        @return: C{False}

        @rtype: C{bool}
        """
        return False

    def useNonce(self, server_url, timestamp, salt):
        """
        In a system truly limited to dumb mode, nonces must all be
        accepted.  This therefore always returns C{True}, which means
        that the code using this store will depend on the OpenID
        server to protect against replay attacks.


        @return: C{True}

        @rtype: C{bool}
        """
        return True

{'fraction_non_alphanumeric': 0.0749925306244398, 'fraction_numerical': 0.0011951000896325067, 'mean_word_length': 2.4766355140186915, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4006782', 'n_tokens_mistral': 901, 'n_tokens_neox': 854, 'n_words': 371}