Skip to content

Commit ec0e445

Browse files
committed
Using secrets library for default secret
1 parent eb468ae commit ec0e445

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

conditional/config.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import random
2-
import string
3-
1+
import secrets
42
from os import environ as env
3+
54
from conditional import __version__
65

76
# Flask config
@@ -36,8 +35,7 @@
3635
}
3736

3837
# Openshift secret
39-
SECRET_KEY = env.get("CONDITIONAL_SECRET_KEY", default=''.join(
40-
random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(64)))
38+
SECRET_KEY = env.get("CONDITIONAL_SECRET_KEY", default=''.join(secrets.token_hex(16)))
4139

4240
# General config
4341
DUES_PER_SEMESTER = env.get("CONDITIONAL_DUES_PER_SEMESTER", 80)

0 commit comments

Comments
 (0)