Skip to content

fix: support plain token webhook verification (GitLab)#58

Merged
matthiastjong merged 1 commit intomainfrom
fix/webhook-plain-token-verification
Apr 15, 2026
Merged

fix: support plain token webhook verification (GitLab)#58
matthiastjong merged 1 commit intomainfrom
fix/webhook-plain-token-verification

Conversation

@matthiastjong
Copy link
Copy Markdown
Owner

Summary

  • GitLab stuurt het secret als plain text in X-Gitlab-Token, niet als HMAC hash
  • verifySignature probeert nu eerst HMAC (GitHub-style), valt terug op directe timing-safe vergelijking (GitLab-style)
  • Beide methoden blijven timing-safe

Test plan

  • GitLab webhook met X-Gitlab-Token levert nu 200 in plaats van 401
  • GitHub webhook met X-Hub-Signature-256 (HMAC) werkt nog steeds

🤖 Generated with Claude Code

HMAC verification assumed all signatures are sha256 hex digests.
GitLab sends the secret as plain text in X-Gitlab-Token instead.
Now tries HMAC first, falls back to direct timing-safe comparison.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@matthiastjong matthiastjong merged commit e84bb00 into main Apr 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant