Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#0005: Prevent api_key sharing #4

Merged
merged 2 commits into from
Feb 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .swagger-codegen-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
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