oscerd opened a new pull request, #28351: URL: https://github.com/apache/camel/pull/28351
Jira: https://issues.apache.org/jira/browse/CAMEL-26068 ### Problem In `NettyHttpComponent.createEndpoint(...)` (camel-netty-http), when `NettyHttpSecurityConfiguration` is configured on the component, endpoints receive the shared component-level instance directly without copying. When an endpoint specifies `securityConfiguration.*` URI parameters, `setProperties(securityConfiguration, securityOptions)` modifies the shared instance held by the endpoint in place. As a result, modifying `securityConfiguration` parameters on one endpoint mutates the component's shared configuration, affecting other endpoints that use the component configuration. ### Change - `org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration`: Implement `Cloneable` and provide a `copy()` method. - `org.apache.camel.component.netty.http.NettyHttpComponent`: In `createEndpoint(...)`, assign `securityConfiguration.copy()` so that each endpoint receives an independent copy of the configuration before applying URI-level `securityOptions`. - Upgrade guide 4.24: Added a note documenting that `NettyHttpSecurityConfiguration` is now copied per endpoint. ### Tests - Added `NettyHttpSharedSecurityConfigurationTest` in `camel-netty-http` to test: - Setting component-level `NettyHttpSecurityConfiguration` and creating an endpoint with `securityConfiguration.authenticate=false` does not mutate the component or sibling endpoints. - Endpoints receive independent configuration instances. - Authentication is enforced on endpoints expecting authentication (returns 401 unauthenticated, 200 authenticated) while exempted endpoints allow unauthenticated access (200). - All 32 security auth tests in `camel-netty-http` pass cleanly. _Claude Code on behalf of oscerd_ 🤖 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]
