Skip to content

Add non-verified methods to managed handlers - #1878

Open
xavdid wants to merge 2 commits into
betafrom
DEVSDK-2897
Open

Add non-verified methods to managed handlers#1878
xavdid wants to merge 2 commits into
betafrom
DEVSDK-2897

Conversation

@xavdid

@xavdid xavdid commented Aug 15, 2026

Copy link
Copy Markdown
Member

Why?

On the back of my work in DEVSDK-3085, we're adding support for non-verified webhook handing to the managed handlers. There were two key design stipulations:

  1. It should be impossible to handle a webhook on the with-verification handler without supplying a signature header. As a result, we have to be very careful about overwriting/mixing our handle methods and if/when we call the signature verification methods.
  2. The without-verification handler should feel like an implementation detail (where possible). Users should feel like they're interacting with "The" event notification handler

To that end, the main entrypoint for the non-verified handler is a new method on the client and a static method on the with-verification handler. The non-verified handlers are public in each language so users can interact with them normally, but the intention is that they're not something the user thinks much about on their own.

Design wise, the exact implementation varied between languages, but the general idea was the same. I moved all the generated on_* methods onto a private base class, then added sibling handlers for the "with" and "without" verification paths. That way they each have distinct handle methods and it's impossible for a caller to see the "wrong" one. If we had used inheritance, then the child would have the parent's handle signature exposed, which is confusing (even if we overrode it to always error).

What?

  • Add StripeEventNotificationHandlerWithoutVerification class and associated constructors, docstrings, and client methods
  • add tests
  • update examples

See Also

@xavdid xavdid changed the title TKTK Add non-verified methods to managed handlers Aug 15, 2026
@xavdid
xavdid marked this pull request as ready for review August 18, 2026 22:27
@xavdid
xavdid requested a review from a team as a code owner August 18, 2026 22:27
@xavdid
xavdid requested review from justiny-stripe and removed request for a team August 18, 2026 22:27
@xavdid
xavdid enabled auto-merge (squash) August 19, 2026 00:28
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