Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit e189de6

Browse files
authored
Merge pull request #152 from CSCfi/dev
Dev
2 parents 1fdc0da + c55b31b commit e189de6

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

.github/workflows/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install dependencies

.github/workflows/unit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ jobs:
88
max-parallel: 4
99
matrix:
1010
os: [ubuntu-latest]
11-
python-version: [3.6, 3.7]
11+
python-version: [3.6, 3.7.7]
1212

1313
runs-on: ${{ matrix.os }}
1414

1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v1
18+
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install libcurl-devel

beacon_api/conf/config.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
title=GA4GHBeacon at CSC
88

99
# Version of the Beacon implementation
10-
version=1.7.0
10+
version=1.7.1
1111

1212
# Author of this software
1313
author=CSC developers

beacon_api/utils/validate_jwt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from ..api.exceptions import BeaconUnauthorised, BeaconForbidden, BeaconServerError
88
from aiohttp import web
99
from authlib.jose import jwt
10-
from authlib.jose.errors import MissingClaimError, InvalidClaimError, ExpiredTokenError, InvalidTokenError
10+
from authlib.jose.errors import MissingClaimError, InvalidClaimError, ExpiredTokenError, InvalidTokenError, DecodeError
1111
import re
1212
import aiohttp
1313
from os import environ
@@ -131,6 +131,8 @@ async def token_middleware(request: web.Request, handler):
131131
raise BeaconForbidden(obj, request.host, f'Token info not corresponding with claim: {e}') # pragma: no cover
132132
except InvalidTokenError as e: # pragma: no cover
133133
raise BeaconUnauthorised(obj, request.host, "invalid_token", f'Invalid authorization token: {e}') # pragma: no cover
134+
except DecodeError as e: # pragma: no cover
135+
raise BeaconUnauthorised(obj, request.host, "invalid_token", f'Invalid JWT format: {e}') # pragma: no cover
134136
else:
135137
request["token"] = {"bona_fide_status": False,
136138
"permissions": None,

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ commands = py.test -x --cov=beacon_api tests/ --cov-fail-under=80
5050

5151
[gh-actions]
5252
python =
53-
3.6: flake8, unit_tests, docs, bandit, mypy
53+
3.6: unit_tests
5454
3.7: flake8, unit_tests, docs, bandit, mypy

0 commit comments

Comments
 (0)