Kontent.Ai.AspNetCore 1.0.0-rc.2
Pre-releaseBreaking changes
WebhookNotification.NotificationsisIReadOnlyList<WebhookModel>?instead ofWebhookModel[]?.WebhookNotificationis a record, so it compares by value — except that an array member compares by reference, which meant two notifications carrying identical payloads were never equal. The array was also handed out mutable, so a caller could rewrite a deserialized payload in place. Reading the collection is unaffected: indexing,foreach,Count(rather thanLength) and LINQ all work as before. Code that assigned an array to the property still compiles; code that declared the receiving variable asWebhookModel[]needsIReadOnlyList<WebhookModel>orvar.
Changed
- The modern signature header now wins when a request carries both.
X-Kontent-ai-Signatureis read first andX-KC-Signatureis the fallback, rather than the other way round. Both were always verified against the same secret, so this is not a security change — a request with only one header behaves exactly as before. It only settles which is authoritative when both are present, and it matches how the README and the header names themselves present the two.
Fixed
-
RichTextTagHelperuses a primary constructor, matching the other tag helpers in the package. -
A null
predicatepassed toUseWebhookSignatureValidatoris rejected at registration. Every other argument on those overloads was guarded; this one was dereferenced later byUseWhen, so the mistake surfaced away from the call that made it. -
The webhook signature is computed over the bytes as received. The body was decoded to a string and re-encoded before hashing. The decoder substitutes replacement characters for malformed input rather than failing, so that round trip could map two different request bodies onto the same bytes — and a comment claimed the opposite property, that a body which is not valid UTF-8 could not hash like one that is. Verification is fail-closed either way, so no invalid signature was ever accepted; the round trip and the comment are both gone.
Installation
dotnet add package Kontent.Ai.AspNetCore --prereleaseFull changelog: src/aspnetcore/CHANGELOG.md