Skip to content

Commit

Permalink
ref: add mypy stubs for django-csp (#54786)
Browse files Browse the repository at this point in the history
upstream seems not super active so I sent an issue there and I'm going
to plop stubs here for now
mozilla/django-csp#198
  • Loading branch information
asottile-sentry authored Aug 15, 2023
1 parent 387f1eb commit 4fd9e33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Empty file.
8 changes: 8 additions & 0 deletions fixtures/stubs-for-mypy/csp/middleware.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.http.request import HttpRequest
from django.http.response import HttpResponseBase
from django.utils.deprecation import MiddlewareMixin

class CSPMiddleware(MiddlewareMixin):
def process_request(self, request: HttpRequest) -> None: ...
def process_response(self, request: HttpRequest, response: HttpResponseBase) -> HttpResponseBase: ...
def build_policy(self, request: HttpRequest, response: HttpResponseBase) -> str: ...
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ module = [
"celery.*",
"codeowners.*",
"confluent_kafka.*",
"csp.middleware.*",
"cssselect.*",
"django_zero_downtime_migrations.backends.postgres.schema.*",
"docker.*",
Expand Down

0 comments on commit 4fd9e33

Please sign in to comment.