diff --git a/src/main/java/store/mybooks/front/auth/adaptor/TokenAdaptor.java b/src/main/java/store/mybooks/front/auth/adaptor/TokenAdaptor.java index ff5ec41c..37d683de 100644 --- a/src/main/java/store/mybooks/front/auth/adaptor/TokenAdaptor.java +++ b/src/main/java/store/mybooks/front/auth/adaptor/TokenAdaptor.java @@ -35,6 +35,14 @@ public class TokenAdaptor { private final GatewayAdaptorProperties gatewayAdaptorProperties; + /** + * methodName : createToken + * author : masiljangajji + * description : jwt 생성요청을 보냄 + * + * @param tokenCreateRequest 유저의 정보를 담은 dto , 이것을 기반으로 JWT 생성 + * @return token create response + */ public TokenCreateResponse createToken(TokenCreateRequest tokenCreateRequest) { ResponseEntity responseEntity = @@ -50,6 +58,14 @@ public TokenCreateResponse createToken(TokenCreateRequest tokenCreateRequest) { return responseEntity.getBody(); } + /** + * methodName : refreshAccessToken + * author : masiljangajji + * description : 엑세스토큰 재발급 요청을 보냄 + * + * @param refreshTokenRequest accessToken , ip , X-User-Agent 정보 + * @return refresh token response + */ public RefreshTokenResponse refreshAccessToken(RefreshTokenRequest refreshTokenRequest) { ResponseEntity responseEntity = @@ -65,6 +81,13 @@ public RefreshTokenResponse refreshAccessToken(RefreshTokenRequest refreshTokenR return responseEntity.getBody(); } + /** + * methodName : deleteRefreshToken + * author : masiljangajji + * description : 로그아웃시 리프래시토큰 삭제 요청을 보냄 + * + * @param logoutRequest 엑세스토큰 , ip , X-User-Agent + */ public void deleteRefreshToken(LogoutRequest logoutRequest){ ResponseEntity responseEntity = diff --git a/src/main/java/store/mybooks/front/auth/aop/AdminCookieAspect.java b/src/main/java/store/mybooks/front/auth/aop/AdminCookieAspect.java index 19e26b80..175a6497 100644 --- a/src/main/java/store/mybooks/front/auth/aop/AdminCookieAspect.java +++ b/src/main/java/store/mybooks/front/auth/aop/AdminCookieAspect.java @@ -21,6 +21,11 @@ public class AdminCookieAspect { private final RedisAuthService redisAuthService; + /** + * methodName : beforeMethod + * author : masiljangajji + * description : 어드민 페이지에 접근시 RequiredAdminCookie 어노테이션이 있는 경우 , adminCookie 를 확인 및 검증하는 인가처리 + */ @Before("@annotation(store.mybooks.front.auth.Annotation.RequiredAdminCookie)") public void beforeMethod() { HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull( diff --git a/src/main/java/store/mybooks/front/auth/aop/AuthorizationAspect.java b/src/main/java/store/mybooks/front/auth/aop/AuthorizationAspect.java index a3d2a77e..e4c041cf 100644 --- a/src/main/java/store/mybooks/front/auth/aop/AuthorizationAspect.java +++ b/src/main/java/store/mybooks/front/auth/aop/AuthorizationAspect.java @@ -49,6 +49,19 @@ public class AuthorizationAspect { private final RedisProperties redisProperties; + /** + * methodName : aroundMethod + * author : masiljangajji + * description : RequiredAuthorization 어노테이션이 걸려있는 경우 , 회원의 인가처리가 필요하다는 것을 의미 + * identity-cookie 라는 이름의 쿠키에 JWT 를 담고 있기 떄문에 Header 에 토큰으 담아서 gateway 로 보냄 + * gateway 에서 토큰 검증 및 유저 검증 인가처리에 문제가 없을 시 그대로 return + * Exception 이 발생한다면 (토큰 검증 실패 , 토큰만료 , 일반 유저가 어드민이 사용하는 기능접근 ,유저 휴면상태 , 유저 잠금상태) ErrorMessage 를 이용해 + * 각각의 상황에 맞는 처리를 함 + * + * @param joinPoint point + * @return object + * @throws Throwable the throwable + */ @Around(value = "@annotation(store.mybooks.front.auth.Annotation.RequiredAuthorization)") public Object aroundMethod(ProceedingJoinPoint joinPoint) throws Throwable { diff --git a/src/main/java/store/mybooks/front/auth/interceptor/LogoutInterceptor.java b/src/main/java/store/mybooks/front/auth/interceptor/LogoutInterceptor.java index 8b545bf7..b07f1489 100644 --- a/src/main/java/store/mybooks/front/auth/interceptor/LogoutInterceptor.java +++ b/src/main/java/store/mybooks/front/auth/interceptor/LogoutInterceptor.java @@ -46,12 +46,12 @@ public void postHandle(HttpServletRequest request, HttpServletResponse response, // UUID - UserId 담은 redis 삭제 및 admin 쿠키 삭제 if (Objects.nonNull(request.getAttribute("admin_cookie_value"))) { - log.warn("어드민쿠키 삭제 시작 "); + log.debug("어드민쿠키 삭제 시작 "); RedisAuthService redisAuthService = context.getBean(RedisAuthService.class); redisAuthService.deleteValues((String) request.getAttribute("admin_cookie_value")); - log.warn("레디스 삭제"); + log.debug("레디스 삭제"); CookieUtils.deleteAdminCookie(response); - log.warn("어드민쿠키 삭제 완료"); + log.debug("어드민쿠키 삭제 완료"); }