Refactored CyMaIS basic features and optimized wordpress implementation

This commit is contained in:
2025-04-18 23:17:29 +02:00
parent ec5beff22f
commit f8c984d6c2
56 changed files with 1262 additions and 325 deletions

View File

@@ -1,20 +1,20 @@
def get_oauth22_enabled(applications, application_id):
def get_oauth2_enabled(applications, application_id):
# Retrieve the application dictionary based on the ID
app = applications.get(application_id, {})
# Retrieve the value for oauth2_proxy.enabled, default is False
enabled = app.get('oauth2_proxy', {}).get('enabled', False)
enabled = app.get('features', {}).get('oauth2', False)
return bool(enabled)
def get_oidc_enabled(applications, application_id):
# Retrieve the application dictionary based on the ID
app = applications.get(application_id, {})
# Retrieve the value for oidc.enabled, default is False
enabled = app.get('oidc', {}).get('enabled', False)
enabled = app.get('features', {}).get('oidc', False)
return bool(enabled)
def get_landingpage_iframe_enabled(applications, application_id):
def get_features_iframe(applications, application_id):
app = applications.get(application_id)
enabled = app.get('landingpage_iframe_enabled')
enabled = app.features.iframe
return bool(enabled)
def get_database_central_storage(applications, application_id):
@@ -24,14 +24,14 @@ def get_database_central_storage(applications, application_id):
If not defined, None is returned.
"""
app = applications.get(application_id, {})
db_type = app.get('database', {}).get('central_storage', False)
db_type = app.get('features', {}).get('database', False)
return db_type
class FilterModule(object):
def filters(self):
return {
'get_oidc_enabled': get_oidc_enabled,
'get_oauth2_enabled': get_oauth22_enabled,
'get_oauth2_enabled': get_oauth2_enabled,
'get_database_central_storage': get_database_central_storage,
'get_landingpage_iframe_enabled': get_landingpage_iframe_enabled,
'get_features_iframe': get_features_iframe,
}