shreemaan-abhishek opened a new pull request, #13705:
URL: https://github.com/apache/apisix/pull/13705

   ### Description
   
   Several plugins read the request or response body fully into worker memory 
without a plugin-local size limit, relying entirely on the gateway-wide 
`client_max_body_size` (which defaults to `0`, i.e. unlimited). This adds an 
explicit, configurable bound to those plugins, matching the `max_req_body_size` 
field already present in `forward-auth` and `hmac-auth`.
   
   - **`max_req_body_size`** (default `64MiB`) added to plugins that buffer the 
request body: `request-validation`, `oas-validator`, `authz-keycloak`, 
`degraphql`, `grpc-web`, `cas-auth`, `openwhisk`, `http-dubbo`, the serverless 
plugins (`aws-lambda`, `azure-functions`, `openfunction`), `body-transformer`, 
and the AI plugins `ai-prompt-guard`, `ai-prompt-decorator`, 
`ai-prompt-template`, `ai-request-rewrite`. Requests whose body exceeds the 
limit are rejected.
   - **`max_resp_body_size`** (default `64MiB`) added to plugins that buffer 
the response body: `response-rewrite`, `body-transformer`, `proxy-cache` 
(memory strategy), `grpc-transcode`. Larger responses are truncated; 
`proxy-cache` streams them through uncached to avoid caching a truncated body.
   
   Both fields reuse the existing `core.request.get_body(max_size)` / 
`core.response.hold_body_chunk(..., max_resp_body_bytes)` primitives.
   
   #### Which issue(s) this PR fixes:
   Fixes #
   
   ### Checklist
   
   - [x] I have explained the need for this PR and the problem it solves
   - [x] I have explained the changes or the new features added to this PR
   - [x] I have added tests corresponding to this change
   - [x] I have updated the documentation to reflect this change
   - [x] I have verified that this change is backward compatible
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to