Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add attributes to webhook events for better debugging #4206

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

zepatrik
Copy link
Member

With this change we add two attributes to webhook events:

  • WebhookID: a string that can be set in the config and that helps to identify the actual webhook config that was used
  • TriggerID: a random string that helps to correlate requests across retries

f := &login.Flow{ID: x.NewUUID()}

webhookReceiver := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/ok" {
w.WriteHeader(200)
w.Write([]byte("ok"))
} else {
w.WriteHeader(400)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

400 would not trigger retries.

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 98.61111% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.49%. Comparing base (1008639) to head (a4cab0d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
request/config.go 90.90% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4206      +/-   ##
==========================================
+ Coverage   78.48%   78.49%   +0.01%     
==========================================
  Files         380      380              
  Lines       27143    27158      +15     
==========================================
+ Hits        21302    21319      +17     
+ Misses       4218     4217       -1     
+ Partials     1623     1622       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zepatrik zepatrik merged commit 00da05d into master Nov 14, 2024
27 checks passed
@zepatrik zepatrik deleted the feat/webhook-id branch November 14, 2024 14:20
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.

2 participants