summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2011-02-16 12:33:44 -0500
committerEli Collins <elic@assurancetechnologies.com>2011-02-16 12:33:44 -0500
commitce0726991ad2756b890dee2bb3bcf8b72bc0123c (patch)
tree98cd0bccf14696218b0d9995b8107cb4ce371f3b
parent32ef63f9676dd15467a9e0a163a19a8bd7f150ed (diff)
downloadpasslib-ce0726991ad2756b890dee2bb3bcf8b72bc0123c.tar.gz
moved passlib.hash to passlib.drivers
-rw-r--r--passlib/__init__.py2
-rw-r--r--passlib/base.py15
-rw-r--r--passlib/drivers/__init__.py (renamed from passlib/hash/__init__.py)0
-rw-r--r--passlib/drivers/bcrypt.py (renamed from passlib/hash/bcrypt.py)2
-rw-r--r--passlib/drivers/des_crypt.py (renamed from passlib/hash/des_crypt.py)0
-rw-r--r--passlib/drivers/ext_des_crypt.py (renamed from passlib/hash/ext_des_crypt.py)0
-rw-r--r--passlib/drivers/md5_crypt.py (renamed from passlib/hash/md5_crypt.py)0
-rw-r--r--passlib/drivers/mysql.py (renamed from passlib/hash/mysql.py)0
-rw-r--r--passlib/drivers/nthash.py (renamed from passlib/hash/nthash.py)0
-rw-r--r--passlib/drivers/phpass.py (renamed from passlib/hash/phpass.py)0
-rw-r--r--passlib/drivers/postgres.py (renamed from passlib/hash/postgres.py)0
-rw-r--r--passlib/drivers/sha1_crypt.py (renamed from passlib/hash/sha1_crypt.py)0
-rw-r--r--passlib/drivers/sha2_crypt.py (renamed from passlib/hash/sha2_crypt.py)0
-rw-r--r--passlib/drivers/sun_md5_crypt.py (renamed from passlib/hash/sun_md5_crypt.py)0
14 files changed, 18 insertions, 1 deletions
diff --git a/passlib/__init__.py b/passlib/__init__.py
index 4ccc8fa..823ebf4 100644
--- a/passlib/__init__.py
+++ b/passlib/__init__.py
@@ -5,6 +5,8 @@ __version__ = "1.3"
#=========================================================
#
#=========================================================
+import passlib.base
+schemes = passlib.base.schemes
##from passlib.base import CryptContext
#=========================================================
diff --git a/passlib/base.py b/passlib/base.py
index 4513300..c8ac50b 100644
--- a/passlib/base.py
+++ b/passlib/base.py
@@ -131,6 +131,21 @@ def list_crypt_handlers():
return sorted(_builtin_names.union(x for x in dir(_hmod) if not x.startswith("_")))
#=========================================================
+#proxy object
+#=========================================================
+class PasslibHashProxy(object):
+ def __getattr__(self, attr):
+ if not attr.startswith("_"):
+ handler = get_crypt_handler(attr, None)
+ if handler is not None:
+ setattr(self, attr, handler)
+ return handler
+ raise AttributeError, "unknown password hash: %r" % (attr,)
+
+import sys
+sys.modules['passlib.schemes'] = schemes = PasslibHashProxy()
+
+#=========================================================
#policy
#=========================================================
def parse_policy_key(key):
diff --git a/passlib/hash/__init__.py b/passlib/drivers/__init__.py
index 025b6d2..025b6d2 100644
--- a/passlib/hash/__init__.py
+++ b/passlib/drivers/__init__.py
diff --git a/passlib/hash/bcrypt.py b/passlib/drivers/bcrypt.py
index b4d8cad..4521fec 100644
--- a/passlib/hash/bcrypt.py
+++ b/passlib/drivers/bcrypt.py
@@ -37,7 +37,7 @@ __all__ = [
#=========================================================
#handler
#=========================================================
-class BCrypt(BackendExtHandler):
+class BCrypt(BackendExtHash):
#=========================================================
#class attrs
#=========================================================
diff --git a/passlib/hash/des_crypt.py b/passlib/drivers/des_crypt.py
index d797a96..d797a96 100644
--- a/passlib/hash/des_crypt.py
+++ b/passlib/drivers/des_crypt.py
diff --git a/passlib/hash/ext_des_crypt.py b/passlib/drivers/ext_des_crypt.py
index 9729637..9729637 100644
--- a/passlib/hash/ext_des_crypt.py
+++ b/passlib/drivers/ext_des_crypt.py
diff --git a/passlib/hash/md5_crypt.py b/passlib/drivers/md5_crypt.py
index 6b2a1be..6b2a1be 100644
--- a/passlib/hash/md5_crypt.py
+++ b/passlib/drivers/md5_crypt.py
diff --git a/passlib/hash/mysql.py b/passlib/drivers/mysql.py
index e82700a..e82700a 100644
--- a/passlib/hash/mysql.py
+++ b/passlib/drivers/mysql.py
diff --git a/passlib/hash/nthash.py b/passlib/drivers/nthash.py
index 6efe63f..6efe63f 100644
--- a/passlib/hash/nthash.py
+++ b/passlib/drivers/nthash.py
diff --git a/passlib/hash/phpass.py b/passlib/drivers/phpass.py
index 2705a6e..2705a6e 100644
--- a/passlib/hash/phpass.py
+++ b/passlib/drivers/phpass.py
diff --git a/passlib/hash/postgres.py b/passlib/drivers/postgres.py
index cafb9b1..cafb9b1 100644
--- a/passlib/hash/postgres.py
+++ b/passlib/drivers/postgres.py
diff --git a/passlib/hash/sha1_crypt.py b/passlib/drivers/sha1_crypt.py
index da332bd..da332bd 100644
--- a/passlib/hash/sha1_crypt.py
+++ b/passlib/drivers/sha1_crypt.py
diff --git a/passlib/hash/sha2_crypt.py b/passlib/drivers/sha2_crypt.py
index 4e3fa6c..4e3fa6c 100644
--- a/passlib/hash/sha2_crypt.py
+++ b/passlib/drivers/sha2_crypt.py
diff --git a/passlib/hash/sun_md5_crypt.py b/passlib/drivers/sun_md5_crypt.py
index 2728a97..2728a97 100644
--- a/passlib/hash/sun_md5_crypt.py
+++ b/passlib/drivers/sun_md5_crypt.py