From 32c31c775c79e086d22b667ff8002b475ef47c80 Mon Sep 17 00:00:00 2001 From: kssumin <201566@jnu.ac.kr> Date: Wed, 11 Oct 2023 02:15:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?chore=20:=20directory=20=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../overflow/auth/domain/service/CreateTokenService.java | 4 ++-- .../overflow/auth/domain/usecase/ReissueUseCase.java | 2 +- .../overflow/auth/web/controller/AuthInterceptor.java | 2 +- .../web/support/AuthenticationPrincipalArgumentResolver.java | 2 +- .../java/com/econovation/overflow/config/WebMvcConfig.java | 2 +- .../{security/exception => support/token}/NotValidToken.java | 2 +- .../overflow/{security => support}/token/TokenProvider.java | 3 +-- .../overflow/{security => support}/token/TokenResolver.java | 4 +--- .../overflow/{security => support}/token/TokenValidator.java | 2 +- .../{security => support}/token/TokenProviderTest.java | 2 +- .../{security => support}/token/TokenResolverTest.java | 3 +-- 11 files changed, 12 insertions(+), 16 deletions(-) rename be/overflow/src/main/java/com/econovation/overflow/{security/exception => support/token}/NotValidToken.java (82%) rename be/overflow/src/main/java/com/econovation/overflow/{security => support}/token/TokenProvider.java (93%) rename be/overflow/src/main/java/com/econovation/overflow/{security => support}/token/TokenResolver.java (91%) rename be/overflow/src/main/java/com/econovation/overflow/{security => support}/token/TokenValidator.java (91%) rename be/overflow/src/test/java/com/econovation/overflow/{security => support}/token/TokenProviderTest.java (95%) rename be/overflow/src/test/java/com/econovation/overflow/{security => support}/token/TokenResolverTest.java (93%) diff --git a/be/overflow/src/main/java/com/econovation/overflow/auth/domain/service/CreateTokenService.java b/be/overflow/src/main/java/com/econovation/overflow/auth/domain/service/CreateTokenService.java index 113bae0..fff44c6 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/auth/domain/service/CreateTokenService.java +++ b/be/overflow/src/main/java/com/econovation/overflow/auth/domain/service/CreateTokenService.java @@ -5,8 +5,8 @@ import com.econovation.overflow.auth.persistence.converter.AuthInfoEntityConverter; import com.econovation.overflow.auth.persistence.entity.AuthInfoEntity; import com.econovation.overflow.auth.persistence.repository.AuthInfoRepository; -import com.econovation.overflow.security.token.TokenProvider; -import com.econovation.overflow.security.token.TokenResolver; +import com.econovation.overflow.support.token.TokenProvider; +import com.econovation.overflow.support.token.TokenResolver; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; diff --git a/be/overflow/src/main/java/com/econovation/overflow/auth/domain/usecase/ReissueUseCase.java b/be/overflow/src/main/java/com/econovation/overflow/auth/domain/usecase/ReissueUseCase.java index f02a07f..5c867a9 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/auth/domain/usecase/ReissueUseCase.java +++ b/be/overflow/src/main/java/com/econovation/overflow/auth/domain/usecase/ReissueUseCase.java @@ -5,7 +5,7 @@ import com.econovation.overflow.auth.domain.service.CreateTokenService; import com.econovation.overflow.auth.persistence.entity.AuthInfoEntity; import com.econovation.overflow.auth.persistence.repository.AuthInfoRepository; -import com.econovation.overflow.security.token.TokenResolver; +import com.econovation.overflow.support.token.TokenResolver; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; diff --git a/be/overflow/src/main/java/com/econovation/overflow/auth/web/controller/AuthInterceptor.java b/be/overflow/src/main/java/com/econovation/overflow/auth/web/controller/AuthInterceptor.java index e5b9fa3..c81ff96 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/auth/web/controller/AuthInterceptor.java +++ b/be/overflow/src/main/java/com/econovation/overflow/auth/web/controller/AuthInterceptor.java @@ -1,7 +1,7 @@ package com.econovation.overflow.auth.web.controller; import com.econovation.overflow.auth.web.support.AuthorizationExtractor; -import com.econovation.overflow.security.token.TokenValidator; +import com.econovation.overflow.support.token.TokenValidator; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; diff --git a/be/overflow/src/main/java/com/econovation/overflow/auth/web/support/AuthenticationPrincipalArgumentResolver.java b/be/overflow/src/main/java/com/econovation/overflow/auth/web/support/AuthenticationPrincipalArgumentResolver.java index 1cc1970..0e5a77a 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/auth/web/support/AuthenticationPrincipalArgumentResolver.java +++ b/be/overflow/src/main/java/com/econovation/overflow/auth/web/support/AuthenticationPrincipalArgumentResolver.java @@ -1,6 +1,6 @@ package com.econovation.overflow.auth.web.support; -import com.econovation.overflow.security.token.TokenResolver; +import com.econovation.overflow.support.token.TokenResolver; import java.util.Objects; import javax.servlet.http.HttpServletRequest; import lombok.RequiredArgsConstructor; diff --git a/be/overflow/src/main/java/com/econovation/overflow/config/WebMvcConfig.java b/be/overflow/src/main/java/com/econovation/overflow/config/WebMvcConfig.java index 639eb9c..382238e 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/config/WebMvcConfig.java +++ b/be/overflow/src/main/java/com/econovation/overflow/config/WebMvcConfig.java @@ -2,7 +2,7 @@ import com.econovation.overflow.auth.web.controller.AuthInterceptor; import com.econovation.overflow.auth.web.support.AuthenticationPrincipalArgumentResolver; -import com.econovation.overflow.security.token.TokenResolver; +import com.econovation.overflow.support.token.TokenResolver; import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.context.annotation.Bean; diff --git a/be/overflow/src/main/java/com/econovation/overflow/security/exception/NotValidToken.java b/be/overflow/src/main/java/com/econovation/overflow/support/token/NotValidToken.java similarity index 82% rename from be/overflow/src/main/java/com/econovation/overflow/security/exception/NotValidToken.java rename to be/overflow/src/main/java/com/econovation/overflow/support/token/NotValidToken.java index 05da10b..ae8d059 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/security/exception/NotValidToken.java +++ b/be/overflow/src/main/java/com/econovation/overflow/support/token/NotValidToken.java @@ -1,4 +1,4 @@ -package com.econovation.overflow.security.exception; +package com.econovation.overflow.support.token; import com.econovation.overflow.common.exception.BusinessException; import org.springframework.http.HttpStatus; diff --git a/be/overflow/src/main/java/com/econovation/overflow/security/token/TokenProvider.java b/be/overflow/src/main/java/com/econovation/overflow/support/token/TokenProvider.java similarity index 93% rename from be/overflow/src/main/java/com/econovation/overflow/security/token/TokenProvider.java rename to be/overflow/src/main/java/com/econovation/overflow/support/token/TokenProvider.java index 0639cf4..e98ceb6 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/security/token/TokenProvider.java +++ b/be/overflow/src/main/java/com/econovation/overflow/support/token/TokenProvider.java @@ -1,4 +1,4 @@ -package com.econovation.overflow.security.token; +package com.econovation.overflow.support.token; import io.jsonwebtoken.Header; import io.jsonwebtoken.Jwts; @@ -13,7 +13,6 @@ public class TokenProvider { private static final String USER_ID_CLAIM_KEY = "userId"; - private static final String USER_ROLE_CLAIM_KEY = "memberRole"; private final SecretKey secretKey; private final long accessValidTime; diff --git a/be/overflow/src/main/java/com/econovation/overflow/security/token/TokenResolver.java b/be/overflow/src/main/java/com/econovation/overflow/support/token/TokenResolver.java similarity index 91% rename from be/overflow/src/main/java/com/econovation/overflow/security/token/TokenResolver.java rename to be/overflow/src/main/java/com/econovation/overflow/support/token/TokenResolver.java index 94f184f..a142c78 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/security/token/TokenResolver.java +++ b/be/overflow/src/main/java/com/econovation/overflow/support/token/TokenResolver.java @@ -1,6 +1,5 @@ -package com.econovation.overflow.security.token; +package com.econovation.overflow.support.token; -import com.econovation.overflow.security.exception.NotValidToken; import io.jsonwebtoken.Claims; import io.jsonwebtoken.ExpiredJwtException; import io.jsonwebtoken.Jwts; @@ -11,7 +10,6 @@ import javax.crypto.SecretKey; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; - @Component public class TokenResolver { diff --git a/be/overflow/src/main/java/com/econovation/overflow/security/token/TokenValidator.java b/be/overflow/src/main/java/com/econovation/overflow/support/token/TokenValidator.java similarity index 91% rename from be/overflow/src/main/java/com/econovation/overflow/security/token/TokenValidator.java rename to be/overflow/src/main/java/com/econovation/overflow/support/token/TokenValidator.java index 44852bc..b5a1e81 100644 --- a/be/overflow/src/main/java/com/econovation/overflow/security/token/TokenValidator.java +++ b/be/overflow/src/main/java/com/econovation/overflow/support/token/TokenValidator.java @@ -1,4 +1,4 @@ -package com.econovation.overflow.security.token; +package com.econovation.overflow.support.token; import com.econovation.overflow.auth.domain.exception.AuthorizationException; import java.util.Date; diff --git a/be/overflow/src/test/java/com/econovation/overflow/security/token/TokenProviderTest.java b/be/overflow/src/test/java/com/econovation/overflow/support/token/TokenProviderTest.java similarity index 95% rename from be/overflow/src/test/java/com/econovation/overflow/security/token/TokenProviderTest.java rename to be/overflow/src/test/java/com/econovation/overflow/support/token/TokenProviderTest.java index a3a4086..9ef5b37 100644 --- a/be/overflow/src/test/java/com/econovation/overflow/security/token/TokenProviderTest.java +++ b/be/overflow/src/test/java/com/econovation/overflow/support/token/TokenProviderTest.java @@ -1,4 +1,4 @@ -package com.econovation.overflow.security.token; +package com.econovation.overflow.support.token; import static org.assertj.core.api.Assertions.assertThat; diff --git a/be/overflow/src/test/java/com/econovation/overflow/security/token/TokenResolverTest.java b/be/overflow/src/test/java/com/econovation/overflow/support/token/TokenResolverTest.java similarity index 93% rename from be/overflow/src/test/java/com/econovation/overflow/security/token/TokenResolverTest.java rename to be/overflow/src/test/java/com/econovation/overflow/support/token/TokenResolverTest.java index 212f8a5..f74fc13 100644 --- a/be/overflow/src/test/java/com/econovation/overflow/security/token/TokenResolverTest.java +++ b/be/overflow/src/test/java/com/econovation/overflow/support/token/TokenResolverTest.java @@ -1,9 +1,8 @@ -package com.econovation.overflow.security.token; +package com.econovation.overflow.support.token; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import com.econovation.overflow.security.exception.NotValidToken; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; From 716544bf1c6b32a388f5d616d964c395103b4f30 Mon Sep 17 00:00:00 2001 From: kssumin <201566@jnu.ac.kr> Date: Wed, 11 Oct 2023 02:16:25 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix=20:=20dev=20=ED=99=98=EA=B2=BD=EC=97=90?= =?UTF-8?q?=EC=84=9C=20validTime=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/overflow/src/main/resources/application-dev-security.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/be/overflow/src/main/resources/application-dev-security.yml b/be/overflow/src/main/resources/application-dev-security.yml index 81d6f7f..668e515 100644 --- a/be/overflow/src/main/resources/application-dev-security.yml +++ b/be/overflow/src/main/resources/application-dev-security.yml @@ -8,7 +8,7 @@ security: token: secretKey: asccesssecretkeyoverflowsecrekey access: - validTime: 1800 + validTime: 1800000 refresh: - validTime : 3600 + validTime: 3600000