Skip to content

Commit

Permalink
fix: added CSRF protection
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmanuel-tirado committed Dec 4, 2024
1 parent 2a1360c commit 9c7cd14
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 82 deletions.
4 changes: 4 additions & 0 deletions pantos/servicenode/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import flask_cors # type: ignore
import flask_restful # type: ignore
import flask_restful.reqparse # type: ignore
from flask_wtf.csrf import CSRFProtect

import marshmallow
import marshmallow.validate
from pantos.common.blockchains.enums import Blockchain
Expand Down Expand Up @@ -38,6 +40,8 @@

# Allow CORS for all domains on all routes
flask_cors.CORS(flask_app)
csrf = CSRFProtect()
csrf.init_app(flask_app) # Compliant

_logger = logging.getLogger(__name__)
"""Logger for this module."""
Expand Down
Loading

0 comments on commit 9c7cd14

Please sign in to comment.