Skip to content

AbstractAdvisorAutoProxyCreator should consistently detect package-visible methods [SPR-14174] #17890

@spring-projects-issues

Description

@spring-projects-issues

Rob Winch opened SPR-14174 and commented

It would be nice if Spring's AbstractAdvisorAutoProxyCreator would support package scope methods. This has become increasingly important for Boot style applications which often use default methods. For example, the controller below is not secured due to the fact that package scope method is used:

@RestController
public class AdminController {

	@PreAuthorize("hasRole('ADMIN')")
	@RequestMapping("/admin/")
	String index() {
		return "Admin";
	}
}

Right now this appears to be blocked by the fact that AopUtils.canApply only checks public methods since it uses methods = clazz.getMethods()


Referenced from: commits 9991122

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions