lukaszlenart opened a new pull request, #1948:
URL: https://github.com/apache/struts/pull/1948

   Fixes [WW-5720](https://issues.apache.org/jira/browse/WW-5720)
   
   With `struts.rest.anySetter.requireAnnotations` enabled, 
`AuthorizingSettableAnyProperty` wrote one WARN per rejected dynamic key. An 
any-setter's key space is the request body, so a body with ten thousand unknown 
keys wrote ten thousand WARN lines.
   
   **Change**
   
   - New request-scoped `DynamicKeyRejections` tallies rejections per 
any-setter (`Class#member`, or `Class#creator[n]` for a creator parameter) and 
reason.
   - Per-key detail moves to DEBUG; one WARN per any-setter and reason is 
written when `ParameterAuthorizingModule.clearRequestState()` runs — both 
Jackson handlers already call it in a `finally`, and `ContentTypeInterceptor` 
once more after unbinding, where the second call is a no-op.
   - The four reasons (missing consent, creator-parameter form, depth exceeded, 
property name unavailable) keep distinct wording, since they point at different 
fixes on the application side.
   - Rejection itself is unchanged: `redactAndSkip` still runs on every path.
   
   The tally is its own holder rather than part of 
`DynamicKeyAuthorizationContext`, which is the nested-scope depth stack pushed 
and popped per accepted key; the tally is per request and flushed at a 
different point. It is keyed by the class model and a four-value enum, so its 
size does not depend on the body.
   
   **Tests**
   
   `ParameterAuthorizingModuleTest` captures the `DynamicKeyRejections` logger: 
zero WARNs during the read and exactly one after the clear with the count and 
sink; a second clear logs nothing; distinct summaries per reason and per sink; 
the creator-parameter label.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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