Add primary annotation for redis beans in order to have priority in case of both redis and stateless configuration.

This commit is contained in:
Konstantinos Triantafyllou 2024-10-16 23:25:49 +03:00
parent 932c926f97
commit 5e6f01c9a1
2 changed files with 4 additions and 0 deletions

View File

@ -3,11 +3,13 @@ package eu.dnetlib.uoaauthorizationlibrary.authorization.redis;
import eu.dnetlib.uoaauthorizationlibrary.authorization.configuration.Redis;
import eu.dnetlib.uoaauthorizationlibrary.authorization.configuration.SecurityProperties;
import eu.dnetlib.uoaauthorizationlibrary.authorization.security.CheckProperties;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
@Primary
public class RedisCheckProperties implements CheckProperties {
@Override

View File

@ -4,11 +4,13 @@ import eu.dnetlib.uoaauthorizationlibrary.authorization.security.AuthorizationSe
import eu.dnetlib.uoaauthorizationlibrary.authorization.security.EntryPoint;
import eu.dnetlib.uoaauthorizationlibrary.authorization.security.SecurityMode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.stereotype.Component;
@Component
@Primary
public class RedisSecurityMode implements SecurityMode {
private final EntryPoint entryPoint;