aurweb/aurweb/models
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
..
__init__.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
accepted_term.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
account_type.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
api_rate_limit.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
ban.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
declarative.py add Base.as_dict() and Base.json() 2021-06-13 10:48:31 -07:00
dependency_type.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
group.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
license.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
official_provider.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_base.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_blacklist.py add PackageBlacklist SQLAlchemy ORM model 2021-06-11 17:28:08 -07:00
package_comaintainer.py add PackageComaintainer SQLAlchemy ORM model 2021-06-11 16:52:45 -07:00
package_comment.py add PackageComment SQLAlchemy ORM model 2021-06-11 00:35:18 -07:00
package_dependency.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_group.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_keyword.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_license.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_notification.py add PackageNotification SQLAlchemy ORM model 2021-06-11 17:14:28 -07:00
package_relation.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
package_request.py add PackageRequest SQLAlchemy ORM model 2021-06-11 21:21:38 -07:00
package_source.py add PackageSource SQLAlchemy ORM model 2021-06-10 17:46:29 -07:00
package_vote.py add PackageVote SQLAlchemy ORM model 2021-06-10 13:55:07 -07:00
relation_type.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
request_type.py add RequestType SQLAlchemy ORM model 2021-06-11 17:37:51 -07:00
session.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
ssh_pub_key.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
term.py use declarative_base for all ORM models 2021-06-10 13:54:27 -07:00
tu_vote.py add TUVote SQLAlchemy ORM model 2021-06-11 22:14:38 -07:00
tu_voteinfo.py TUVoteInfo: generalize Quorum 2021-06-11 21:48:39 -07:00
user.py aurweb.asgi: add security headers middleware 2021-06-22 20:33:45 -07:00