|
10 | 10 | from pydantic import ( |
11 | 11 | AliasChoices, |
12 | 12 | AnyHttpUrl, |
| 13 | + PositiveInt, |
13 | 14 | TypeAdapter, |
14 | 15 | field_validator, |
15 | 16 | model_validator, |
|
55 | 56 |
|
56 | 57 |
|
57 | 58 | # NOTE: to mark a plugin as a DEV-FEATURE annotated it with |
58 | | -# `Field(json_schema_extra={_X_DEV_FEATURE_FLAG: True})` |
| 59 | +# `Field(json_schema_extra={_X_FEATURE_UNDER_DEVELOPMENT: True})` |
59 | 60 | # This will force it to be disabled when WEBSERVER_DEV_FEATURES_ENABLED=False |
60 | 61 | _X_FEATURE_UNDER_DEVELOPMENT: Final[str] = "x-dev-feature" |
61 | 62 |
|
62 | 63 |
|
| 64 | +class RealTimeCollaborationSettings(BaseApplicationSettings): |
| 65 | + RTC_MAX_NUMBER_OF_USERS: Annotated[ |
| 66 | + PositiveInt, |
| 67 | + Field( |
| 68 | + description="Maximum number of users allowed in a real-time collaboration session", |
| 69 | + ), |
| 70 | + ] |
| 71 | + |
| 72 | + |
63 | 73 | class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings): |
64 | 74 | # CODE STATICS --------------------------------------------------------- |
65 | 75 | API_VERSION: str = API_VERSION |
@@ -277,6 +287,17 @@ class ApplicationSettings(BaseApplicationSettings, MixinLoggingSettings): |
277 | 287 | Field(json_schema_extra={"auto_default_from_env": True}), |
278 | 288 | ] |
279 | 289 |
|
| 290 | + WEBSERVER_REALTIME_COLLABORATION: Annotated[ |
| 291 | + RealTimeCollaborationSettings | None, |
| 292 | + Field( |
| 293 | + description="Enables real-time collaboration features", |
| 294 | + json_schema_extra={ |
| 295 | + "auto_default_from_env": True, |
| 296 | + _X_FEATURE_UNDER_DEVELOPMENT: True, |
| 297 | + }, |
| 298 | + ), |
| 299 | + ] |
| 300 | + |
280 | 301 | WEBSERVER_REDIS: Annotated[ |
281 | 302 | RedisSettings | None, Field(json_schema_extra={"auto_default_from_env": True}) |
282 | 303 | ] |
|
0 commit comments