Skip to content

Commit 9eba241

Browse files
authored
Security updates (#1238)
1 parent 9f77bf0 commit 9eba241

File tree

5 files changed

+678
-422
lines changed

5 files changed

+678
-422
lines changed

core/schemas/user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"writer": roles.Role.WRITER,
2121
}
2222
SECRET_KEY = yeti_config.get("auth", "secret_key")
23+
if not SECRET_KEY:
24+
raise RuntimeError("You must set auth.secret_key in the configuration file.")
2325
ALGORITHM = yeti_config.get("auth", "algorithm")
2426

2527

core/web/apiv2/auth.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
minutes=yeti_config.get("auth", "browser_token_expire_minutes", default=43200)
2727
)
2828
SECRET_KEY = yeti_config.get("auth", "secret_key")
29+
if not SECRET_KEY:
30+
raise RuntimeError("You must set auth.secret_key in the configuration file.")
31+
2932
ALGORITHM = yeti_config.get("auth", "algorithm")
3033
YETI_AUTH = yeti_config.get("auth", "enabled")
3134
YETI_WEBROOT = yeti_config.get("system", "webroot")

core/web/webapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
SECRET_KEY = yeti_config.get("auth", "secret_key")
2929
if not SECRET_KEY:
30-
SECRET_KEY = str(os.urandom(64))
30+
raise RuntimeError("You must set auth.secret_key in the configuration file.")
3131

3232
app = FastAPI()
3333

0 commit comments

Comments
 (0)