diff --git a/CHANGES/1550.bugfix b/CHANGES/1550.bugfix new file mode 100644 index 000000000..f3554617a --- /dev/null +++ b/CHANGES/1550.bugfix @@ -0,0 +1 @@ +Pulp Container specific settings are now properly validated at startup of a Pulp instance. diff --git a/pulp_container/app/__init__.py b/pulp_container/app/__init__.py index 669f62a21..7b6ea5948 100644 --- a/pulp_container/app/__init__.py +++ b/pulp_container/app/__init__.py @@ -1,4 +1,6 @@ from pulpcore.plugin import PulpPluginAppConfig +from django.conf import settings +from django.core.exceptions import ImproperlyConfigured class PulpContainerPluginAppConfig(PulpPluginAppConfig): @@ -11,3 +13,17 @@ class PulpContainerPluginAppConfig(PulpPluginAppConfig): def ready(self): super().ready() + + # Checks only needed if token auth is enabled + if str(getattr(settings, 'TOKEN_AUTH_DISABLED', False)).lower() == 'true': + return + + missing_settings = [] + if getattr(settings, 'TOKEN_SERVER', None) is None: + raise ImproperlyConfigured("TODO TOKEN SERVER") + if getattr(settings, 'TOKEN_SIGNATURE_ALGORITHM', None) is None: + raise ImproperlyConfigured("TODO SIGNATURE ALGORITHM") + if getattr(settings, 'PUBLIC_KEY_PATH', None) is None: + raise ImproperlyConfigured("TODO PUBLIC KEY PATH") + if getattr(settings, 'PRIVATE_KEY_PATH', None) is None: + raise ImproperlyConfigured("TODO PRIVATE KEY PATH")