feat!: the general.secret_key
configuration field is now required (#2841)
BREAKING CHANGE: The `general.secret_key` configuration field is now required. Make sure to update your configuration file and add a secret key. Closes #2426
This commit is contained in:
parent
24ee3830c2
commit
0d2d1a2673
12 changed files with 20 additions and 26 deletions
|
@ -1,5 +1,4 @@
|
|||
from os import getenv
|
||||
from warnings import warn
|
||||
|
||||
# pylint: disable=unused-import
|
||||
from ._internal import (
|
||||
|
@ -25,15 +24,7 @@ LIBRETIME_CONFIG_FILEPATH = getenv("LIBRETIME_CONFIG_FILEPATH")
|
|||
|
||||
CONFIG = Config(LIBRETIME_CONFIG_FILEPATH) # type: ignore[arg-type, misc]
|
||||
|
||||
if CONFIG.general.secret_key is None:
|
||||
warn(
|
||||
"The [general.secret_key] configuration field is not set but will be required "
|
||||
"in the next major release. Using [general.api_key] as fallback.",
|
||||
FutureWarning,
|
||||
)
|
||||
SECRET_KEY = CONFIG.general.api_key
|
||||
else:
|
||||
SECRET_KEY = CONFIG.general.secret_key
|
||||
SECRET_KEY = CONFIG.general.secret_key
|
||||
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue