feat(BA-7345): limit the size of an app config fragment - #13739
Draft
jopemachine wants to merge 3 commits into
Draft
feat(BA-7345): limit the size of an app config fragment#13739jopemachine wants to merge 3 commits into
jopemachine wants to merge 3 commits into
Conversation
Nothing bounded a fragment's config document: the DTO accepted any dict, the service checked nothing, and the JSONB column stopped only at Postgres' field ceiling. Since an allow-listed user may write their own user-scope fragment, and every app config read merges the fragments it finds, an oversize document was both reachable without admin rights and paid for on every read. Cap one fragment at 64 KiB of compact JSON and reject an oversize document in the service, before the batch reaches the repository. The value is provisional - BA-7345 still holds the open questions of the number itself, of whether it belongs in the manager config, and of a cap on the merged result. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
jopemachine
commented
Aug 12, 2026
| ) | ||
|
|
||
| #: Upper bound on one fragment's config document, measured on its compact JSON encoding. | ||
| MAX_APP_CONFIG_FRAGMENT_BYTES: Final[int] = 64 * 1024 |
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.
Resolves #13730 (BA-7345)
Summary
MAX_APP_CONFIG_FRAGMENT_BYTES), checked inAppConfigFragmentService.bulk_upsertbefore the batch reaches the repository, so the GraphQL and the REST v2 write paths are both covered. Nothing bounded the document until now — the DTO accepted any dict and the JSONB column stopped only at Postgres' field ceiling.AppConfigFragmentTooLargeerror under a newErrorDomain.APP_CONFIG_FRAGMENT. One oversize item rejects the whole batch, as the allow-list write gate already does.The value is arbitrary for this PR. BA-7345 keeps the open questions: the number itself, whether it belongs in the manager config or per config name on the definition / allow-list entry, whether the merged result of all fragments for one config name needs its own cap, and whether the per-request item count should be bounded too.
Test plan
🤖 Generated with Claude Code