Skip to content

Commit

Permalink
add comparation secret key for webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
KuzenkovAG committed Jun 30, 2023
1 parent 6745519 commit 2a65225
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hmom3/apps/webhooks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import git
from django.conf import settings
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt

w_secret = settings.SECRET_KEY

Expand All @@ -18,6 +19,7 @@ def is_valid_signature(x_hub_signature, data, private_key):
return hmac.compare_digest(mac.hexdigest(), github_signature)


@csrf_exempt
def pull_repo(request):
"""Compare secret key, and pull repo to get changes from GitHub."""
if request.method != 'POST':
Expand Down
1 change: 0 additions & 1 deletion hmom3/hmom3/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from dotenv import load_dotenv

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

load_dotenv()
Expand Down

0 comments on commit 2a65225

Please sign in to comment.