From b1efc0fd20ad42a8d60c6ff2f61331f758695f8d Mon Sep 17 00:00:00 2001 From: Felipe Biaggi Carvalho Date: Tue, 28 Dec 2021 14:26:34 -0300 Subject: [PATCH] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20protocolo=20de=20config?= =?UTF-8?q?ura=C3=A7=C3=A3o=20para=20SL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpqdtrd/api.py | 5 ++++- cpqdtrd/client.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cpqdtrd/api.py b/cpqdtrd/api.py index dbb618a..5b19be5 100644 --- a/cpqdtrd/api.py +++ b/cpqdtrd/api.py @@ -31,6 +31,7 @@ def __init__( retry_period: float = 2, sl_host=None, sl_port=None, + sl_protocol="https", sl_token=None, sl_username=None, sl_password=None, @@ -42,6 +43,7 @@ def __init__( self._url = url self._sl_host = sl_host self._sl_port = sl_port + self._sl_protocol = sl_protocol self._sl_username = sl_username self._sl_password = sl_password @@ -249,9 +251,10 @@ def create_token(self): self._sl_port, self._sl_username, self._sl_password, + self._sl_protocol ): request = requests.post( - url="http://{}:{}/auth/token".format(self._sl_host, self._sl_port), + url="{}://{}:{}/auth/token".format(self._sl_protocol, self._sl_host, self._sl_port), auth=(self._sl_username, self._sl_password), timeout=10, ) diff --git a/cpqdtrd/client.py b/cpqdtrd/client.py index 5aae33c..62734c5 100644 --- a/cpqdtrd/client.py +++ b/cpqdtrd/client.py @@ -36,6 +36,7 @@ def __init__( key_path=None, sl_host=None, sl_port=None, + sl_protocol="https", sl_token=None, sl_username=None, sl_password=None, @@ -52,6 +53,7 @@ def __init__( password=password, sl_host=sl_host, sl_port=sl_port, + sl_protocol=sl_protocol, sl_token=sl_token, sl_username=sl_username, sl_password=sl_password,