Skip to content

Commit 1001e0f

Browse files
committed
Add auth settings
1 parent 53d7a83 commit 1001e0f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/app/core/config.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ class CORSSettings(BaseSettings):
141141
CORS_HEADERS: list[str] = ["*"]
142142

143143

144+
class AuthSettings(BaseSettings):
145+
ENABLE_LOCAL_AUTH: bool = True
146+
GOOGLE_CLIENT_ID: str | None = None
147+
GOOGLE_CLIENT_SECRET: str | None = None
148+
MICROSOFT_CLIENT_ID: str | None = None
149+
MICROSOFT_CLIENT_SECRET: str | None = None
150+
MICROSOFT_TENANT: str | None = None
151+
152+
144153
class Settings(
145154
AppSettings,
146155
PostgresSettings,
@@ -155,6 +164,7 @@ class Settings(
155164
CRUDAdminSettings,
156165
EnvironmentSettings,
157166
CORSSettings,
167+
AuthSettings,
158168
):
159169
model_config = SettingsConfigDict(
160170
env_file=os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", ".env"),

src/app/core/setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from ..models import * # noqa: F403
1919
from .config import (
2020
AppSettings,
21+
AuthSettings,
2122
ClientSideCacheSettings,
2223
CORSSettings,
2324
DatabaseSettings,
@@ -86,6 +87,7 @@ def lifespan_factory(
8687
| RedisQueueSettings
8788
| RedisRateLimiterSettings
8889
| EnvironmentSettings
90+
| AuthSettings
8991
),
9092
create_tables_on_start: bool = True,
9193
) -> Callable[[FastAPI], _AsyncGeneratorContextManager[Any]]:
@@ -142,6 +144,7 @@ def create_application(
142144
| RedisQueueSettings
143145
| RedisRateLimiterSettings
144146
| EnvironmentSettings
147+
| AuthSettings
145148
),
146149
create_tables_on_start: bool = True,
147150
lifespan: Callable[[FastAPI], _AsyncGeneratorContextManager[Any]] | None = None,

0 commit comments

Comments
 (0)