forked from loafle/openapi-generator-original
[Python][Client] Default to system CA instead of certifi (#8108)
* Use system CA by default and remove certifi See https://github.com/OpenAPITools/openapi-generator/issues/6506 * Use system CA by default in asyncio client * Update README_onlypackage.mustache * Result of ./bin/generate-samples.sh * Add ssl_ca_cert argument for Configuration * Result of ./bin/generate-samples.sh * Remove certifi, use system CA by default
This commit is contained in:
@@ -25,9 +25,8 @@ This python library package is generated without supporting files like setup.py
|
|||||||
|
|
||||||
To be able to use it, you will need these dependencies in your own package that uses this library:
|
To be able to use it, you will need these dependencies in your own package that uses this library:
|
||||||
|
|
||||||
* urllib3 >= 1.15
|
* urllib3 >= 1.25.3
|
||||||
* six >= 1.10
|
* six >= 1.10
|
||||||
* certifi
|
|
||||||
* python-dateutil
|
* python-dateutil
|
||||||
{{#asyncio}}
|
{{#asyncio}}
|
||||||
* aiohttp
|
* aiohttp
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import certifi
|
|
||||||
# python 2 and python 3 compatibility library
|
# python 2 and python 3 compatibility library
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
|
|
||||||
@@ -43,14 +42,7 @@ class RESTClientObject(object):
|
|||||||
if maxsize is None:
|
if maxsize is None:
|
||||||
maxsize = configuration.connection_pool_maxsize
|
maxsize = configuration.connection_pool_maxsize
|
||||||
|
|
||||||
# ca_certs
|
ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
ssl_context = ssl.create_default_context(cafile=ca_certs)
|
|
||||||
if configuration.cert_file:
|
if configuration.cert_file:
|
||||||
ssl_context.load_cert_chain(
|
ssl_context.load_cert_chain(
|
||||||
configuration.cert_file, keyfile=configuration.key_file
|
configuration.cert_file, keyfile=configuration.key_file
|
||||||
|
|||||||
@@ -76,6 +76,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
{{#hasAuthMethods}}
|
{{#hasAuthMethods}}
|
||||||
:Example:
|
:Example:
|
||||||
@@ -174,6 +176,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
{{/hasHttpSignatureMethods}}
|
{{/hasHttpSignatureMethods}}
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -258,7 +261,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
certifi >= 14.05.14
|
|
||||||
future; python_version<="2.7"
|
future; python_version<="2.7"
|
||||||
six >= 1.10
|
six >= 1.10
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import certifi
|
|
||||||
# python 2 and python 3 compatibility library
|
# python 2 and python 3 compatibility library
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
@@ -54,13 +53,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -83,7 +75,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -95,7 +87,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ VERSION = "{{packageVersion}}"
|
|||||||
# prerequisite: setuptools
|
# prerequisite: setuptools
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"]
|
||||||
{{#asyncio}}
|
{{#asyncio}}
|
||||||
REQUIRES.append("aiohttp >= 3.0.0")
|
REQUIRES.append("aiohttp >= 3.0.0")
|
||||||
{{/asyncio}}
|
{{/asyncio}}
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ This python library package is generated without supporting files like setup.py
|
|||||||
|
|
||||||
To be able to use it, you will need these dependencies in your own package that uses this library:
|
To be able to use it, you will need these dependencies in your own package that uses this library:
|
||||||
|
|
||||||
* urllib3 >= 1.15
|
* urllib3 >= 1.25.3
|
||||||
* certifi
|
|
||||||
* python-dateutil
|
* python-dateutil
|
||||||
{{#asyncio}}
|
{{#asyncio}}
|
||||||
* aiohttp
|
* aiohttp
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import certifi
|
|
||||||
# python 2 and python 3 compatibility library
|
# python 2 and python 3 compatibility library
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
|
|
||||||
@@ -41,14 +40,7 @@ class RESTClientObject(object):
|
|||||||
if maxsize is None:
|
if maxsize is None:
|
||||||
maxsize = configuration.connection_pool_maxsize
|
maxsize = configuration.connection_pool_maxsize
|
||||||
|
|
||||||
# ca_certs
|
ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
ssl_context = ssl.create_default_context(cafile=ca_certs)
|
|
||||||
if configuration.cert_file:
|
if configuration.cert_file:
|
||||||
ssl_context.load_cert_chain(
|
ssl_context.load_cert_chain(
|
||||||
configuration.cert_file, keyfile=configuration.key_file
|
configuration.cert_file, keyfile=configuration.key_file
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
{{#hasAuthMethods}}
|
{{#hasAuthMethods}}
|
||||||
:Example:
|
:Example:
|
||||||
@@ -169,6 +171,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
{{/hasHttpSignatureMethods}}
|
{{/hasHttpSignatureMethods}}
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -253,7 +256,7 @@ conf = {{{packageName}}}.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
nulltype
|
nulltype
|
||||||
certifi >= 14.05.14
|
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import certifi
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
from {{packageName}}.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||||
@@ -48,13 +47,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -77,7 +69,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -89,7 +81,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ VERSION = "{{packageVersion}}"
|
|||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = [
|
REQUIRES = [
|
||||||
"urllib3 >= 1.15",
|
"urllib3 >= 1.25.3",
|
||||||
"certifi",
|
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
"nulltype",
|
"nulltype",
|
||||||
{{#asyncio}}
|
{{#asyncio}}
|
||||||
|
|||||||
@@ -77,6 +77,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -125,6 +127,7 @@ conf = petstore_api.Configuration(
|
|||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -193,7 +196,7 @@ conf = petstore_api.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import certifi
|
|
||||||
# python 2 and python 3 compatibility library
|
# python 2 and python 3 compatibility library
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
|
|
||||||
@@ -51,14 +50,7 @@ class RESTClientObject(object):
|
|||||||
if maxsize is None:
|
if maxsize is None:
|
||||||
maxsize = configuration.connection_pool_maxsize
|
maxsize = configuration.connection_pool_maxsize
|
||||||
|
|
||||||
# ca_certs
|
ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert)
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
ssl_context = ssl.create_default_context(cafile=ca_certs)
|
|
||||||
if configuration.cert_file:
|
if configuration.cert_file:
|
||||||
ssl_context.load_cert_chain(
|
ssl_context.load_cert_chain(
|
||||||
configuration.cert_file, keyfile=configuration.key_file
|
configuration.cert_file, keyfile=configuration.key_file
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
certifi >= 14.05.14
|
|
||||||
future; python_version<="2.7"
|
future; python_version<="2.7"
|
||||||
six >= 1.10
|
six >= 1.10
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ VERSION = "1.0.0"
|
|||||||
# prerequisite: setuptools
|
# prerequisite: setuptools
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"]
|
||||||
REQUIRES.append("aiohttp >= 3.0.0")
|
REQUIRES.append("aiohttp >= 3.0.0")
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -126,6 +128,7 @@ conf = petstore_api.Configuration(
|
|||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -194,7 +197,7 @@ conf = petstore_api.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import certifi
|
|
||||||
# python 2 and python 3 compatibility library
|
# python 2 and python 3 compatibility library
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
@@ -62,13 +61,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -91,7 +83,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -103,7 +95,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
certifi >= 14.05.14
|
|
||||||
future; python_version<="2.7"
|
future; python_version<="2.7"
|
||||||
six >= 1.10
|
six >= 1.10
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ VERSION = "1.0.0"
|
|||||||
# prerequisite: setuptools
|
# prerequisite: setuptools
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=NAME,
|
name=NAME,
|
||||||
|
|||||||
@@ -78,6 +78,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -126,6 +128,7 @@ conf = petstore_api.Configuration(
|
|||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -194,7 +197,7 @@ conf = petstore_api.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
certifi >= 14.05.14
|
|
||||||
future; python_version<="2.7"
|
future; python_version<="2.7"
|
||||||
six >= 1.10
|
six >= 1.10
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ VERSION = "1.0.0"
|
|||||||
# prerequisite: setuptools
|
# prerequisite: setuptools
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"]
|
||||||
REQUIRES.append("tornado>=4.2,<5")
|
REQUIRES.append("tornado>=4.2,<5")
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -121,6 +123,7 @@ conf = petstore_api.Configuration(
|
|||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -189,7 +192,7 @@ conf = petstore_api.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import certifi
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||||
@@ -56,13 +55,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -85,7 +77,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -97,7 +89,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
nulltype
|
nulltype
|
||||||
certifi >= 14.05.14
|
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ VERSION = "1.0.0"
|
|||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = [
|
REQUIRES = [
|
||||||
"urllib3 >= 1.15",
|
"urllib3 >= 1.25.3",
|
||||||
"certifi",
|
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
"nulltype",
|
"nulltype",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
nulltype
|
nulltype
|
||||||
certifi >= 14.05.14
|
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ VERSION = "1.0.0"
|
|||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = [
|
REQUIRES = [
|
||||||
"urllib3 >= 1.15",
|
"urllib3 >= 1.25.3",
|
||||||
"certifi",
|
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
"nulltype",
|
"nulltype",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -105,6 +107,7 @@ conf = x_auth_id_alias.Configuration(
|
|||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -170,7 +173,7 @@ conf = x_auth_id_alias.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import certifi
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
from x_auth_id_alias.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
from x_auth_id_alias.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||||
@@ -56,13 +55,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -85,7 +77,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -97,7 +89,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -73,6 +73,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@@ -85,6 +87,7 @@ class Configuration(object):
|
|||||||
disabled_client_side_validations="",
|
disabled_client_side_validations="",
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -150,7 +153,7 @@ class Configuration(object):
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import certifi
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
from dynamic_servers.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
from dynamic_servers.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||||
@@ -56,13 +55,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -85,7 +77,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -97,7 +89,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
nulltype
|
nulltype
|
||||||
certifi >= 14.05.14
|
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ VERSION = "1.0.0"
|
|||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = [
|
REQUIRES = [
|
||||||
"urllib3 >= 1.15",
|
"urllib3 >= 1.25.3",
|
||||||
"certifi",
|
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
"nulltype",
|
"nulltype",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -168,6 +170,7 @@ conf = petstore_api.Configuration(
|
|||||||
signing_info=None,
|
signing_info=None,
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -241,7 +244,7 @@ conf = petstore_api.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import logging
|
|||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
import certifi
|
|
||||||
# python 2 and python 3 compatibility library
|
# python 2 and python 3 compatibility library
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib.parse import urlencode
|
from six.moves.urllib.parse import urlencode
|
||||||
@@ -62,13 +61,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -91,7 +83,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -103,7 +95,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
certifi >= 14.05.14
|
|
||||||
future; python_version<="2.7"
|
future; python_version<="2.7"
|
||||||
six >= 1.10
|
six >= 1.10
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ VERSION = "1.0.0"
|
|||||||
# prerequisite: setuptools
|
# prerequisite: setuptools
|
||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
REQUIRES = ["urllib3 >= 1.25.3", "six >= 1.10", "python-dateutil"]
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=NAME,
|
name=NAME,
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ class Configuration(object):
|
|||||||
:param server_operation_variables: Mapping from operation ID to a mapping with
|
:param server_operation_variables: Mapping from operation ID to a mapping with
|
||||||
string values to replace variables in templated server configuration.
|
string values to replace variables in templated server configuration.
|
||||||
The validation of enums is performed for variables with defined enum values before.
|
The validation of enums is performed for variables with defined enum values before.
|
||||||
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
||||||
|
in PEM format
|
||||||
|
|
||||||
:Example:
|
:Example:
|
||||||
|
|
||||||
@@ -163,6 +165,7 @@ conf = petstore_api.Configuration(
|
|||||||
signing_info=None,
|
signing_info=None,
|
||||||
server_index=None, server_variables=None,
|
server_index=None, server_variables=None,
|
||||||
server_operation_index=None, server_operation_variables=None,
|
server_operation_index=None, server_operation_variables=None,
|
||||||
|
ssl_ca_cert=None,
|
||||||
):
|
):
|
||||||
"""Constructor
|
"""Constructor
|
||||||
"""
|
"""
|
||||||
@@ -236,7 +239,7 @@ conf = petstore_api.Configuration(
|
|||||||
Set this to false to skip verifying SSL certificate when calling API
|
Set this to false to skip verifying SSL certificate when calling API
|
||||||
from https server.
|
from https server.
|
||||||
"""
|
"""
|
||||||
self.ssl_ca_cert = None
|
self.ssl_ca_cert = ssl_ca_cert
|
||||||
"""Set this to customize the certificate file to verify the peer.
|
"""Set this to customize the certificate file to verify the peer.
|
||||||
"""
|
"""
|
||||||
self.cert_file = None
|
self.cert_file = None
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import re
|
|||||||
import ssl
|
import ssl
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
|
|
||||||
import certifi
|
|
||||||
import urllib3
|
import urllib3
|
||||||
|
|
||||||
from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
from petstore_api.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError
|
||||||
@@ -56,13 +55,6 @@ class RESTClientObject(object):
|
|||||||
else:
|
else:
|
||||||
cert_reqs = ssl.CERT_NONE
|
cert_reqs = ssl.CERT_NONE
|
||||||
|
|
||||||
# ca_certs
|
|
||||||
if configuration.ssl_ca_cert:
|
|
||||||
ca_certs = configuration.ssl_ca_cert
|
|
||||||
else:
|
|
||||||
# if not set certificate file, use Mozilla's root certificates.
|
|
||||||
ca_certs = certifi.where()
|
|
||||||
|
|
||||||
addition_pool_args = {}
|
addition_pool_args = {}
|
||||||
if configuration.assert_hostname is not None:
|
if configuration.assert_hostname is not None:
|
||||||
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501
|
||||||
@@ -85,7 +77,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
proxy_url=configuration.proxy,
|
proxy_url=configuration.proxy,
|
||||||
@@ -97,7 +89,7 @@ class RESTClientObject(object):
|
|||||||
num_pools=pools_size,
|
num_pools=pools_size,
|
||||||
maxsize=maxsize,
|
maxsize=maxsize,
|
||||||
cert_reqs=cert_reqs,
|
cert_reqs=cert_reqs,
|
||||||
ca_certs=ca_certs,
|
ca_certs=configuration.ssl_ca_cert,
|
||||||
cert_file=configuration.cert_file,
|
cert_file=configuration.cert_file,
|
||||||
key_file=configuration.key_file,
|
key_file=configuration.key_file,
|
||||||
**addition_pool_args
|
**addition_pool_args
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
nulltype
|
nulltype
|
||||||
certifi >= 14.05.14
|
|
||||||
python_dateutil >= 2.5.3
|
python_dateutil >= 2.5.3
|
||||||
setuptools >= 21.0.0
|
setuptools >= 21.0.0
|
||||||
urllib3 >= 1.15.1
|
urllib3 >= 1.25.3
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ VERSION = "1.0.0"
|
|||||||
# http://pypi.python.org/pypi/setuptools
|
# http://pypi.python.org/pypi/setuptools
|
||||||
|
|
||||||
REQUIRES = [
|
REQUIRES = [
|
||||||
"urllib3 >= 1.15",
|
"urllib3 >= 1.25.3",
|
||||||
"certifi",
|
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
"nulltype",
|
"nulltype",
|
||||||
"pem>=19.3.0",
|
"pem>=19.3.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user