hidden files, allow ips
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
from datetime import datetime
|
||||
import fnmatch
|
||||
import secrets
|
||||
import string
|
||||
from datetime import datetime
|
||||
|
||||
import passlib.hash
|
||||
|
||||
VALID_TOKEN_CHARS = string.digits + string.ascii_letters
|
||||
@@ -38,3 +40,11 @@ def hash_password(password):
|
||||
|
||||
def verify_password(password, hash):
|
||||
return passlib.hash.argon2.verify(password, hash)
|
||||
|
||||
|
||||
def is_ip_allowed(allowed_ip, ip, app):
|
||||
for rule in allowed_ip.split(","):
|
||||
rule = rule.strip()
|
||||
if fnmatch.fnmatch(ip, rule):
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user