summaryrefslogtreecommitdiff
path: root/passlib/utils
diff options
context:
space:
mode:
authorEli Collins <elic@assurancetechnologies.com>2011-12-22 20:03:00 -0500
committerEli Collins <elic@assurancetechnologies.com>2011-12-22 20:03:00 -0500
commitef5e536b7983c2180311ce2996796ed9f483650c (patch)
tree3aba394d55632bdded97298eecee6a35a1366e45 /passlib/utils
parent0e5c0ff9648ffd16b9a333fb4c113f3e7831e3f1 (diff)
downloadpasslib-ef5e536b7983c2180311ce2996796ed9f483650c.tar.gz
large rewrite of how CryptPolicy is parsed and compiled; should result in *much* shorter codepath when calling CryptContext.encrypt(), etc
Diffstat (limited to 'passlib/utils')
-rw-r--r--passlib/utils/__init__.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/passlib/utils/__init__.py b/passlib/utils/__init__.py
index 204bffd..d14ca5f 100644
--- a/passlib/utils/__init__.py
+++ b/passlib/utils/__init__.py
@@ -130,6 +130,20 @@ class MissingBackendError(RuntimeError):
from :class:`~passlib.utils.handlers.HasManyBackends`.
"""
+class PasslibPolicyWarning(UserWarning):
+ """Warning issued when non-fatal issue is found in policy configuration.
+
+ This occurs primarily in one of two cases:
+
+ * the policy contains rounds limits which exceed the hard limits
+ imposed by the underlying algorithm.
+ * an explicit rounds value was provided which exceeds the limits
+ imposed by the policy.
+
+ In both of these cases, the code will perform correctly & securely;
+ but the warning is issued as a sign the configuration may need updating.
+ """
+
#==========================================================
#bytes compat aliases - bytes, native_str, b()
#==========================================================
@@ -536,7 +550,13 @@ def consteq(left, right):
return result == 0
def splitcomma(source, sep=","):
- "split comma-separated string into list of elements, stripping whitespace and discarding empty elements"
+ """split comma-separated string into list of elements,
+ stripping whitespace and discarding empty elements.
+
+ .. deprecated:: 1.6, will be removed in 1.7
+ """
+ warn("splitcomma() is deprecated, will be removed in passlib 1.7",
+ DeprecationWarning, stacklevel=2)
return [
elem.strip()
for elem in source.split(sep)