U
    h                  
   @   s  d Z ddlZeeZddlmZ ddlmZ ddl	m
Z
 ddlmZ ddd	d
ddddddg
Zdd Ze
edZe
ddgedk rdnddddddZdddddgZe
eddgdZd d!d"ge Ze
eed#ZeeZed$d% e
eed#Zd d!d&d"d%dgZe
ed'ZeeZed" e
ed'ZeZd(d)d*d+d,d-d.gZe
eZ d/d0 Z!d1d2 Z"e
e" Z#e
d3gZ$e
d4d3gd3d5Z%e%Z&e
d6gZ'd7d8 Z(e
d9d:d;ge(d<Z)e
d:gd=d>Z*d?d@dAdBgZ+e
e+Z,e
e+dCg e+dCdDdE Z-Z.dS )Fzpasslib.apps    N)chain)hash)LazyCryptContext)sys_bitscustom_app_contextdjango_contextldap_contextldap_nocrypt_contextmysql_contextmysql4_contextmysql3_contextphpass_contextphpbb3_contextpostgres_contextc                  C   sV   ddl m}  |  }ddddddd	d
ddddddddg}|D ]}|| q:t|ddS )Nr   )list_crypt_handlersZbigcryptZcrypt16Z	cisco_pixZcisco_type7Zhtdigestmysql323Zoracle10ZlmhashZmsdccZmsdcc2ZnthashZ	plaintextldap_plaintextdjango_disabledZunix_disabledZunix_fallbacksha256_crypt)schemesdefault)Zpasslib.registryr   removedict)r   r   Zexcludedname r   2./venv/lib/python3.8/site-packages/passlib/apps.py_load_master_config   s,    r   )onloadZsha512_cryptr   @   i) i  )r   r   Zsha512_crypt__min_roundsZsha256_crypt__min_roundsZadmin__sha512_crypt__min_roundsZadmin__sha256_crypt__min_roundsZdjango_salted_sha1Zdjango_salted_md5Zdjango_des_cryptZhex_md5r   )r   r   
deprecatedZdjango_pbkdf2_sha256Zdjango_pbkdf2_sha1Zdjango_bcrypt)r   r      Zdjango_bcrypt_sha256Zdjango_argon2)r   Zldap_salted_sha512Zldap_salted_sha256Zldap_salted_sha1Zldap_salted_md5Z	ldap_sha1Zldap_md5r   c                  C   s   ddl m}  dd | D S )Nr   unix_crypt_schemesc                 s   s   | ]}d | V  qdS )Zldap_Nr   ).0r   r   r   r   	<genexpr>   s     z+_iter_ldap_crypt_schemes.<locals>.<genexpr>)passlib.utilsr"   r!   r   r   r   _iter_ldap_crypt_schemes   s    r&   c                   C   s   t tt S )z5helper which iterates over supported std ldap schemes)r   std_ldap_schemesr&   r   r   r   r   _iter_ldap_schemes   s    r(   r   Zmysql41)r   Zpostgres_md5c                  K   s   t j rdnd| d< | S )z9helper to choose default alg based on bcrypt availabilitybcryptphpassr   )r   r)   Zhas_backend)kwdsr   r   r   _create_phpass_policy   s    r,   r)   r*   Z
bsdi_crypt)r   r   H)Zphpass__identZldap_hex_sha1Zldap_hex_md5Zldap_des_cryptZroundup_plaintextZldap_pbkdf2_sha1i'  )r   r   r   Z ldap_pbkdf2_sha1__default_rounds)/__doc__ZloggingZ	getLogger__name__log	itertoolsr   Zpasslibr   Zpasslib.contextr   r%   r   __all__r   Zmaster_contextr   Z_django10_schemesZdjango10_contextZ_django14_schemesZdjango14_contextlistZ_django16_schemesinsertZdjango16_contextZ_django_110_schemesZdjango110_contextZ_django21_schemesr   Zdjango21_contextr   r'   r	   r&   r(   r   r   r   r
   r   r,   r   r   Z_std_roundup_schemesZroundup10_contextZroundup_contextZroundup15_contextr   r   r   r   <module>   s    
   '
	






