Repository navigation
feat: regenerate client from openapi-v241.7.0 - #126
Merged
Merged
Conversation
Caps gzip webhook decompression at 10 MiB (Webhook.maxPayloadBytes) and adds the spec changes since openapi-v240.7.1.
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.
Submit a pull request
CLA
Description of the pull request
Problem
Webhook.gunzipPayloadinflated a gzip body with no size limit before the signature check, so an unsigned request of a few hundred KB could expand to hundreds of MB and exhaust memory on a webhook endpoint.Solution
Regenerated from chat tag
v241.7.0(protocolopenapi-v241.7.0) withgenerate.sh. Decompression now stops at 10 MiB and throwsInvalidWebhookError("payload exceeds ... bytes"); raiseWebhook.maxPayloadBytesif your events are larger. The same helper backs the SQS and SNS decode paths. A shared_invalid/oversized_compressionfixture covers it.The regen also brings the spec changes since
openapi-v240.7.1, all additive: agent review and agent feedback methods,countReviewQueue,expected_valueon the custom-property rule parameters,severitieson text, OCR, IP flag count and closed caption rules, and new optional query parameters. No removed classes or fields, no changed method signatures.EventHook.sqsRoleArnandsnsRoleArnare marked deprecated.How to verify
./gradlew spotlessCheck build(passes locally).WebhookTestruns theoversized_compressionfixture and expects "payload exceeds".BEGIN_COMMIT_OVERRIDE
fix: limit decompressed webhook payloads to 10 MiB, configurable with Webhook.maxPayloadBytes
feat: add countReviewQueue
feat: add getAgentReviewStatus
feat: add listAgentFeedback
feat: add submitAgentFeedback
feat: add include_soft_deleted_channel to GetChannel
feat: add skip_viewer_visibility to GetActivity
feat: add limit and offset to ListImports
feat: add remove_future_channels_ban to Unban
feat: add agent_recommendation to ActionLogResponse and SubmitActionRequest
feat: add agent_review to AppResponseFields, UpdateAppRequest, GetReviewQueueItemResponse and ReviewQueueItemResponse
feat: add effective_agent_review to AppResponseFields
feat: add diversify to ArrangeConfig
feat: add expected_value to CallCustomPropertyParameters, ContentCustomPropertyParameters, ContentCustomPropertyCountParameters and UserCustomPropertyParameters
feat: add severities to TextRuleParameters, TextContentParameters, OCRContentParameters, IPFlagCountRuleParameters and ClosedCaptionRuleParameters
feat: add custom_format to ImportV2TaskSettings
feat: add reasoning_effort and strictness to ModerationEngineConfigRequest and ModerationEngineConfigResponse
feat: add item_count_capped and item_count_pending to ModerationQueueResponse
feat: add matched_blocklists to ModerationRulesTriggeredEvent
feat: deprecate sqs_role_arn and sns_role_arn on EventHook
END_COMMIT_OVERRIDE
Note
Medium Risk
Security-sensitive webhook decompression change is intentional and tested; the bulk is generated additive API surface, but moderation/agent endpoints affect production moderation workflows.
Overview
Webhook hardening:
gunzipPayloadnow enforces a 10 MiB decompressed size limit via configurableWebhook.maxPayloadBytes, throwingInvalidWebhookErrorwhen exceeded. This runs before signature verification, closing a gzip-bomb memory exhaustion vector on HTTP/SQS/SNS decode paths. Tests and fixtures cover the oversized case.OpenAPI v241.7.0 regeneration (additive): The client gains Nora agent moderation surface area—
listAgentFeedback,submitAgentFeedback,getAgentReviewStatus,countReviewQueue, plus related request/response models andagent_review/agent_recommendationfields on app settings, review queue items, and submit action payloads.Other spec deltas include rule
expected_valueandseveritiesfields,diversifyarrange config, importcustom_format, moderation enginereasoning_effort/strictness, queue count metadata (item_count_capped/pending),matched_blocklistson rule-triggered events, and new query params (include_soft_deleted_channel,skip_viewer_visibility, list imports pagination,remove_future_channels_ban).EventHook.sqs_role_arnandsns_role_arnare deprecated.Reviewed by Cursor Bugbot for commit 8f283e7. Bugbot is set up for automated code reviews on this repo. Configure here.