Skip to content

Commit

Permalink
Merge pull request #860 from thunderstore-io/cyberstorm-flag
Browse files Browse the repository at this point in the history
Add feature flag for the new CS API
  • Loading branch information
MythicManiac authored Jul 19, 2023
2 parents bb0e7d7 + 524adb0 commit e944b8a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions django/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ env =
AUTH_EXCLUSIVE_HOST=auth.testsite.test
SESSION_COOKIE_DOMAIN=testsite.test
AWS_S3_CUSTOM_DOMAIN=minio:9000/thunderstore
IS_CYBERSTORM_ENABLED=True
13 changes: 9 additions & 4 deletions django/thunderstore/core/api_urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.urls import include, path

from thunderstore.api.urls import cyberstorm_urls
Expand Down Expand Up @@ -57,8 +58,12 @@
"experimental/",
include((api_experimental_urls, "experimental"), namespace="experimental"),
),
path(
"cyberstorm/",
include((cyberstorm_urls, "cyberstorm"), namespace="cyberstorm"),
),
]

if settings.IS_CYBERSTORM_ENABLED:
api_urls.append(
path(
"cyberstorm/",
include((cyberstorm_urls, "cyberstorm"), namespace="cyberstorm"),
)
)
5 changes: 5 additions & 0 deletions django/thunderstore/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
str,
"https://gcdn.thunderstore.io/static/dev/schema/ecosystem-schema.0.0.2.json",
),
IS_CYBERSTORM_ENABLED=(bool, False),
)

ALWAYS_RAISE_EXCEPTIONS = env.bool("ALWAYS_RAISE_EXCEPTIONS")
Expand Down Expand Up @@ -768,4 +769,8 @@ def show_debug_toolbar(request: HttpRequest) -> bool:
# Mod manager client id
OVERWOLF_CLIENT_ID = env.str("OVERWOLF_CLIENT_ID")

# Cyberstorm APIs enabled?
IS_CYBERSTORM_ENABLED = env.bool("IS_CYBERSTORM_ENABLED")


globals().update(plugin_registry.get_django_settings(globals()))

0 comments on commit e944b8a

Please sign in to comment.