2018-11-16 08:10:35 +00:00
|
|
|
"""passbook mod saml_idp app config"""
|
2018-11-16 09:08:15 +00:00
|
|
|
from importlib import import_module
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2018-11-16 09:08:15 +00:00
|
|
|
from django.apps import AppConfig
|
2019-10-07 14:33:48 +00:00
|
|
|
from django.conf import settings
|
2019-10-01 08:24:10 +00:00
|
|
|
from structlog import get_logger
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2019-10-04 08:08:53 +00:00
|
|
|
LOGGER = get_logger()
|
2018-11-16 08:10:35 +00:00
|
|
|
|
2019-12-31 11:51:16 +00:00
|
|
|
|
2020-05-16 14:02:42 +00:00
|
|
|
class PassbookProviderSAMLConfig(AppConfig):
|
2018-11-16 08:10:35 +00:00
|
|
|
"""passbook saml_idp app config"""
|
|
|
|
|
2020-05-16 14:02:42 +00:00
|
|
|
name = "passbook.providers.saml"
|
|
|
|
label = "passbook_providers_saml"
|
|
|
|
verbose_name = "passbook Providers.SAML"
|
2019-12-31 11:51:16 +00:00
|
|
|
mountpoint = "application/saml/"
|
2018-11-16 09:08:15 +00:00
|
|
|
|
|
|
|
def ready(self):
|
|
|
|
"""Load source_types from config file"""
|
2019-10-07 14:33:48 +00:00
|
|
|
for source_type in settings.PASSBOOK_PROVIDERS_SAML_PROCESSORS:
|
2018-11-16 09:08:15 +00:00
|
|
|
try:
|
|
|
|
import_module(source_type)
|
2019-10-04 08:21:33 +00:00
|
|
|
LOGGER.info("Loaded SAML Processor", processor_class=source_type)
|
2018-11-16 09:08:15 +00:00
|
|
|
except ImportError as exc:
|
|
|
|
LOGGER.debug(exc)
|