Repository navigation
feat: blog articles resource and webhook verifier - #30
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 (get_settings,update_settings,rotate_website_secret,test_website), keywords (list_keywords,plan_keywords,add_keyword,update_keyword,delete_keyword) and articles (list_articles,request_article,get_article,update_article,regenerate_article,publish_article,reject_article,delete_article), with theBlogSettings,BlogSettingsUpdate,BlogWebsiteTest,BlogKeyword,BlogArticle,BlogArticleFull,BlogArticleImagemodels and the status/target-kind constants. Wire casing is camelCase throughout, including theworkspaceIdquery key; callers pass snake_case keywords as elsewhere in the gem. 402 raisesPaymentRequiredError, 409 raisesFopost::Errorwith the code, matching the existing map.Fopost::Webhooks.verify(raw_body, headers, secret): constant-time HMAC check over the raw bytes (OpenSSL.fixed_length_secure_compare), timestampedX-FoPost-Signature-256preferred with a 300 s tolerance, plainX-FoPost-Signatureonly when no timestamp header is present. Returns aWebhookEvent;#articletypes thearticle.publishedpayload asBlogArticlePublished. RaisesFopost::WebhookSignatureError.How to verify
test/blog_test.rbpins paths, methods, query and body shapes per group;test/webhooks_test.rbcovers a valid timestamped signature, a tampered body, a stale timestamp, and the legacy body-only fallback.Release
No version bump; releases are batched.
fopost-railswrapper follows separately.