From 268445e0f02b81603031a5b4ca3b71846316dc18 Mon Sep 17 00:00:00 2001 From: Iain Learmonth Date: Thu, 1 Sep 2022 16:26:19 +0100 Subject: [PATCH] block/bridge: correct handling of hashed fingerprints --- app/terraform/block/bridge.py | 2 +- app/terraform/block/bridge_gitlab.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/terraform/block/bridge.py b/app/terraform/block/bridge.py index aecfa5a..baa845b 100644 --- a/app/terraform/block/bridge.py +++ b/app/terraform/block/bridge.py @@ -52,7 +52,7 @@ class BlockBridgeAutomation(BaseAutomation): logging.debug("Blocked by IP") rotated.extend(self.perform_deprecations(self.fingerprints, get_bridge_by_fingerprint)) logging.debug("Blocked by fingerprint") - rotated.extend(self.perform_deprecations(self.fingerprints, get_bridge_by_hashed_fingerprint)) + rotated.extend(self.perform_deprecations(self.hashed_fingerprints, get_bridge_by_hashed_fingerprint)) logging.debug("Blocked by hashed fingerprint") if rotated: activity = Activity( diff --git a/app/terraform/block/bridge_gitlab.py b/app/terraform/block/bridge_gitlab.py index b184b4c..aca08db 100644 --- a/app/terraform/block/bridge_gitlab.py +++ b/app/terraform/block/bridge_gitlab.py @@ -14,6 +14,7 @@ class BlockBridgeGitlabAutomation(BlockBridgeReachabilityAutomation): frequency = 30 def fetch(self) -> None: + self._lines = list() credentials = {"private_token": current_app.config['GITLAB_TOKEN']} if "GITLAB_URL" in current_app.config: credentials['url'] = current_app.config['GITLAB_URL'] @@ -25,4 +26,4 @@ class BlockBridgeGitlabAutomation(BlockBridgeReachabilityAutomation): ref=current_app.config["GITLAB_BRIDGE_BRANCH"] ) # Decode the base64 first, then decode the UTF-8 string - self._lines = contents.decode().decode('utf-8').splitlines() + self._lines.extend(contents.decode().decode('utf-8').splitlines())