Repository navigation
feat: blog articles resource and webhook verifier - #28
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
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.
What
client.blog(): settings (getSettings,updateSettings,rotateWebsiteSecret,testWebsite), keywords (listKeywords,planKeywords,addKeyword,updateKeyword,deleteKeyword) and articles (listArticles,requestArticle,getArticle,updateArticle,regenerateArticle,publishArticle,rejectArticle,deleteArticle), withBlogSettings,BlogKeyword,BlogArticle,BlogArticleFull,BlogArticleImagerecords and theBlogArticleStatus,BlogKeywordStatus,BlogTargetKindconstants.workspaceIdrides on the query string for GET/PATCH/DELETE and in the body for POST/PATCH/settings,/keywords,/keywords/plan,/articles. 402 maps toPaymentRequiredException, 409 toFoPostExceptionwith the code, as elsewhere.WebhookVerifier.verify(rawBody, headers, secret)(alsoclient.webhooks().verify): HMAC-SHA256 viajavax.crypto.Mac, constant-time compare viaMessageDigest.isEqual, timestampedX-FoPost-Signature-256preferred with a 300 s tolerance, body-onlyX-FoPost-Signatureonly when no timestamp header is sent. ReturnsWebhookEnvelope {event, data, timestamp};envelope.data(BlogArticlePublished.class)types thearticle.publishedpayload.WebhookEvents.ARTICLE_PUBLISHEDadded.How to verify
mvn -B verify(148 tests, 0 failures, warning-free).BlogTestcovers one case per resource group againstFakeTransport;WebhookVerifierTestcovers a valid timestamped signature, a tampered body, a stale timestamp and the legacy body-only signature.Release
No version bump; releases are batched.
fopost-springneeds no change to compile, but should gain theblog()passthrough when the SDK is released.