Skip to content
Snippets Groups Projects
Commit f6caf699 authored by Robert Habermann's avatar Robert Habermann
Browse files

Merge branch 'tls-client-auth' into 'master'

add client_auth_cert to Client

See merge request rhab/PyOTRS!19
parents 8f243e34 25283acd
No related branches found
No related tags found
No related merge requests found
...@@ -14,12 +14,6 @@ py27: ...@@ -14,12 +14,6 @@ py27:
script: script:
- tox -e py27 - tox -e py27
py34:
stage: test
image: python:3.4
script:
- tox -e py34
py35: py35:
stage: test stage: test
image: python:3.5 image: python:3.5
...@@ -38,14 +32,20 @@ py37: ...@@ -38,14 +32,20 @@ py37:
script: script:
- tox -e py37 - tox -e py37
py38:
stage: test
image: python:3.8
script:
- tox -e py38
pep8: pep8:
image: python:3.5 image: python:3.6
stage: style stage: style
script: script:
- tox -e pep8 - tox -e pep8
wheel: wheel:
image: python:3.5 image: python:3.6
stage: package stage: package
script: script:
tox -e wheel tox -e wheel
...@@ -54,7 +54,7 @@ wheel: ...@@ -54,7 +54,7 @@ wheel:
- dist/ - dist/
sdist: sdist:
image: python:3.5 image: python:3.6
stage: package stage: package
script: script:
tox -e sdist tox -e sdist
......
...@@ -17,6 +17,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ...@@ -17,6 +17,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
-------------------------------- --------------------------------
- fix #18: Attachment.create_from_file did not decode "Content" - fix #18: Attachment.create_from_file did not decode "Content"
0.4.2 - 2020-03-12
------------------
- add: client_auth_cert to Client
- remove: Python3.4 checks (colorama no longer works on py34)
0.4.1 - 2019-03-09 - Beta 0.4.1 - 2019-03-09 - Beta
------------------------- -------------------------
- This has been in "alpha" way too long now marked as Beta - This has been in "alpha" way too long now marked as Beta
......
...@@ -866,6 +866,8 @@ class Client(object): ...@@ -866,6 +866,8 @@ class Client(object):
https_verify (bool): Should HTTPS certificates be verified (defaults to True) https_verify (bool): Should HTTPS certificates be verified (defaults to True)
ca_cert_bundle (str): file path - if specified overrides python/system default for ca_cert_bundle (str): file path - if specified overrides python/system default for
Root CA bundle that will be used. Root CA bundle that will be used.
client_auth_cert (str): file path containing both certificate and key (unencrypted) in
PEM format to use for TLS client authentication (passed to requests as "cert")
user_agent (str): optional HTTP UserAgent string user_agent (str): optional HTTP UserAgent string
webservice_path (str): OTRS REST Web Service Path part - defaults to webservice_path (str): OTRS REST Web Service Path part - defaults to
"/otrs/nph-genericinterface.pl/Webservice/" "/otrs/nph-genericinterface.pl/Webservice/"
...@@ -884,6 +886,7 @@ class Client(object): ...@@ -884,6 +886,7 @@ class Client(object):
proxies=None, proxies=None,
https_verify=True, https_verify=True,
ca_cert_bundle=None, ca_cert_bundle=None,
client_auth_cert=None,
user_agent=None, user_agent=None,
webservice_path="/otrs/nph-genericinterface.pl/Webservice/"): webservice_path="/otrs/nph-genericinterface.pl/Webservice/"):
...@@ -949,6 +952,8 @@ class Client(object): ...@@ -949,6 +952,8 @@ class Client(object):
else: else:
self.https_verify = False self.https_verify = False
self.client_auth_cert = client_auth_cert
self.user_agent = user_agent self.user_agent = user_agent
# credentials # credentials
...@@ -1884,6 +1889,7 @@ class Client(object): ...@@ -1884,6 +1889,7 @@ class Client(object):
headers=headers, headers=headers,
data=json_payload, data=json_payload,
proxies=self.proxies, proxies=self.proxies,
cert=self.client_auth_cert,
verify=self.https_verify) verify=self.https_verify)
# store a copy of the request # store a copy of the request
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
# 3) we can import it into your module module # 3) we can import it into your module module
""" """
__version_info__ = ('0', '4', '1') __version_info__ = ('0', '4', '2')
__version__ = '.'.join(__version_info__) __version__ = '.'.join(__version_info__)
...@@ -60,10 +60,10 @@ setup( ...@@ -60,10 +60,10 @@ setup(
'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Documentation :: Sphinx', 'Topic :: Documentation :: Sphinx',
], ],
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
envlist = envlist =
cov_clean, cov_clean,
py27, py27,
py34,
py35, py35,
py36, py36,
py37, py37,
py38,
cov_combine, cov_combine,
py3kwarn, py3kwarn,
pep8, pep8,
...@@ -70,7 +70,7 @@ commands = ...@@ -70,7 +70,7 @@ commands =
[testenv:pep8] [testenv:pep8]
basepython = basepython =
python3.5 python3.6
deps = deps =
flake8 flake8
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment