aurweb/templates
Kevin Morris 865c414504 aurweb.asgi: add security headers middleware
This commit introduces a middleware function which adds
the following security headers to each response:

- Content-Security-Policy
    - This includes a new `nonce`, which is tied to a user
      via authentication middleware. Both an anonymous user
      and an authenticated user recieve their own random nonces.
- X-Content-Type-Options
- Referrer-Policy
- X-Frame-Options

They are then tested for existence in test/test_routes.py.

Note: The overcomplicated-looking asyncio behavior in the
middleware function is used to avoid a warning about the old
coroutine awaits being deprecated. See
https://docs.python.org/3/library/asyncio-task.html#asyncio.wait
for more detail.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-22 20:33:45 -07:00
..
account add account (view) route 2021-06-05 20:11:17 -07:00
errors Adding route tests 2021-06-05 19:52:56 -07:00
partials aurweb.asgi: add security headers middleware 2021-06-22 20:33:45 -07:00
index.html port over base HTML layout from PHP to FastAPI+Jinja2 2021-06-05 19:50:51 -07:00
login.html implement login + logout routes and templates 2021-06-05 20:11:17 -07:00
passreset.html add passreset routes 2021-06-05 20:11:17 -07:00
register.html add user registration routes 2021-06-05 20:11:17 -07:00