Skip to content

Commit

Permalink
Merge branch 'main' into fix/#455
Browse files Browse the repository at this point in the history
  • Loading branch information
ukkodeveloper authored Sep 27, 2023
2 parents b93f92d + 731c673 commit ccd5c85
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public TokenPair oAuthLogin(final String oauthType, final String authorizationCo
return new TokenPair(accessToken, refreshToken);
}

public ReissueAccessTokenResponse reissueAccessTokenByRefreshToken(final String refreshToken, final String accessToken) {
public ReissueAccessTokenResponse reissueAccessTokenByRefreshToken(final String refreshToken,
final String accessToken) {
final Claims claims = tokenProvider.parseClaims(refreshToken);
final Long memberId = claims.get("memberId", Long.class);
final String nickname = claims.get("nickname", String.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public class KakaoInfoProvider implements OAuthInfoProvider {
private static final String TOKEN_PREFIX = "Bearer ";
private static final String GRANT_TYPE = "authorization_code";


@Value("${oauth2.kakao.access-token-url}")
private String KAKAO_ACCESS_TOKEN_URL;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package shook.shook.auth.application.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/java/shook/shook/auth/config/AuthConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class AuthConfig implements WebMvcConfigurer {
private final TokenInterceptor tokenInterceptor;

public AuthConfig(final AuthArgumentResolver authArgumentResolver,
final LoginCheckerInterceptor loginCheckerInterceptor,
final TokenInterceptor tokenInterceptor
final LoginCheckerInterceptor loginCheckerInterceptor,
final TokenInterceptor tokenInterceptor
) {
this.authArgumentResolver = authArgumentResolver;
this.loginCheckerInterceptor = loginCheckerInterceptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ public LoginCheckerInterceptor(
}

@Override
public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response,
final Object handler) throws Exception {
public boolean preHandle(final HttpServletRequest request,
final HttpServletResponse response,
final Object handler) throws Exception {
if (TokenHeaderExtractor.extractToken(request).isEmpty()) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,23 @@ public PathMatcherInterceptor(final HandlerInterceptor handlerInterceptor) {
}

@Override
public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response,
final Object handler) throws Exception {
public boolean preHandle(final HttpServletRequest request,
final HttpServletResponse response,
final Object handler) throws Exception {
if (pathContainer.isNotIncludedPath(request.getServletPath(), request.getMethod())) {
return true;
}
return handlerInterceptor.preHandle(request, response, handler);
}

public PathMatcherInterceptor includePathPattern(final String requestPathPattern,
final PathMethod requestPathMethod) {
final PathMethod requestPathMethod) {
pathContainer.includePathPattern(requestPathPattern, requestPathMethod);
return this;
}

public PathMatcherInterceptor excludePathPattern(final String requestPathPattern,
final PathMethod requestPathMethod) {
final PathMethod requestPathMethod) {
pathContainer.excludePathPattern(requestPathPattern, requestPathMethod);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public RequestPathPattern(final String path, final PathMethod method) {
this.method = method;
}

public boolean match(final PathMatcher pathMatcher, final String requestPath,
final String requestMethod) {
public boolean match(final PathMatcher pathMatcher,
final String requestPath,
final String requestMethod) {
return pathMatcher.match(path, requestPath) && method.match(requestMethod);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private Member findById(final Long id) {
}

private void validateMemberAuthentication(final Member requestMember,
final Member targetMember) {
final Member targetMember) {
if (!requestMember.equals(targetMember)) {
throw new AuthorizationException.UnauthenticatedException(
Map.of(
Expand Down
2 changes: 0 additions & 2 deletions backend/src/main/java/shook/shook/member/domain/Email.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.AccessLevel;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static SongResponse fromUnauthorizedUser(final Song song) {
}

private static List<KillingPartResponse> toKillingPartResponses(final Song song,
final Member member) {
final Member member) {
final List<KillingPart> songKillingParts = song.getLikeCountSortedKillingParts();

return IntStream.range(0, songKillingParts.size())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public interface KillingPartLikeRepository extends JpaRepository<KillingPartLike, Long> {

Optional<KillingPartLike> findByKillingPartAndMember(final KillingPart killingPart,
final Member member);
final Member member);

List<KillingPartLike> findAllByMemberAndIsDeleted(final Member member, final boolean isDeleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ public int getVoteCount() {
return votes.size();
}


@Override
public boolean equals(final Object o) {
if (this == o) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package shook.shook.voting_song.ui;


import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
Expand Down
6 changes: 3 additions & 3 deletions backend/src/test/java/shook/shook/ShookApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@SpringBootTest
class ShookApplicationTests {

@Test
void contextLoads() {
}
@Test
void contextLoads() {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.when;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ void renewInMemoryTokenPairRepository() {
inMemoryTokenPairRepository.addOrUpdateTokenPair(expiredRefreshToken, expiredAccessToken);

// when
final TokenPairScheduler tokenPairScheduler = new TokenPairScheduler(tokenProvider, inMemoryTokenPairRepository);
final TokenPairScheduler tokenPairScheduler
= new TokenPairScheduler(tokenProvider, inMemoryTokenPairRepository);
tokenPairScheduler.removeExpiredTokenPair();

// then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;


class PathMethodTest {

@DisplayName("요청 메소드 이름이 인자로 들어오는 경우 요소의 이름과 비교하여 대소문자 구분없이 같은 true를 반환한다.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ void setUp() {
inMemorySongs = new InMemorySongs();
}


@DisplayName("InMemorySong 을 1.좋아요 순, 2. id 순으로 정렬된 노래로 초기화한다.")
@Test
void recreate() {
Expand Down

0 comments on commit ccd5c85

Please sign in to comment.