Don't load protections from config if strategy defines a property

This commit is contained in:
Matthias
2021-06-17 21:01:22 +02:00
parent 8562e19776
commit e1010ff592
6 changed files with 9 additions and 8 deletions

View File

@@ -15,11 +15,11 @@ logger = logging.getLogger(__name__)
class ProtectionManager():
def __init__(self, config: dict) -> None:
def __init__(self, config: Dict, protections: List) -> None:
self._config = config
self._protection_handlers: List[IProtection] = []
for protection_handler_config in self._config.get('protections', []):
for protection_handler_config in protections:
protection_handler = ProtectionResolver.load_protection(
protection_handler_config['method'],
config=config,