Skip to content

Commit fa54e55

Browse files
committed
Update async security handler factory
1 parent 84c772b commit fa54e55

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

connexion/security/async_security_handler_factory.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,20 @@ def verify_security(cls, auth_funcs, function):
6666
@functools.wraps(function)
6767
async def wrapper(request):
6868
token_info = cls.no_value
69-
problem = None
69+
errors = []
7070
for func in auth_funcs:
7171
try:
7272
token_info = func(request)
7373
while asyncio.iscoroutine(token_info):
7474
token_info = await token_info
7575
if token_info is not cls.no_value:
7676
break
77-
except (OAuthProblem, OAuthResponseProblem, OAuthScopeProblem) as err:
78-
problem = err
77+
except Exception as err:
78+
errors += err
7979

8080
if token_info is cls.no_value:
81-
if problem is not None:
82-
raise problem
81+
if errors != []:
82+
cls._raise_most_specific(errors)
8383
else:
8484
logger.info("... No auth provided. Aborting with 401.")
8585
raise OAuthProblem(description='No authorization token provided')

0 commit comments

Comments
 (0)