Sometimes we want to re-use code that injects plugins we don't want to use. To facilitate this, I added a way to filter plugins based on simple fnmatch rules. You can disable plugins by namespaces, names, or even values.
Here are some examples of how it can be used:
from plux.runtime.filter import global_plugin_filter
# disables all plugins in the `localstack.aws.provider` namespace
global_plugin_filter.add_pattern(namespace = "localstack.aws.provider")
# disables all plugins in namespaces that start with `localstack.aws.`
global_plugin_filter.add_pattern(namespace = "localstack.aws.*")
# disables all plugins that come from the `localstack.services` package, regardless in which namespace
global_plugin_filter.add_pattern(value = "localstack.services.*")
# disables all plugins that come from the `localstack.services` package, but only if they are in the `localstack.aws.provider` namespace
global_plugin_filter.add_pattern(namespace = "localstack.aws.provider", value = "localstack.services.*")
# disables any plugin named "iam-enforcement"
global_plugin_filter.add_pattern(name = "iam-enforcement")
Changes
a global filter is added by default to every PluginManager, that does nothing unless configured otherwise
Motivation
Sometimes we want to re-use code that injects plugins we don't want to use. To facilitate this, I added a way to filter plugins based on simple fnmatch rules. You can disable plugins by namespaces, names, or even values.
Here are some examples of how it can be used:
Changes
PluginManager
, that does nothing unless configured otherwise