Commit 7233c6f1 authored by torgiren's avatar torgiren
Browse files

Merge branch 'add_base64' into 'master'

remove sensitive chars from passwords - refs #31

See merge request !1
1 merge request!1remove sensitive chars from passwords - refs #31
Showing with 4 additions and 1 deletion
+4 -1
......@@ -12,7 +12,7 @@ def generate_name(name, namespace):
return "password-{name}-from-{namespace}".format(name=name, namespace=namespace)
def generate_password(length):
symbols = string.digits + string.ascii_letters + string.punctuation
symbols = string.digits + string.ascii_letters + "%+-,.;:<=>@^_"
password = "".join(random.SystemRandom().choice(symbols) for i in range(length))
return password
......@@ -30,6 +30,9 @@ def base(data):
def generate_crypt(password, method, logger):
crypt_name = method + "_crypt"
if crypt_name == "base64_crypt":
logger.debug("using base64")
return base(base(password))
try:
logger.debug("looking for passlib.hash.{crypt_name}".format(crypt_name=crypt_name))
crypt_fn = getattr(passlib.hash, crypt_name).hash
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment