Skip to content

Commit

Permalink
#12 Use certifi bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcs committed Jun 17, 2015
1 parent 200b741 commit 1191915
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion connexion/decorators/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# Authentication and authorization related decorators

import certifi
import logging
import functools
import types
Expand All @@ -38,7 +39,7 @@ def wrapper(*args, **kwargs):
else:
_, token = authorization.split()
logger.debug("... Getting token '%s' from %s", token, token_info_url)
token_request = requests.get(token_info_url, params={'access_token': token})
token_request = requests.get(token_info_url, params={'access_token': token}, verify=certifi.where())
logger.debug("... Token info (%d): %s", token_request.status_code, token_request.text)
if not token_request.ok:
raise abort(401)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run_tests(self):
author='Zalando SE',
url='https://github.com/zalando/connexion',
license='Apache License Version 2.0',
install_requires=['flask', 'PyYAML', 'tornado', 'requests'],
install_requires=['flask', 'PyYAML', 'tornado', 'requests', 'certifi'],
tests_require=['pytest-cov', 'pytest'],
cmdclass={'test': PyTest},
classifiers=[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def json(self):

@pytest.fixture
def oauth_requests(monkeypatch: '_pytest.monkeypatch.monkeypatch'):
def fake_get(url:str, params:dict=None):
def fake_get(url:str, params:dict=None, verify=None):
params = params or {}
if url == "https://ouath.example/token_info":
token = params['access_token']
Expand Down

0 comments on commit 1191915

Please sign in to comment.