mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Added configuration_filters
This commit is contained in:
20
filter_plugins/configuration_filters.py
Normal file
20
filter_plugins/configuration_filters.py
Normal file
@@ -0,0 +1,20 @@
|
||||
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)
|
||||
return bool(enabled)
|
||||
|
||||
def get_css_enabled(applications, application_id):
|
||||
# Retrieve the application dictionary based on the given application_id.
|
||||
app = applications.get(application_id, {})
|
||||
# Retrieve the 'enabled' value from the css key, defaulting to True if not present.
|
||||
enabled = app.get('css', {}).get('enabled', True)
|
||||
return bool(enabled)
|
||||
|
||||
class FilterModule(object):
|
||||
def filters(self):
|
||||
return {
|
||||
'get_css_enabled': get_css_enabled,
|
||||
'get_oauth2_enabled': get_oauth2_enabled
|
||||
}
|
Reference in New Issue
Block a user