Skip to content

Commit 1bf8c21

Browse files
committed
Merge branch 'main' of github.com:mpg-age-bioinformatics/myapp
2 parents 46bd8b4 + 4305391 commit 1bf8c21

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Config(object):
5050
COMMIT = commit
5151
ADMINS = os.environ.get('ADMINS').split(",") or ['[email protected]']
5252
PREAUTH = os.environ.get('PREAUTH') or False
53+
WHITELISTED_IPS = os.environ.get('WHITELISTED_IPS') or ""
5354

5455
# PRIVATE_APPS = os.environ.get('PRIVATE_APPS') or None
5556

myapp/routes/_utils.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,19 @@ def password_check(password):
4646
lowercase_error = re.search(r"[a-z]", password) is None
4747

4848
# searching for symbols
49-
symbol_error = re.search(r"[ !#$%&'()*+,-./[\\\]^_`{|}~"+r'"]', password) is None
49+
symbol_error = re.search(r"[ !#$%&'()*@+,-./[\\\]^_`{|}~"+r'"]', password) is None
5050

5151
# overall result
5252
password_ok = not ( length_error or digit_error or uppercase_error or lowercase_error or symbol_error )
5353

54-
if length_error or digit_error :
55-
pass_type="weak"
56-
elif uppercase_error or lowercase_error or symbol_error:
57-
pass_type="medium"
54+
if length_error :
55+
pass_type="short"
56+
elif digit_error:
57+
pass_type="digit_none"
58+
elif uppercase_error or lowercase_error:
59+
pass_type="case_none"
60+
elif symbol_error:
61+
pass_type="symbol_none"
5862
else:
5963
pass_type="strong"
6064

myapp/routes/register.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,14 @@ def check_logged(pathname):
188188
prevent_initial_call=True)
189189
def check_pass_power(passA):
190190
passdic=password_check(passA)
191-
if passdic["passtype"] == "weak":
192-
return dbc.Alert( "please use a strong password" ,color="danger")
193-
elif passdic["passtype"] == "medium":
194-
return dbc.Alert( "please use a strong password" ,color="warning")
191+
if passdic["passtype"] == "short":
192+
return dbc.Alert( "password is too short" ,color="danger")
193+
elif passdic["passtype"] == "digit_none":
194+
return dbc.Alert( "password must contain at least one digit" ,color="warning")
195+
elif passdic["passtype"] == "case_none":
196+
return dbc.Alert( "password must contain at least one lowercase and uppercase letter" ,color="warning")
197+
elif passdic["passtype"] == "symbol_none":
198+
return dbc.Alert( "password must contain at least one symbol" ,color="warning")
195199
elif passdic["passtype"] == "strong":
196200
return dbc.Alert( "strong password" ,id="alert-auto", color="success",is_open=True, duration=1500)
197201

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@ Werkzeug==2.2.2
7070
wheel==0.38.4
7171
wrapt==1.14.1
7272
WTForms==3.0.1
73+
biopython==1.84
74+
reportlab==4.2.5

0 commit comments

Comments
 (0)