Skip to content

Commit

Permalink
chore: 객체 네이밍 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
BGuga committed Nov 23, 2023
1 parent c448a68 commit 1da5b03
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
import org.springframework.web.servlet.HandlerInterceptor;
import wooteco.prolog.login.application.AuthorizationExtractor;
import wooteco.prolog.login.application.GithubLoginService;
import wooteco.support.autoceptor.LoginDetector;
import wooteco.support.autoceptor.AuthenticationDetector;

@AllArgsConstructor
public class LoginInterceptor implements HandlerInterceptor {

private final GithubLoginService githubLoginService;
private final LoginDetector loginDetector;
private final AuthenticationDetector authenticationDetector;

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
if (!loginDetector.requireLogin(request)) {
if (!authenticationDetector.requireLogin(request)) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.springframework.http.HttpMethod;

@RequiredArgsConstructor
public class LoginDetector {
public class AuthenticationDetector {

private static final String ORIGIN = "Origin";
private static final String ACCESS_REQUEST_METHOD = "Access-Control-Request-Method";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public List<String> extractPatterns() {
return uriScanner.extractUri();
}

public LoginDetector extractLoginDetector() {
public AuthenticationDetector extractLoginDetector() {
return uriScanner.extractLoginDetector();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import java.util.stream.Stream;
import org.springframework.http.HttpMethod;
import org.springframework.util.StringUtils;
import wooteco.support.autoceptor.LoginDetector;
import wooteco.support.autoceptor.AuthenticationDetector;
import wooteco.support.autoceptor.MethodPattern;

public class URIScanner {
Expand Down Expand Up @@ -87,7 +87,7 @@ private String createUri(String controllerUri, String methodUri) {

}

public LoginDetector extractLoginDetector() {
public AuthenticationDetector extractLoginDetector() {
List<Class<?>> controllers = controllerScanner.extractControllers();
List<MethodPattern> requireLoginMethods = new ArrayList<>();

Expand All @@ -97,7 +97,7 @@ public LoginDetector extractLoginDetector() {
requireLoginMethods.addAll(extractRequireLogin(controllerUris, methods));
}

return new LoginDetector(requireLoginMethods);
return new AuthenticationDetector(requireLoginMethods);
}

private List<MethodPattern> extractRequireLogin(List<String> controllerUris,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.assertj.core.api.ArraySortedAssert;
import org.assertj.core.api.Assertions;
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpMethod;
import wooteco.prolog.login.domain.AuthMemberPrincipal;
Expand Down Expand Up @@ -56,7 +53,7 @@ void extractLoginDetector() {
);

// when
LoginDetector detector = uriScanner.extractLoginDetector();
AuthenticationDetector detector = uriScanner.extractLoginDetector();

// then
assertThat(detector).extracting("requireLoginPatterns").usingRecursiveComparison()
Expand Down

0 comments on commit 1da5b03

Please sign in to comment.