diff options
author | 2023-12-10 15:39:11 +0100 | |
---|---|---|
committer | 2023-12-11 09:58:06 +0100 | |
commit | 182c1356833d30f77bd1b83b138d7e5e57d63dd6 (patch) | |
tree | f8f90e99b8510cc1174dc00e1c3d6e73e92e7ca7 /pydis_site/apps/api/urls.py | |
parent | Merge 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.py | 12 |
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' + ), ) |