diff --git a/core/runtime/firewall.py b/core/runtime/firewall.py index e69de29..0648ba4 100644 --- a/core/runtime/firewall.py +++ b/core/runtime/firewall.py @@ -0,0 +1,28 @@ +from core.runtime.applyconditions import applyConditions + +def buildFirewall(listener, outputs): + status_code = 200 + outputs["firewall_allowed"] = [] + for item in outputs[listener.recursive["source"]]: + + match, filter = applyConditions(listener, item, outputs) + + if match: + status_code = filter.get("status_code", 200) + continue + + #This needs to be moved into definitions but until logic is put in place it lives here. + if "com.loxthelion.rmass_message_id" in item.get("content", {}): + status_code = 200 + print("Excluding previously imported items") + print(f"Returning status_code: {status_code}") + + continue + + outputs["firewall_allowed"].append(item) + + if outputs["firewall_allowed"]: + return True, outputs, status_code + + #Needs to be present to prevent TypeError + return False, outputs, status_code \ No newline at end of file diff --git a/plugins/rmass/operations/rmassmessagepush.py b/plugins/rmass/operations/rmassmessagepush.py index d144683..3c19b58 100644 --- a/plugins/rmass/operations/rmassmessagepush.py +++ b/plugins/rmass/operations/rmassmessagepush.py @@ -6,7 +6,7 @@ name = "RMASS Message Push" kind = "recursiveset" recursiveset = { - "source": "events", + "source": "firewall_allowed", #"retain": False, "outputlabel": "outmessageitem", "actions": [