aboutsummaryrefslogtreecommitdiffstats
path: root/bot/constants.py
diff options
context:
space:
mode:
authorGravatar shtlrs <[email protected]>2023-05-05 22:08:09 +0100
committerGravatar shtlrs <[email protected]>2023-05-06 13:20:47 +0100
commit12be2fdf771a1a25c2c135516746002154135dbf (patch)
tree108cbc37c7a2f89ae7cffeca4165ebc444b75317 /bot/constants.py
parentupdate env variables in "Attempt bot setup" stage (diff)
use `SecretStr` for all secrets
Diffstat (limited to 'bot/constants.py')
-rw-r--r--bot/constants.py33
1 files changed, 17 insertions, 16 deletions
diff --git a/bot/constants.py b/bot/constants.py
index 5f70c8b9..80ebf077 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -2,7 +2,7 @@ import enum
import logging
from os import environ
-from pydantic import BaseSettings
+from pydantic import BaseSettings, SecretStr
__all__ = (
"Branding",
@@ -106,7 +106,7 @@ class _Client(EnvConfig):
name = "Sir Lancebot"
guild = 267624335836053506
prefix = "."
- token = ""
+ token: SecretStr
debug = True
in_ci = False
github_repo = "https://github.com/python-discord/sir-lancebot"
@@ -116,6 +116,9 @@ class _Client(EnvConfig):
Client = _Client()
+print(Client.token)
+print(Client.token.get_secret_value())
+
class _Logging(EnvConfig):
EnvConfig.Config.env_prefix = "logging_"
@@ -286,17 +289,15 @@ Roles = _Roles()
class _Tokens(EnvConfig):
EnvConfig.Config.env_prefix = "tokens_"
- giphy = ""
- aoc_session_cookie = ""
- omdb = ""
- youtube = ""
- tmdb = ""
- nasa = ""
- igdb_client_id = ""
- igdb_client_secret = ""
- github = ""
- unsplash = ""
- wolfram = ""
+ giphy: SecretStr | None
+ youtube: SecretStr | None
+ tmdb: SecretStr | None
+ nasa: SecretStr | None
+ igdb_client_id: SecretStr | None
+ igdb_client_secret: SecretStr | None
+ github: SecretStr | None
+ unsplash: SecretStr | None
+ wolfram: SecretStr | None
Tokens = _Tokens()
@@ -316,7 +317,7 @@ class _Redis(EnvConfig):
host = "redis.default.svc.cluster.local"
port = 6379
- password = ""
+ password: SecretStr | None
use_fakeredis = False
@@ -337,8 +338,8 @@ class _Reddit(EnvConfig):
subreddits = ["r/Python"]
- client_id = ""
- secret = ""
+ client_id: SecretStr | None
+ secret: SecretStr | None
webhook = 635408384794951680