-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Closed
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-coretype: enhancementA general enhancementA general enhancement
Description
We should add an AuthorizationManager which is an imperative version of ReactiveAuthorizationManager. The class should look something like:
public interface AuthorizationManager<T> {
AuthorizationDecision check(Supplier<Authentication> authentication, T object);
default void verify(Supplier<Authentication> authentication, T object) {
AuthorizationDecision decision = check(authentication, object);
if (!decision.isGranted()) {
throw new AccessDeniedException("Access Denied");
}
}
}Using something that allows delaying looking up the Authentication like Supplier<Authentication> vs an Authentication directly.
We should also add support for AuthorizationManager in HttpSecurity.authorizeRequests().
Finally, we should change around the existing classes that use AccessDecisionManager should migrate to AuthorizationManager and AccessDecisionManager should be marked as deprecated.
simon-an, evgeniycheban and ferminwang
Metadata
Metadata
Assignees
Labels
in: coreAn issue in spring-security-coreAn issue in spring-security-coretype: enhancementA general enhancementA general enhancement