Skip to content

Commit

Permalink
[CPNHUB-248] fix(mgmt_api): AUTH_PROVIDERS not set in settings (#129)
Browse files Browse the repository at this point in the history
* [CPNHUB-248] fix(mgmt_api): AUTH_PROVIDERS not set in settings

* fix lint
  • Loading branch information
MarkLark86 authored Sep 1, 2023
1 parent 5dd08b3 commit c0373c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
14 changes: 14 additions & 0 deletions server/cp/common_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from flask_babel import lazy_gettext

from newsroom.web.default_settings import AUTH_PROVIDERS
from newsroom.types import AuthProviderType

AUTH_PROVIDERS.extend([{
"_id": "gip",
"name": lazy_gettext("Google"),
"auth_type": AuthProviderType.GOOGLE_OAUTH.value,
}, {
"_id": "azure",
"name": lazy_gettext("Azure"),
"auth_type": AuthProviderType.SAML.value,
}])
13 changes: 1 addition & 12 deletions server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
BLUEPRINTS as DEFAULT_BLUEPRINTS,
CELERY_BEAT_SCHEDULE as DEFAULT_CELERY_BEAT_SCHEDULE,
CLIENT_URL,
AUTH_PROVIDERS,
)
from newsroom.types import AuthProviderType
from cp.common_settings import AUTH_PROVIDERS # noqa


SERVER_PATH = pathlib.Path(__file__).resolve().parent
Expand Down Expand Up @@ -278,13 +277,3 @@

AGENDA_SECTION = lazy_gettext("Calendar")
SAVED_SECTION = lazy_gettext("Bookmarks")

AUTH_PROVIDERS.extend([{
"_id": "gip",
"name": lazy_gettext("Google"),
"auth_type": AuthProviderType.GOOGLE_OAUTH.value,
}, {
"_id": "azure",
"name": lazy_gettext("Azure"),
"auth_type": AuthProviderType.SAML.value,
}])
1 change: 1 addition & 0 deletions server/settings_mgmtapi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pathlib import Path

from superdesk.default_settings import env, strtobool # noqa
from cp.common_settings import AUTH_PROVIDERS # noqa


ABS_PATH = Path(__file__).resolve().parent
Expand Down

0 comments on commit c0373c2

Please sign in to comment.