summaryrefslogtreecommitdiff
path: root/sleekxmpp/thirdparty/suelta/mechanisms/anonymous.py
blob: e44e91a2afe422b45d9b69cb2e70b4101fe14eb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from sleekxmpp.thirdparty.suelta.sasl import Mechanism, register_mechanism
from sleekxmpp.thirdparty.suelta.exceptions import SASLError, SASLCancelled


class ANONYMOUS(Mechanism):

    """
    """

    def __init__(self, sasl, name):
        """
        """
        super(ANONYMOUS, self).__init__(sasl, name, 0)

    def get_values(self):
        """
        """
        return {}

    def process(self, challenge=None):
        """
        """
        return b'Anonymous, Suelta'

    def okay(self):
        """
        """
        return True

    def get_user(self):
        """
        """
        return 'anonymous'


register_mechanism('ANONYMOUS', 0, ANONYMOUS, use_hashes=False)