Skip to content

Commit

Permalink
Merge pull request #13 from zalando/issues12-cert
Browse files Browse the repository at this point in the history
#12 Use certifi bundle
  • Loading branch information
jmcs committed Jun 17, 2015
2 parents 200b741 + c6026d1 commit 1b5b5d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

version = '0.4.1'
version = '0.4.2'


class PyTest(TestCommand):
Expand Down 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 1b5b5d0

Please sign in to comment.