spring-projects / spring-projects/spring-security
RunAsManager replacement
@jzheaux is already working on this.
Since Jun 3, 2022.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
RunAsManager can add to or change the existing authentication for the duration of a message, a request, or a method call.
It overloads the authority string to include instructions to Spring Security as to what authorities to temporarily grant. It is primarily designed to work with the @Secured annotation and with the access XML attribute when not using expressions.
As a first step to supporting this with the authorization manager API, we should:
-
ImproveAuthorizationFilterParserto supportuse-expressions="false" -
ImproveAuthorizationFilterParserto adapt theSupplier<Authentication>forRUN_ASattributes -
Improve@Securedmethod handling to adapt theSupplier<Authentication>forRUN_ASattributes
UPDATE: Let's wait on these subtasks. This isn't the way that we want to do impersonation and privilege escalation going forward, and so I don't really want to support a legacy way in a new API. I'll leave this ticket open for investigating what this support should look like going forward.
It's worth considering whether a new contract is needed like Supplier<Authentication> adapt(Supplier<Authentication> authentication, T context) that can be supplied to alter how the adaptation is performed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.