Skip to content

Commit e88ec15

Browse files
authored
Merge pull request #82 from nebulabroadcast/80-flag-for-experimental-feature-set
Option to enable experimental features
2 parents 245bbcc + 5cc27d7 commit e88ec15

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

backend/api/init/init_request.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class InitResponseModel(ResponseModel):
7070
),
7171
] = None
7272

73+
experimental: Annotated[bool | None, Field(title="Enable experimental features")] = None
74+
7375

7476
class InitRequest(APIRequest):
7577
"""Initial client request to ensure user is logged in.
@@ -102,7 +104,10 @@ async def handle(
102104
# Not logged in. Only return motd and oauth2 options.
103105
# TODO: return oauth2 options
104106
if user is None:
105-
return InitResponseModel(motd=motd)
107+
return InitResponseModel(
108+
motd=motd,
109+
experimental=nebula.config.enable_experimental or None,
110+
)
106111

107112
# TODO: get preferred user language
108113
lang: LanguageCode = user.language
@@ -119,4 +124,5 @@ async def handle(
119124
settings=client_settings,
120125
frontend_plugins=plugins,
121126
scoped_endpoints=server_context.scoped_endpoints,
127+
experimental=nebula.config.enable_experimental or None,
122128
)

backend/nebula/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ class NebulaConfig(BaseModel):
5959
description="Logging level",
6060
)
6161

62+
enable_experimental: bool = Field(
63+
False,
64+
description="Enable experimental features",
65+
)
66+
6267

6368
def load_config() -> NebulaConfig:
6469
prefix = "NEBULA_"

0 commit comments

Comments
 (0)