forked from 3wordchant/capsul-flask
allow colons in ssh key comments and adjust ssh key whitespace handling
This commit is contained in:
@ -320,9 +320,9 @@ def ssh_public_keys():
|
||||
if not content or len(content.strip()) < 1:
|
||||
errors.append("Content is required")
|
||||
else:
|
||||
content = content.replace("\r", "").replace("\n", "")
|
||||
if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$", content):
|
||||
errors.append("Content must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$\"")
|
||||
content = content.replace("\r", " ").replace("\n", " ").strip()
|
||||
if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$", content):
|
||||
errors.append("Content must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@:. -]+$\"")
|
||||
|
||||
if get_model().ssh_public_key_name_exists(session["account"], name):
|
||||
errors.append("A key with that name already exists")
|
||||
|
Reference in New Issue
Block a user