Repository navigation
feat: support SEAM_WEBHOOK_SECRET in webhook helper - #346
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Add SEAM_WEBHOOK_SECRET support to this maintained Seam SDK webhook helper and open a PR. This should be a small change: omitted constructor secret reads SEAM_WEBHOOK_SECRET; an explicitly supplied secret takes precedence. Preserve existing webhook verification semantics and idiomatic constructor usage. Include focused tests and examples. This is one of five parallel SDK PRs. No merge requested.
passing null for php etc should not be allowed here, it is an optional argument and only uses env when not passed in. other values would be an error
What Changed
SeamWebhookconstructor that readsSEAM_WEBHOOK_SECRETat construction time; explicitly supplied secrets take precedence.Risk Assessment
✅ Low: The bounded constructor change distinguishes omission from explicit null, preserves Svix verification, and includes focused behavioral coverage.
Testing
Four real-SDK consumer scenarios and 26 focused webhook tests passed on .NET 10. Retained runtime evidence and driver source; cleaned disposable files and stopped build servers. Restore emitted nonblocking cache/audit permission warnings. No UI surface or tenant validation; .NET 8 runtime was unavailable.
Evidence: Real SDK consumer transcript
Real SDK consumer accepted independently signed events and rejected invalid secrets, tampered bodies, wrong keys, expired signatures, and missing signatures.Evidence: Disposable consumer source and independent HMAC oracle
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
src/Seam/SeamWebhook.cs:30- Intent requires "only uses env when not passed in" and "passing null ... should not be allowed"; the addedpublic SeamWebhook(string? secret = null)andsecret ??= Environment.GetEnvironmentVariable(...)instead accept explicit null. With SEAM_WEBHOOK_SECRET set,new SeamWebhook(null)silently succeeds using that key. Remove this unrequired null fallback: use a parameterless environment-reading constructor and an explicit-secret constructor that rejects null. The same contract must change at src/Seam/SeamWebhook.cs:24 (XML documentation), README.md:264 (null example), test/Seam.Test/SeamWebhookTests.cs:39-48 (null acceptance), and test/Seam.Test/SeamWebhookTests.cs:76 (null rejection currently depends on missing environment).🔧 Fix applied.
1 warning still open:
.dotnet/.dotnet/10.0.400.aspNetCertificateSentinel:1- Remove the SDK first-run sentinel artifacts: no webhook-environment requirement needs them. The fix round introduced these machine-local tool-state files, unrelated to the minimal constructor fix. Also remove .dotnet/.dotnet/10.0.400.dotnetFirstUseSentinel:1 and .dotnet/.dotnet/10.0.400.toolpath.sentinel:1 (all three files are empty).🔧 Fix applied.
1 warning still open:
.dotnet/.dotnet/10.0.400.aspNetCertificateSentinel:1- Remove the SDK first-run sentinel artifacts: no webhook-environment requirement needs them. The fix round introduced these machine-local tool-state files, unrelated to the minimal constructor fix. Also remove .dotnet/.dotnet/10.0.400.dotnetFirstUseSentinel:1 and .dotnet/.dotnet/10.0.400.toolpath.sentinel:1 (all three files are empty).✅ **Test** - passed
✅ No issues found.
dotnet run --project .validation/WebhookSmoke.csproj -p:RunAnalyzers=falsedotnet test test/Seam.Test/Seam.Test.csproj -f net10.0 --filter FullyQualifiedName~SeamWebhookTests -p:RunAnalyzers=false— 26 passeddotnet .validation/bin/Debug/net10.0/WebhookSmoke.dll— retained runtime transcriptdotnet build-server shutdown; removed disposable consumer and newly created build outputs; verified clean worktree✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.