docs: clarify 64 KiB response-body buffer in authz plugin docs#6971
Open
matte1782 wants to merge 1 commit intodocker:masterfrom
Open
docs: clarify 64 KiB response-body buffer in authz plugin docs#6971matte1782 wants to merge 1 commit intodocker:masterfrom
matte1782 wants to merge 1 commit intodocker:masterfrom
Conversation
Adds a "Response body size and partial buffering" subsection to docs/extend/plugins_authorization.md documenting the 64 KiB maxBufferSize constant in the daemon's internal responseModifier (pkg/authorization/response.go in moby/moby) and the practical implications for plugins that use ResponseBody inspection. The existing docs (lines 81-87) say streaming endpoints such as logs and events send only the HTTP request to plugins, but don't explain the underlying mechanism. Plugin authors building response-body redaction or content-filtering can be surprised when the same effect happens on non-listed endpoints whose response is produced through multiple writes exceeding the buffer or via an io.WriteFlusher. The 64 KiB buffer is observable from the public moby source, so this PR is documentation catching up to existing behavior — not a contract change. Signed-off-by: Matteo Panzeri <matteo1782@gmail.com>
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
Adds a new "Response body size and partial buffering" subsection to
docs/extend/plugins_authorization.mddocumenting the 64 KiBmaxBufferSizeconstant in the daemon's internalresponseModifier(pkg/authorization/response.goinmoby/moby) and its practical implications for plugins that useResponseBodyinspection.Why
The existing docs (lines 81–87) tell plugin authors that streaming endpoints such as
logsandeventssend only the HTTP request to authorization plugins, but don't explain the underlying mechanism. As a result, plugin authors building response-body redaction or content-filtering can be surprised when the same effect happens on non-listed endpoints whose response is produced through multiple writes that exceed the buffer, or whose handler usesio.WriteFlusher.This is not a behavior change — the 64 KiB buffer is observable from the public
mobysource. The PR is documentation catching up to existing behavior.How
Who's affected
Plugin authors and operations teams running authorization plugins that depend on `ResponseBody` for security decisions on large or streaming responses. For redaction-style plugins, the new section recommends performing filtering in a separate layer in front of the daemon when the endpoint is likely to exceed 64 KiB or stream chunked output.
Verification
The numbers and behaviors described in the new subsection were derived directly from a read of `pkg/authorization/response.go` at moby `master`: