Added buildFirewall to listener
This commit is contained in:
@@ -3,6 +3,8 @@ from core.runtime.outputs import buildOutput
|
|||||||
from core.runtime.applyconditions import applyConditions
|
from core.runtime.applyconditions import applyConditions
|
||||||
from core.execution.operation import buildOperation
|
from core.execution.operation import buildOperation
|
||||||
from core.execution.executioncontract import executeContract
|
from core.execution.executioncontract import executeContract
|
||||||
|
from core.runtime.firewall import buildFirewall
|
||||||
|
from core.execution.createthread import buildThread
|
||||||
|
|
||||||
def buildListener(listener, self):
|
def buildListener(listener, self):
|
||||||
|
|
||||||
@@ -27,25 +29,30 @@ def buildListener(listener, self):
|
|||||||
|
|
||||||
outputs = buildOutput(data, listener, outputs)
|
outputs = buildOutput(data, listener, outputs)
|
||||||
|
|
||||||
for item in outputs[listener.recursive["source"]]:
|
#for item in outputs[listener.recursive["source"]]:
|
||||||
|
|
||||||
match, filter = applyConditions(listener, item, outputs)
|
#match, filter = applyConditions(listener, item, outputs)
|
||||||
|
|
||||||
if not match:
|
#if not match:
|
||||||
if "com.loxthelion.rmass_message_id" in item.get("content", {}):
|
# if "com.loxthelion.rmass_message_id" in item.get("content", {}):
|
||||||
print("Excluding previously imported items")
|
# print("Excluding previously imported items")
|
||||||
#print(item)
|
# #print(item)
|
||||||
continue
|
# continue
|
||||||
|
|
||||||
print(item)
|
|
||||||
#Process and forward to RMASS
|
|
||||||
|
|
||||||
outputs, responses = executeContract(listener.execute, outputs)
|
allow, item, status_code = buildFirewall(listener, outputs)
|
||||||
|
|
||||||
continue
|
|
||||||
|
|
||||||
|
|
||||||
self.send_response(200)
|
if allow:
|
||||||
|
#Print allowed items for logging purposes
|
||||||
|
print(outputs["firewall_allowed"])
|
||||||
|
|
||||||
|
#Process and forward to RMASS
|
||||||
|
#thread, lifecycles = buildThread(listener.execute, lifecycles)
|
||||||
|
outputs, responses = executeContract(listener.execute, outputs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
self.send_response(status_code)
|
||||||
self.send_header("Content-Type", "application/json")
|
self.send_header("Content-Type", "application/json")
|
||||||
self.send_header("Content-Length", "2")
|
self.send_header("Content-Length", "2")
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|||||||
Reference in New Issue
Block a user