aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/urls.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2023-12-10 15:39:11 +0100
committerGravatar Johannes Christ <[email protected]>2023-12-11 09:58:06 +0100
commit182c1356833d30f77bd1b83b138d7e5e57d63dd6 (patch)
treef8f90e99b8510cc1174dc00e1c3d6e73e92e7ca7 /pydis_site/apps/api/urls.py
parentMerge pull request #1167 from python-discord/dependabot/pip/pre-commit-3.6.0 (diff)
Implement the github-filter worker in the API
The current github-filter worker, found at https://github.com/python-discord/workers/blob/main/github-filter/src/index.ts, fails to work at present because Discord's webhook endpoints block Cloudflare's IP ranges from accessing this endpoint. Whilst they use Cloudflare to guard themselves, it seems they do not wish others to use it. Implement it on the site to circumvent IP restrictions and allow to modify the code in Python.
Diffstat (limited to 'pydis_site/apps/api/urls.py')
-rw-r--r--pydis_site/apps/api/urls.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/pydis_site/apps/api/urls.py b/pydis_site/apps/api/urls.py
index f872ba92..80d4edc2 100644
--- a/pydis_site/apps/api/urls.py
+++ b/pydis_site/apps/api/urls.py
@@ -1,7 +1,12 @@
from django.urls import include, path
from rest_framework.routers import DefaultRouter
-from .views import GitHubArtifactsView, HealthcheckView, RulesView
+from .views import (
+ GitHubArtifactsView,
+ GitHubWebhookFilterView,
+ HealthcheckView,
+ RulesView,
+)
from .viewsets import (
AocAccountLinkViewSet,
AocCompletionistBlockViewSet,
@@ -101,4 +106,9 @@ urlpatterns = (
GitHubArtifactsView.as_view(),
name="github-artifacts"
),
+ path(
+ 'github/webhook-filter/<str:webhook_id>/<str:webhook_token>',
+ GitHubWebhookFilterView.as_view(),
+ name='github-webhook-filter'
+ ),
)