Skip to content

Commit

Permalink
chore: Prevent api_key sharing (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruslanlazin committed Feb 8, 2019
1 parent 8ce8cbc commit 43f8f25
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions liveagent_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 43f8f25

Please sign in to comment.