Skip to content

Comments

WW-5514 Add StrutsProxyService for proxy detection and resolution#1586

Merged
lukaszlenart merged 3 commits intomainfrom
feat/WW-5514-proxy-service
Feb 21, 2026
Merged

WW-5514 Add StrutsProxyService for proxy detection and resolution#1586
lukaszlenart merged 3 commits intomainfrom
feat/WW-5514-proxy-service

Conversation

@lukaszlenart
Copy link
Member

@lukaszlenart lukaszlenart commented Feb 20, 2026

Summary

Introduces a configurable ProxyService interface and StrutsProxyService implementation for detecting and resolving Spring AOP/Hibernate proxies.

Fixes WW-5514

Key Changes

  • ProxyService interface with isProxy, ultimateTargetClass, and resolveTargetMember methods
  • StrutsProxyService implementation using configurable caches
  • ProxyCacheFactory and StrutsProxyCacheFactory for cache management
  • Integration into ChainingInterceptor, ParametersInterceptor, and SecurityMemberAccess
  • Integration test with Spring AOP proxied action chaining
  • Configuration constants for proxy cache type and size

Proxy Types Supported

  • Spring CGLIB proxies (class-based)
  • Spring JDK dynamic proxies (interface-based)
  • Hibernate entity proxies
  • Member resolution for allowlist checking

Configuration

New properties in default.properties:

struts.proxy.cacheType=basic
struts.proxy.cacheMaxSize=10000
struts.proxy.cacheFactory=struts
struts.proxyService=struts

Test Plan

  • Unit tests for StrutsProxyService
  • Unit tests for StrutsProxyCacheFactory
  • Unit tests for SecurityMemberAccessProxyTest
  • Integration test SpringProxyActionChainingTest
  • Manual testing with Spring AOP proxied actions

🤖 Generated with Claude Code

lukaszlenart and others added 2 commits February 20, 2026 07:33
…esolution

Introduces a configurable ProxyService interface and StrutsProxyService
implementation for detecting and resolving Spring AOP/Hibernate proxies.

Key changes:
- Add ProxyService interface with isProxy, ultimateTargetClass, and
  resolveTargetMember methods
- Add StrutsProxyService implementation using configurable caches
- Add ProxyCacheFactory and StrutsProxyCacheFactory for cache management
- Integrate ProxyService into ChainingInterceptor, ParametersInterceptor,
  and SecurityMemberAccess
- Add integration test with Spring AOP proxied action chaining
- Add configuration constants for proxy cache type and size

The StrutsProxyService correctly handles:
- Spring CGLIB proxies (class-based)
- Spring JDK dynamic proxies (interface-based)
- Hibernate entity proxies
- Member resolution for allowlist checking

Fixes WW-5514

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…oxies

Add integration tests to SpringProxyUtilTest that verify the new
ProxyService works correctly with real Spring AOP proxies, alongside
the existing deprecated ProxyUtil tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Member

@kusalk kusalk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid, nice work

Although looks like we've accidentally reintroduced the memory leak, let's remove that. And a couple other minor comments

Remove targetClassCache from StrutsProxyService to avoid memory leak
(object-keyed cache reintroduced from PR #1578). Change default proxy
cache type to wtlfu to align with all other caches. Switch deprecated
ProxyUtil static caches to BASIC to remove hard Caffeine dependency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
72.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@lukaszlenart lukaszlenart requested a review from kusalk February 21, 2026 08:32
@lukaszlenart lukaszlenart merged commit ca740ed into main Feb 21, 2026
9 of 10 checks passed
@lukaszlenart lukaszlenart deleted the feat/WW-5514-proxy-service branch February 21, 2026 17:18
@lukaszlenart lukaszlenart added this to the 7.2.0 milestone Feb 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants