Added logging and stopped output return with buildFirewall
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import json
|
||||
import logging
|
||||
|
||||
from core.runtime.outputs import buildOutput
|
||||
from core.runtime.applyconditions import applyConditions
|
||||
from core.execution.operation import buildOperation
|
||||
from core.execution.executioncontract import executeContract
|
||||
from core.runtime.firewall import buildFirewall
|
||||
from core.execution.createthread import buildThread
|
||||
|
||||
|
||||
def buildListener(listener, self):
|
||||
|
||||
@@ -18,7 +18,7 @@ def buildListener(listener, self):
|
||||
if self.path.startswith(listener.acceptpath):
|
||||
|
||||
#Prints can used buildlog for listener runtime
|
||||
print("Matrix transaction received")
|
||||
logging.info("Matrix transaction received")
|
||||
|
||||
content_length = int(self.headers["Content-Length"])
|
||||
|
||||
@@ -27,27 +27,15 @@ def buildListener(listener, self):
|
||||
|
||||
outputs = {}
|
||||
|
||||
outputs = buildOutput(data, listener, outputs)
|
||||
|
||||
#for item in outputs[listener.recursive["source"]]:
|
||||
|
||||
#match, filter = applyConditions(listener, item, outputs)
|
||||
|
||||
#if not match:
|
||||
# if "com.loxthelion.rmass_message_id" in item.get("content", {}):
|
||||
# print("Excluding previously imported items")
|
||||
# #print(item)
|
||||
# continue
|
||||
|
||||
allow, item, status_code = buildFirewall(listener, outputs)
|
||||
buildOutput(data, listener, outputs)
|
||||
|
||||
allow, status_code = buildFirewall(listener, outputs)
|
||||
|
||||
if allow:
|
||||
#Print allowed items for logging purposes
|
||||
print(outputs["firewall_allowed"])
|
||||
logging.info(outputs["firewall_allowed"])
|
||||
|
||||
#Process and forward to RMASS
|
||||
#thread, lifecycles = buildThread(listener.execute, lifecycles)
|
||||
outputs, responses = executeContract(listener.execute, outputs, None)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user