Skip to content

Commit

Permalink
docstring line-wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder authored and Petr Viktorin committed Nov 22, 2017
1 parent e8eb3ee commit 1c23992
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions Lib/ldap/sasl.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,27 @@


class sasl:
"""This class handles SASL interactions for authentication.
"""
This class handles SASL interactions for authentication.
If an instance of this class is passed to ldap's sasl_bind_s()
method, the library will call its callback() method. For
specific SASL authentication mechanisms, this method can be
overridden"""
overridden
"""

def __init__(self, cb_value_dict, mech):
""" The (generic) base class takes a cb_value_dictionary of
"""
The (generic) base class takes a cb_value_dictionary of
question-answer pairs. Questions are specified by the respective
SASL callback id's. The mech argument is a string that specifies
the SASL mechaninsm to be uesd."""
the SASL mechaninsm to be uesd.
"""
self.cb_value_dict = cb_value_dict or {}
self.mech = mech

def callback(self, cb_id, challenge, prompt, defresult):
""" The callback method will be called by the sasl_bind_s()
"""
The callback method will be called by the sasl_bind_s()
method several times. Each time it will provide the id, which
tells us what kind of information is requested (the CB_ ...
constants above). The challenge might be a short (english) text
Expand All @@ -58,7 +63,8 @@ def callback(self, cb_id, challenge, prompt, defresult):
cb_value_dictionary. Note that the current callback interface is not very
useful for writing generic sasl GUIs, which would need to know all
the questions to ask, before the answers are returned to the sasl
lib (in contrast to one question at a time)."""
lib (in contrast to one question at a time).
"""

# The following print command might be useful for debugging
# new sasl mechanisms. So it is left here
Expand All @@ -76,7 +82,9 @@ def callback(self, cb_id, challenge, prompt, defresult):


class cram_md5(sasl):
"""This class handles SASL CRAM-MD5 authentication."""
"""
This class handles SASL CRAM-MD5 authentication.
"""

def __init__(self, authc_id, password, authz_id=""):
auth_dict = {
Expand All @@ -88,7 +96,9 @@ def __init__(self, authc_id, password, authz_id=""):


class digest_md5(sasl):
"""This class handles SASL DIGEST-MD5 authentication."""
"""
This class handles SASL DIGEST-MD5 authentication.
"""

def __init__(self, authc_id, password, authz_id=""):
auth_dict = {
Expand All @@ -100,16 +110,19 @@ def __init__(self, authc_id, password, authz_id=""):


class gssapi(sasl):
"""This class handles SASL GSSAPI (i.e. Kerberos V)
authentication."""
"""
This class handles SASL GSSAPI (i.e. Kerberos V) authentication.
"""

def __init__(self, authz_id=""):
sasl.__init__(self, {CB_USER: authz_id}, "GSSAPI")


class external(sasl):
"""This class handles SASL EXTERNAL authentication
(i.e. X.509 client certificate)"""
"""
This class handles SASL EXTERNAL authentication
(i.e. X.509 client certificate)
"""

def __init__(self, authz_id=""):
sasl.__init__(self, {CB_USER: authz_id}, "EXTERNAL")

0 comments on commit 1c23992

Please sign in to comment.