Hide the token in the worker logs.

Token will no longer be stored as plain text. Will be replaced
with the string '*****' instead.

Change-Id: I14216fd77aef5adcad880c0bb484e69f7c277fbb
This commit is contained in:
David Shrewsbury
2013-04-29 17:00:06 -04:00
parent 12f2e4bb37
commit d1083080d5

View File

@@ -38,12 +38,22 @@ def handler(worker, job):
logger = worker.logger
driver = worker.driver
logger.debug("Received JSON message: %s" % json.dumps(job.data, indent=4))
# Hide information that should not be logged
copy = job.data.copy()
if LBaaSController.OBJ_STORE_TOKEN_FIELD in copy:
copy[LBaaSController.OBJ_STORE_TOKEN_FIELD] = "*****"
logger.debug("Received JSON message: %s" % json.dumps(copy, indent=4))
controller = LBaaSController(logger, driver, job.data)
response = controller.run()
logger.debug("Return JSON message: %s" % json.dumps(response, indent=4))
# Hide information that should not be logged
copy = response.copy()
if LBaaSController.OBJ_STORE_TOKEN_FIELD in copy:
copy[LBaaSController.OBJ_STORE_TOKEN_FIELD] = "*****"
logger.debug("Return JSON message: %s" % json.dumps(copy, indent=4))
return response