Skip to content

Commit

Permalink
tests: disable request signature checking in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Aug 14, 2024
1 parent f617adf commit e6b9047
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pod/activitypub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from django.contrib.auth.models import User
from django.conf import settings
from django.http import HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404
from django.urls import reverse
Expand Down Expand Up @@ -136,7 +137,11 @@ def inbox(request, username=None):
data = json.loads(request.body.decode()) if request.body else None
logger.warning("inbox query: %s", json.dumps(data, indent=True))

if data["type"] in ("Announce", "Update", "Delete") and not check_signatures(request):
if (
data["type"] in ("Announce", "Update", "Delete")
and not settings.TEST_SETTINGS
and not check_signatures(request)
):
return HttpResponse("Signature could not be verified", status=403)

if activitypub_task := TYPE_TASK.get(data["type"], None):
Expand Down

0 comments on commit e6b9047

Please sign in to comment.