Agent: Remove disused Configuration class

This commit is contained in:
Mike Salvatore 2022-06-17 13:11:30 -04:00
parent f25a81635c
commit e730695407
1 changed files with 0 additions and 55 deletions

View File

@ -1,5 +1,4 @@
import uuid
from abc import ABCMeta
GUID = str(uuid.getnode())
@ -10,57 +9,3 @@ SENSITIVE_FIELDS = [
]
LOCAL_CONFIG_VARS = ["name", "id", "max_depth"]
HIDDEN_FIELD_REPLACEMENT_CONTENT = "hidden"
class Configuration(object):
def from_kv(self, formatted_data):
for key, value in list(formatted_data.items()):
if key.startswith("_"):
continue
if key in LOCAL_CONFIG_VARS:
continue
if hasattr(self, key):
setattr(self, key, value)
if not self.max_depth:
self.max_depth = self.depth
@staticmethod
def hide_sensitive_info(config_dict):
for field in SENSITIVE_FIELDS:
config_dict[field] = HIDDEN_FIELD_REPLACEMENT_CONTENT
return config_dict
def as_dict(self):
result = {}
for key in dir(Configuration):
if key.startswith("_"):
continue
try:
value = getattr(self, key)
except AttributeError:
continue
val_type = type(value)
if callable(value):
continue
if val_type in (type, ABCMeta):
value = value.__name__
elif val_type is tuple or val_type is list:
if len(value) != 0 and type(value[0]) in (type, ABCMeta):
value = val_type([x.__name__ for x in value])
result[key] = value
return result
###########################
# monkey config
###########################
# depth of propagation
depth = 2
max_depth = None
keep_tunnel_open_time = 30