Skip to content

Commit

Permalink
Remove support for CSRF tokens (#2283)
Browse files Browse the repository at this point in the history
* Remove support for CSRF tokens

Fixes #1308

* Delete some more unused csrf references
  • Loading branch information
jcristau authored Jan 11, 2022
1 parent 3ccbf02 commit 8946615
Show file tree
Hide file tree
Showing 18 changed files with 27 additions and 228 deletions.
8 changes: 0 additions & 8 deletions docs/source/autodocs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ auslib.web.admin
:members:
:undoc-members:

.. automodule:: auslib.web.admin.views.csrf
:members:
:undoc-members:

.. automodule:: auslib.web.admin.views.history
:members:
:undoc-members:
Expand Down Expand Up @@ -190,10 +186,6 @@ auslib.web.admin
auslib.web.common
-----------------

.. automodule:: auslib.web.common.csrf
:members:
:undoc-members:

.. automodule:: auslib.web.common.emergency_shutoff
:members:
:undoc-members:
Expand Down
4 changes: 0 additions & 4 deletions src/auslib/web/admin/emergency_shutoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ def scheduled_changes():
@requirelogin
@transactionHandler
def schedule_deletion(sc_emergency_shutoff, changed_by, transaction):
if "csrf_token" in sc_emergency_shutoff:
del sc_emergency_shutoff["csrf_token"]
change_type = sc_emergency_shutoff.get("change_type")
if change_type != "delete":
return problem(400, "Bad Request", "Invalid or missing change_type")
Expand All @@ -62,8 +60,6 @@ def schedule_deletion(sc_emergency_shutoff, changed_by, transaction):
@requirelogin
@transactionHandler
def update_scheduled_deletion(sc_id, sc_emergency_shutoff, changed_by, transaction):
if "csrf_token" in sc_emergency_shutoff:
del sc_emergency_shutoff["csrf_token"]
view = ScheduledChangeView("emergency_shutoff", dbo.emergencyShutoffs)
return view._post(sc_id, sc_emergency_shutoff, transaction, changed_by, sc_emergency_shutoff["sc_data_version"])

Expand Down
Loading

0 comments on commit 8946615

Please sign in to comment.