nassauwinter / zephyr-python-api

Python wrappers for Zephyr Scale API
Apache License 2.0
1 stars 4 forks source link

Allow custom CAs to be given to the 'request' library when connecting to the Zephyr Scale server #2

Closed crapitea closed 1 year ago

crapitea commented 1 year ago

An example is the verify flag of the Jira python library located in: https://github.com/pycontribs/jira

                * verify (Union[bool, str]) -- Verify SSL certs. Defaults to ``True``.
                  Or path to to a CA_BUNDLE file or directory with certificates of trusted CAs,
                  for the `requests` library to use.
nassauwinter commented 1 year ago

Hi @crapitea!

Adding only verify cert option is a bit specific and it's better to implement a functional that will allow to modify requests session object with a wider amount of attributes. I'm going to modify signature of the ZephyrSession constructor. You will be able to pass any session attributes in a dict:

session_params = {'verify': True}

your_zephyr = ZephyrScale.server_api(..., session_attrs=session_params)

The code is in the session_attrs branch. Feel free to share your ideas about that.

crapitea commented 1 year ago

This is great! I played with it for a bit and works amazingly well! It's really nice that you can modify the session based on your needs.

nassauwinter commented 1 year ago

@crapitea The functional was added and you can now update your package from pypi.org.