Bump Flask and itsdangerous

This bumps Flask to version 2.1.0, which requires some minor changes to
the app code and itsdangerous to also be bumped.
This commit is contained in:
Katie Smith
2022-04-05 17:06:08 +01:00
parent 9902ddfc22
commit badd0e0894
5 changed files with 32 additions and 44 deletions

View File

@@ -283,48 +283,34 @@ def register_blueprint(application):
def register_v2_blueprints(application): def register_v2_blueprints(application):
from app.authentication.auth import requires_auth from app.authentication.auth import requires_auth
from app.v2.broadcast.post_broadcast import ( from app.v2.broadcast.post_broadcast import v2_broadcast_blueprint
v2_broadcast_blueprint as post_broadcast, from app.v2.inbound_sms.get_inbound_sms import v2_inbound_sms_blueprint
from app.v2.notifications import ( # noqa
get_notifications,
post_notifications,
v2_notification_blueprint,
) )
from app.v2.inbound_sms.get_inbound_sms import ( from app.v2.template import ( # noqa
v2_inbound_sms_blueprint as get_inbound_sms, get_template,
) post_template,
from app.v2.notifications.get_notifications import ( v2_template_blueprint,
v2_notification_blueprint as get_notifications,
)
from app.v2.notifications.post_notifications import (
v2_notification_blueprint as post_notifications,
)
from app.v2.template.get_template import (
v2_template_blueprint as get_template,
)
from app.v2.template.post_template import (
v2_template_blueprint as post_template,
)
from app.v2.templates.get_templates import (
v2_templates_blueprint as get_templates,
) )
from app.v2.templates.get_templates import v2_templates_blueprint
post_notifications.before_request(requires_auth) v2_notification_blueprint.before_request(requires_auth)
application.register_blueprint(post_notifications) application.register_blueprint(v2_notification_blueprint)
get_notifications.before_request(requires_auth) v2_templates_blueprint.before_request(requires_auth)
application.register_blueprint(get_notifications) application.register_blueprint(v2_templates_blueprint)
get_templates.before_request(requires_auth) v2_template_blueprint.before_request(requires_auth)
application.register_blueprint(get_templates) application.register_blueprint(v2_template_blueprint)
get_template.before_request(requires_auth) v2_inbound_sms_blueprint.before_request(requires_auth)
application.register_blueprint(get_template) application.register_blueprint(v2_inbound_sms_blueprint)
post_template.before_request(requires_auth) v2_broadcast_blueprint.before_request(requires_auth)
application.register_blueprint(post_template) application.register_blueprint(v2_broadcast_blueprint)
get_inbound_sms.before_request(requires_auth)
application.register_blueprint(get_inbound_sms)
post_broadcast.before_request(requires_auth)
application.register_blueprint(post_broadcast)
def init_app(app): def init_app(app):

View File

@@ -55,7 +55,7 @@ def get_pdf_for_notification(notification_id):
except Exception: except Exception:
raise PDFNotReadyError() raise PDFNotReadyError()
return send_file(filename_or_fp=BytesIO(pdf_data), mimetype='application/pdf') return send_file(path_or_file=BytesIO(pdf_data), mimetype='application/pdf')
@v2_notification_blueprint.route("", methods=['GET']) @v2_notification_blueprint.route("", methods=['GET'])

View File

@@ -7,12 +7,12 @@ Flask-Bcrypt==0.7.1
flask-marshmallow==0.14.0 flask-marshmallow==0.14.0
Flask-Migrate==3.1.0 Flask-Migrate==3.1.0
git+https://github.com/mitsuhiko/flask-sqlalchemy.git@500e732dd1b975a56ab06a46bd1a20a21e682262#egg=Flask-SQLAlchemy==2.3.2.dev20190108 git+https://github.com/mitsuhiko/flask-sqlalchemy.git@500e732dd1b975a56ab06a46bd1a20a21e682262#egg=Flask-SQLAlchemy==2.3.2.dev20190108
Flask==1.1.2 Flask==2.1.0
click-datetime==0.2 click-datetime==0.2
# Should be pinned until a new gunicorn release greater than 20.1.0 comes out. (Due to eventlet v0.33 compatibility issues) # Should be pinned until a new gunicorn release greater than 20.1.0 comes out. (Due to eventlet v0.33 compatibility issues)
git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64#egg=gunicorn[eventlet]==20.1.0 git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64#egg=gunicorn[eventlet]==20.1.0
iso8601==1.0.2 iso8601==1.0.2
itsdangerous==1.1.0 itsdangerous==2.1.2
jsonschema==3.2.0 jsonschema==3.2.0
marshmallow-sqlalchemy==0.23.1 # pyup: <0.24.0 # marshmallow v3 throws errors marshmallow-sqlalchemy==0.23.1 # pyup: <0.24.0 # marshmallow v3 throws errors
marshmallow==2.21.0 # pyup: <3 # v3 throws errors marshmallow==2.21.0 # pyup: <3 # v3 throws errors

View File

@@ -75,7 +75,7 @@ docutils==0.15.2
# via awscli # via awscli
eventlet==0.33.0 eventlet==0.33.0
# via gunicorn # via gunicorn
flask==1.1.2 flask==2.1.0
# via # via
# -r requirements.in # -r requirements.in
# flask-bcrypt # flask-bcrypt
@@ -103,16 +103,16 @@ geojson==2.5.0
govuk-bank-holidays==0.10 govuk-bank-holidays==0.10
# via notifications-utils # via notifications-utils
greenlet==1.1.2 greenlet==1.1.2
# via # via eventlet
# eventlet
# sqlalchemy
gunicorn @ git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64 gunicorn @ git+https://github.com/benoitc/gunicorn.git@1299ea9e967a61ae2edebe191082fd169b864c64
# via -r requirements.in # via -r requirements.in
idna==3.3 idna==3.3
# via requests # via requests
importlib-metadata==4.11.3
# via flask
iso8601==1.0.2 iso8601==1.0.2
# via -r requirements.in # via -r requirements.in
itsdangerous==1.1.0 itsdangerous==2.1.2
# via # via
# -r requirements.in # -r requirements.in
# flask # flask
@@ -252,6 +252,8 @@ werkzeug==2.0.3
# via # via
# -r requirements.in # -r requirements.in
# flask # flask
zipp==3.8.0
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# setuptools # setuptools

View File

@@ -128,7 +128,7 @@ def test_bad_method(app_for_test):
assert response.status_code == 405 assert response.status_code == 405
assert response.json == { assert response.get_json(force=True) == {
"result": "error", "result": "error",
"message": "The method is not allowed for the requested URL." "message": "The method is not allowed for the requested URL."
} }