mirror of https://gitee.com/stylefeng/roses
【auth】整理auth模块
parent
99ec83f9d9
commit
478bbf6959
|
@ -62,18 +62,18 @@
|
|||
<!--缓存的依赖-->
|
||||
<!--session manager可以用redis,可以用内存的-->
|
||||
<dependency>
|
||||
<groupId>com.sedinbj.kernel</groupId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>cache-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sedinbj.kernel</groupId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>cache-sdk-memory</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sedinbj.kernel</groupId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>cache-sdk-redis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>provided</scope>
|
||||
|
|
|
@ -2,7 +2,7 @@ package cn.stylefeng.roses.kernel.auth.session;
|
|||
|
||||
import cn.stylefeng.roses.kernel.auth.api.SessionManagerApi;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||
import com.sedinbj.kernel.cache.api.CacheOperatorApi;
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.stylefeng.roses.kernel.auth.session.cache.logintoken;
|
||||
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import com.sedinbj.kernel.cache.AbstractMemoryCacheOperator;
|
||||
import cn.stylefeng.roses.kernel.cache.AbstractMemoryCacheOperator;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package cn.stylefeng.roses.kernel.auth.session.cache.logintoken;
|
||||
|
||||
import com.sedinbj.kernel.cache.AbstractRedisCacheOperator;
|
||||
import cn.stylefeng.roses.kernel.cache.AbstractRedisCacheOperator;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
import java.util.Set;
|
||||
|
|
|
@ -2,7 +2,7 @@ package cn.stylefeng.roses.kernel.auth.session.cache.loginuser;
|
|||
|
||||
import cn.hutool.cache.impl.TimedCache;
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||
import com.sedinbj.kernel.cache.AbstractMemoryCacheOperator;
|
||||
import cn.stylefeng.roses.kernel.cache.AbstractMemoryCacheOperator;
|
||||
|
||||
import static cn.stylefeng.roses.kernel.auth.api.constants.AuthConstants.LOGGED_TOKEN_PREFIX;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package cn.stylefeng.roses.kernel.auth.session.cache.loginuser;
|
||||
|
||||
import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser;
|
||||
import com.sedinbj.kernel.cache.AbstractRedisCacheOperator;
|
||||
import cn.stylefeng.roses.kernel.cache.AbstractRedisCacheOperator;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
|
||||
import static cn.stylefeng.roses.kernel.auth.api.constants.AuthConstants.LOGGED_TOKEN_PREFIX;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<!--默认使用内存-->
|
||||
<dependency>
|
||||
<groupId>com.sedinbj.kernel</groupId>
|
||||
<groupId>cn.stylefeng.roses</groupId>
|
||||
<artifactId>cache-sdk-memory</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
|
|
|
@ -12,13 +12,13 @@ import cn.stylefeng.roses.kernel.auth.password.RsaPasswordTransferEncrypt;
|
|||
import cn.stylefeng.roses.kernel.auth.session.DefaultSessionManager;
|
||||
import cn.stylefeng.roses.kernel.auth.session.cache.logintoken.MemoryLoginTokenCache;
|
||||
import cn.stylefeng.roses.kernel.auth.session.cache.loginuser.MemoryLoginUserCache;
|
||||
import cn.stylefeng.roses.kernel.cache.api.constants.CacheConstants;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import static com.sedinbj.kernel.cache.api.constants.CacheConstants.NONE_EXPIRED_TIME;
|
||||
|
||||
/**
|
||||
* 认证和鉴权模块的自动配置
|
||||
|
@ -67,7 +67,7 @@ public class GunsAuthAutoConfiguration {
|
|||
Long sessionExpiredSeconds = AuthConfigExpander.getSessionExpiredSeconds();
|
||||
|
||||
TimedCache<String, LoginUser> loginUsers = CacheUtil.newTimedCache(1000L * sessionExpiredSeconds);
|
||||
TimedCache<String, Set<String>> loginTokens = CacheUtil.newTimedCache(NONE_EXPIRED_TIME);
|
||||
TimedCache<String, Set<String>> loginTokens = CacheUtil.newTimedCache(CacheConstants.NONE_EXPIRED_TIME);
|
||||
|
||||
MemoryLoginUserCache memoryLoginUserCache = new MemoryLoginUserCache(loginUsers);
|
||||
MemoryLoginTokenCache memoryLoginTokenCache = new MemoryLoginTokenCache(loginTokens);
|
||||
|
|
Loading…
Reference in New Issue