Viewing File: /usr/lib/python2.7/site-packages/passlib/handlers/misc.pyo
ó
Ÿ;Xc @ s d Z d d l Z d d l Z e j e ƒ Z d d l m Z d d l m Z m
Z
d d l m Z m
Z
m Z d d l j j Z d d d g Z d e j j e j f d „ ƒ YZ e
d
ƒ Z d
Z d e j j e j f d „ ƒ YZ d e j f d „ ƒ YZ d S(
s. passlib.handlers.misc - misc generic handlers
iÿÿÿÿN( t warn( t
to_native_strt str_consteq( t unicodet ut unicode_or_bytes_typest
unix_disabledt
unix_fallbackt plaintextc B sP e Z d Z d Z d Z e d „ ƒ Z e d „ Z d „ Z e e d „ ƒ Z
RS( s… This class provides the fallback behavior for unix shadow files, and follows the :ref:`password-hash-api`.
This class does not implement a hash, but instead provides fallback
behavior as found in /etc/shadow on most unix variants.
If used, should be the last scheme in the context.
* this class will positively identify all hash strings.
* for security, passwords will always hash to ``!``.
* it rejects all passwords if the hash is NOT an empty string (``!`` or ``*`` are frequently used).
* by default it rejects all passwords if the hash is an empty string,
but if ``enable_wildcard=True`` is passed to verify(),
all passwords will be allowed through if the hash is an empty string.
.. deprecated:: 1.6
This has been deprecated due to its "wildcard" feature,
and will be removed in Passlib 1.8. Use :class:`unix_disabled` instead.
R t enable_wildcardc C s, t | t ƒ r t St j j | d ƒ ‚ d S( Nt hash( t
isinstanceR t Truet uht exct ExpectedStringError( t clsR
( ( s9 /usr/lib/python2.7/site-packages/passlib/handlers/misc.pyt identify. s c K s0 t d t ƒ t t | ƒ j | | | _ d S( Nsf 'unix_fallback' is deprecated, and will be removed in Passlib 1.8; please use 'unix_disabled' instead.( R t DeprecationWarningt superR t __init__R ( t selfR t kwds( ( s9 /usr/lib/python2.7/site-packages/passlib/handlers/misc.pyR 5 s c C s | j r | j St d ƒ Sd S( Nt !( t checksumR ( R t secret( ( s9 /usr/lib/python2.7/site-packages/passlib/handlers/misc.pyt _calc_checksum= s c C sF t j | ƒ t | t ƒ s4 t j j | d ƒ ‚ n | r>