cubicweb/server/utils.py
changeset 12508 a8c1ea390400
parent 12280 577e8d3896b4
child 12567 26744ad37953
equal deleted inserted replaced
12507:211472ab15c8 12508:a8c1ea390400
    29 from six import PY2, text_type
    29 from six import PY2, text_type
    30 from six.moves import input
    30 from six.moves import input
    31 
    31 
    32 from passlib.utils import handlers as uh, to_hash_str
    32 from passlib.utils import handlers as uh, to_hash_str
    33 from passlib.context import CryptContext
    33 from passlib.context import CryptContext
    34 
       
    35 from logilab.common.deprecation import deprecated
       
    36 
    34 
    37 from cubicweb.md5crypt import crypt as md5crypt
    35 from cubicweb.md5crypt import crypt as md5crypt
    38 
    36 
    39 
    37 
    40 class CustomMD5Crypt(uh.HasSalt, uh.GenericHandler):
    38 class CustomMD5Crypt(uh.HasSalt, uh.GenericHandler):
    79             return salt
    77             return salt
    80     except ValueError:  # e.g. couldn't identify hash
    78     except ValueError:  # e.g. couldn't identify hash
    81         pass
    79         pass
    82     # wrong password
    80     # wrong password
    83     return b''
    81     return b''
    84 
       
    85 
       
    86 @deprecated('[3.22] no more necessary, directly get eschema.eid')
       
    87 def eschema_eid(cnx, eschema):
       
    88     """get eid of the CWEType entity for the given yams type.
       
    89 
       
    90     This used to be necessary because when the schema has been loaded from the
       
    91     file-system, not from the database, (e.g. during tests), eschema.eid was
       
    92     not set.
       
    93     """
       
    94     return eschema.eid
       
    95 
    82 
    96 
    83 
    97 DEFAULT_MSG = 'we need a manager connection on the repository \
    84 DEFAULT_MSG = 'we need a manager connection on the repository \
    98 (the server doesn\'t have to run, even should better not)'
    85 (the server doesn\'t have to run, even should better not)'
    99 
    86