Skip to content

Commit 9e090bc

Browse files
committed
build: TT-352 implementation of CSRF Protection using Flask-WTF
1 parent 9539885 commit 9e090bc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

V2/source/entry_points/flask_api/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
from flask import Flask
2+
from flask_wtf.csrf import CSRFProtect
23
from flask_restplus import Namespace, Resource, Api
34
from http import HTTPStatus
45
from . import activities_endpoints
56

6-
7+
csrf = CSRFProtect()
78
def create_app(test_config=None):
89
app = Flask(__name__)
10+
csrf.init_app(app)
911

1012
api = Api(
1113
app,
@@ -23,4 +25,5 @@ def create_app(test_config=None):
2325

2426
api.add_namespace(ns_activities)
2527

28+
2629
return app

requirements/time_tracker_api/prod.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#Required by Flask
1111
Flask==1.1.1
12+
Flask-WTF==0.15.1
1213
flake8==3.7.9
1314
WSGIserver==1.3
1415
Werkzeug==0.16.1

0 commit comments

Comments
 (0)