From 1ee968607caa041614d3ac682401f97ebb7d040b Mon Sep 17 00:00:00 2001 From: Ruslan Lazin Date: Fri, 8 Feb 2019 08:37:16 +0200 Subject: [PATCH 1/2] chore: Prevent api_key sharing (#0005) --- liveagent_api/configuration.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/liveagent_api/configuration.py b/liveagent_api/configuration.py index 5c55d6b..a152288 100644 --- a/liveagent_api/configuration.py +++ b/liveagent_api/configuration.py @@ -23,29 +23,22 @@ from six.moves import http_client as httplib -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls): - if cls._default is None: - cls._default = type.__call__(cls) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) - - -class Configuration(six.with_metaclass(TypeWithDefault, object)): +class Configuration(object): """NOTE: This class is auto generated by the swagger code generator program. Ref: https://github.com/swagger-api/swagger-codegen Do not edit the class manually. """ + _default = None + def __init__(self): """Constructor""" + if self._default: + for key in self._default.__dict__.keys(): + self.__dict__[key] = copy.copy(self._default.__dict__[key]) + return + # Default Base url self.host = "http://localhost/api/v3" # Temp file folder for downloading files @@ -104,6 +97,10 @@ def __init__(self): # Safe chars for path_param self.safe_chars_for_path_param = '' + @classmethod + def set_default(cls, default): + cls._default = default + @property def logger_file(self): """The logger file. From fd442dc60ad48fbe2b2de487a63672548a7f2b3b Mon Sep 17 00:00:00 2001 From: Ruslan Lazin Date: Fri, 8 Feb 2019 08:55:51 +0200 Subject: [PATCH 2/2] chore: Exclude configuration.py from regeneration (#0005) --- .swagger-codegen-ignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore index 58f8316..1605efa 100644 --- a/.swagger-codegen-ignore +++ b/.swagger-codegen-ignore @@ -22,6 +22,7 @@ # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -liveagent_api/rest.py liveagent_api/api_client.py +liveagent_api/configuration.py +liveagent_api/rest.py .gitignore \ No newline at end of file