This commit is contained in:
Oran Nadler 2018-04-10 18:55:53 +03:00
parent 61741eb94d
commit 502997a8e4
1 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,6 @@
import json import json
import traceback import traceback
import logging
import copy import copy
from datetime import datetime from datetime import datetime
@ -16,6 +17,8 @@ from cc.encryptor import encryptor
__author__ = 'Barak' __author__ = 'Barak'
LOG = logging.getLogger(__name__)
class Telemetry(flask_restful.Resource): class Telemetry(flask_restful.Resource):
@jwt_required() @jwt_required()
@ -167,11 +170,16 @@ class Telemetry(flask_restful.Resource):
@staticmethod @staticmethod
def process_system_info_telemetry(telemetry_json): def process_system_info_telemetry(telemetry_json):
LOG.debug("Processing system info telemtery for encryption...")
if 'credentials' in telemetry_json['data']: if 'credentials' in telemetry_json['data']:
LOG.debug("Encrypting telemetry credentials...")
creds = telemetry_json['data']['credentials'] creds = telemetry_json['data']['credentials']
Telemetry.encrypt_system_info_creds(creds) Telemetry.encrypt_system_info_creds(creds)
Telemetry.add_system_info_creds_to_config(creds) Telemetry.add_system_info_creds_to_config(creds)
Telemetry.replace_user_dot_with_comma(creds) Telemetry.replace_user_dot_with_comma(creds)
LOG.debug("Done enrypting")
@staticmethod @staticmethod
def process_trace_telemetry(telemetry_json): def process_trace_telemetry(telemetry_json):