Skip to content

Commit

Permalink
Bump flask to 1.1.1 (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre authored Sep 23, 2019
1 parent 025a81c commit af1508e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 25 deletions.
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
language: python

python:
- "2.7"
- "3.6"

matrix:
allow_failures:
- python: "2.7"

sudo: false

cache: pip
Expand All @@ -23,7 +18,6 @@ install:
- psql -c 'SELECT version();' -U postgres
- python setup.py install
- psql -U postgres -c "create database fence_test_tmp"
- if [[ $TRAVIS_PYTHON_VERSION != 3.6 ]]; then userdatamodel-init --db fence_test_tmp; fi
- pip list

before_script:
Expand Down
6 changes: 5 additions & 1 deletion fence/blueprints/login/redirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
folder).
"""

from cdislogging import get_logger
import flask

from fence.blueprints.login.utils import allowed_login_redirects, domain
from fence.errors import UserError


logger = get_logger(__name__)


def validate_redirect(url):
"""
Complain if a given URL is not on the login redirect whitelist.
Expand All @@ -31,7 +35,7 @@ def validate_redirect(url):
"""
allowed_redirects = allowed_login_redirects()
if domain(url) not in allowed_redirects:
flask.current_app.logger.error(
logger.error(
"invalid redirect {}. expected one of: {}".format(url, allowed_redirects)
)
raise UserError("invalid login redirect URL {}".format(url))
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cdiserrors==0.1.2
cdispyutils==1.0.2
cryptography>=2.1.2<3.0
datamodelutils==0.4.5
Flask==0.12.4
Flask==1.1.1
Flask-CORS==3.0.3
Flask_OAuthlib==0.9.4
flask-restful==0.3.6
Expand All @@ -36,7 +36,7 @@ six==1.11.0
SQLAlchemy==1.3.3
temps==0.3.0
userdatamodel==2.0.1
Werkzeug==0.12.2
Werkzeug==0.16.0
pyyaml==5.1
retry==0.9.2
git+https://github.com/uc-cdis/storage-client.git@1.0.0#egg=storageclient
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"cached_property>=1.5.1,<2.0.0",
"cryptography>=2.1.2<3.0",
"flask-restful>=0.3.6,<1.0.0",
"Flask>=0.10.1,<1.0.0",
"Flask>=1.1.1,<2.0.0",
"Flask-CORS>=3.0.3,<4.0.0",
"Flask_OAuthlib>=0.9.4,<1.0.0",
"Flask_SQLAlchemy_Session>=1.1,<2.0",
Expand All @@ -37,7 +37,7 @@
"SQLAlchemy>=1.3.3,<1.4.0",
"temps>=0.3.0,<1.0.0",
"userdatamodel>=2.0.1,<3.0.0",
"Werkzeug>=0.12.2,<1.0.0",
"Werkzeug>=0.16.0,<1.0.0",
"storageclient",
"pyyaml~=5.1",
],
Expand Down
24 changes: 12 additions & 12 deletions tests/data/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def test_indexd_download_file_no_jwt(client, auth_client):
assert response.status_code == 401

# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
assert response.mimetype == "text/html"
assert not response.json


@pytest.mark.parametrize(
Expand All @@ -160,8 +160,8 @@ def test_indexd_unauthorized_download_file(
assert response.status_code == 401

# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
assert response.mimetype == "text/html"
assert not response.json


@pytest.mark.parametrize(
Expand Down Expand Up @@ -219,8 +219,8 @@ def test_unauthorized_indexd_download_file(
assert response.status_code == 401

# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
assert response.mimetype == "text/html"
assert not response.json

mock_index_document.stop()

Expand Down Expand Up @@ -281,8 +281,8 @@ def test_unauthorized_indexd_upload_file(
assert response.status_code == 401

# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
assert response.mimetype == "text/html"
assert not response.json

mock_index_document.stop()

Expand Down Expand Up @@ -343,8 +343,8 @@ def test_unavailable_indexd_upload_file(
assert response.status_code == 401

# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
assert response.mimetype == "text/html"
assert not response.json

mock_index_document.stop()

Expand Down Expand Up @@ -465,8 +465,8 @@ def test_public_bucket_unsupported_protocol_file(
assert response.status_code == 400

# response should not be JSON, should be HTML error page
with pytest.raises(ValueError):
response.json
assert response.mimetype == "text/html"
assert not response.json


def test_blank_index_upload(app, client, auth_client, encoded_creds_jwt, user_client):
Expand Down
4 changes: 2 additions & 2 deletions tests/link/test_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ def test_patch_google_link(
.first()
)
# make sure the link is valid for the requested time
# (allow up to 10 sec for runtime)
# (allow up to 15 sec for runtime)
diff = account_in_proxy_group.expires - int(time.time())
assert requested_exp <= diff <= requested_exp + 10
assert requested_exp <= diff <= requested_exp + 15


def test_patch_google_link_account_not_in_token(
Expand Down

0 comments on commit af1508e

Please sign in to comment.