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

add the .verify property correctly #1202

Merged
merged 4 commits into from Oct 30, 2021
Merged

Conversation

adehad
Copy link
Collaborator

@adehad adehad commented Oct 29, 2021

Addressed the concerns raised by #339

http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification

pip install git+https://github.com/pycontribs/jira.git@bugfix/correctly_add_ssl_cert

@adehad adehad requested a review from studioj October 29, 2021 19:48
@adehad adehad added the bug label Oct 29, 2021
@adehad adehad linked an issue Oct 29, 2021 that may be closed by this pull request
jira/client.py Outdated
@@ -3403,6 +3395,13 @@ def _add_client_cert_to_session(self):
client_cert: Tuple[str, str] = self._options["client_cert"] # to help mypy
self._session.cert = client_cert

def _add_ssl_cert_to_session(self):
"""
Adds the client certificate to the request if configured through the constructor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this adding the client certificate, or the certificate authority?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this was a copy paste job I failed to update. I've now updated both the name of the function and improved the docstring for clarity.

Copy link
Collaborator

@studioj studioj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe look for adding a test for this... this has the potential to break a lot :-) and probably will sneak through CI without a proper test :-S. I wouldn't know how to test it though :-D

jira/client.py Show resolved Hide resolved
@adehad
Copy link
Collaborator Author

adehad commented Oct 30, 2021

I would maybe look for adding a test for this... this has the potential to break a lot :-) and probably will sneak through CI without a proper test :-S. I wouldn't know how to test it though :-D

Yeah I have no idea how to test this, really the ResilientSession class should accept these arguments as parameters and set it during the __init__.

@studioj
Copy link
Collaborator

studioj commented Oct 30, 2021

I would maybe look for adding a test for this... this has the potential to break a lot :-) and probably will sneak through CI without a proper test :-S. I wouldn't know how to test it though :-D

Yeah I have no idea how to test this, really the ResilientSession class should accept these arguments as parameters and set it during the __init__.

:-) see it as a challenge :D you have my approval...

@adehad
Copy link
Collaborator Author

adehad commented Oct 30, 2021

:-) see it as a challenge :D

😆

@adehad adehad merged commit df0d0e9 into main Oct 30, 2021
@adehad adehad deleted the bugfix/correctly_add_ssl_cert branch October 30, 2021 19:05
@adehad adehad linked an issue Oct 30, 2021 that may be closed by this pull request
2 tasks
svermeulen pushed a commit to svermeulen/jira that referenced this pull request Oct 31, 2021
* add the `.verify` property correctly

* remove duplicated line updating the cookies of the session

* update docstrings and function name for clarity

* update client `__init__` docstring, as that is actually public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants