Skip to content

Middleware

snoop.data.middleware #

Django middlewares for removing framework functionality.

Enforces system-wide disabling of the Login System (automatically logging everyone in as an admin with no password visiting the page) and the CSRF protection system (that requires headers from this server to reach the UI and back.

As stated in the readme, this Django instance leaves access control and security a problem outside its scope. The port needs to be firewalled off and made accessible only to sysadmins debugging the Tasks table.

Classes#

AutoLogin #

Middleware that automatically logs anonymous users in as an administrator named "root".

Since the Django Admin can't work without the concept of users, we couldn't disable the system - so we use this middleware to create and log in an admin user called "root", and use the admin normally.

DisableCSRF #

Middleware that patches requests to disable CSRF checks.

Since the Django Admin can't work without CSRF enabled, we couldn't disable the system - so we use this middleware to patch it out.