From 6d05b759ad98888f3f84d107ab4c8acc551254c6 Mon Sep 17 00:00:00 2001 From: junwon Date: Thu, 29 Aug 2024 22:08:58 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20=EB=A9=80=ED=8B=B0=EC=8A=A4=EB=A0=88?= =?UTF-8?q?=EB=93=9C=20=EB=A6=AC=EB=B7=B0=20=EA=B3=B5=EA=B0=90=20Test?= =?UTF-8?q?=EC=97=90=20=EB=AC=B8=EC=A0=9C=20=EC=97=86=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/jwt/JwtAuthenticationFilter.java | 2 -- .../aws/property/ObjectStorageProperties.java | 3 ++- .../jpa/oauth/OauthRepositoryImpl.java | 15 ++++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/src/main/java/org/depromeet/spot/application/common/jwt/JwtAuthenticationFilter.java b/application/src/main/java/org/depromeet/spot/application/common/jwt/JwtAuthenticationFilter.java index fed63a9e..8f8e45c2 100644 --- a/application/src/main/java/org/depromeet/spot/application/common/jwt/JwtAuthenticationFilter.java +++ b/application/src/main/java/org/depromeet/spot/application/common/jwt/JwtAuthenticationFilter.java @@ -94,8 +94,6 @@ protected void doFilterInternal( } private boolean checkMethodWhitelist(String requestURI, String requestMethod) { - log.info("requestURI: {}", requestURI); - log.info("requestMethod: {}", requestMethod); if (Arrays.stream(AUTH_WHITELIST).anyMatch(requestURI::startsWith)) { return true; } diff --git a/infrastructure/src/main/java/org/depromeet/spot/infrastructure/aws/property/ObjectStorageProperties.java b/infrastructure/src/main/java/org/depromeet/spot/infrastructure/aws/property/ObjectStorageProperties.java index 19dd0d5b..a8bb970a 100644 --- a/infrastructure/src/main/java/org/depromeet/spot/infrastructure/aws/property/ObjectStorageProperties.java +++ b/infrastructure/src/main/java/org/depromeet/spot/infrastructure/aws/property/ObjectStorageProperties.java @@ -3,4 +3,5 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @ConfigurationProperties(prefix = "aws.s3") -public record ObjectStorageProperties(String accessKey, String secretKey, String bucketName) {} +public record ObjectStorageProperties( + String accessKey, String secretKey, String bucketName, String basicProfileImageUrl) {} diff --git a/infrastructure/src/main/java/org/depromeet/spot/infrastructure/jpa/oauth/OauthRepositoryImpl.java b/infrastructure/src/main/java/org/depromeet/spot/infrastructure/jpa/oauth/OauthRepositoryImpl.java index aabd3de9..a4d1bba7 100644 --- a/infrastructure/src/main/java/org/depromeet/spot/infrastructure/jpa/oauth/OauthRepositoryImpl.java +++ b/infrastructure/src/main/java/org/depromeet/spot/infrastructure/jpa/oauth/OauthRepositoryImpl.java @@ -4,13 +4,13 @@ import org.depromeet.spot.common.exception.oauth.OauthException.InvalidAcessTokenException; import org.depromeet.spot.domain.member.Member; import org.depromeet.spot.domain.member.enums.SnsProvider; +import org.depromeet.spot.infrastructure.aws.property.ObjectStorageProperties; import org.depromeet.spot.infrastructure.jpa.oauth.config.OauthProperties; import org.depromeet.spot.infrastructure.jpa.oauth.entity.GoogleTokenEntity; import org.depromeet.spot.infrastructure.jpa.oauth.entity.GoogleUserInfoEntity; import org.depromeet.spot.infrastructure.jpa.oauth.entity.KakaoTokenEntity; import org.depromeet.spot.infrastructure.jpa.oauth.entity.KakaoUserInfoEntity; import org.depromeet.spot.usecase.port.out.oauth.OauthRepository; -import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatusCode; import org.springframework.stereotype.Repository; @@ -26,12 +26,11 @@ @RequiredArgsConstructor public class OauthRepositoryImpl implements OauthRepository { - @Value("${aws.s3.basicProfileImageUrl}") - private String BASIC_PROFILE_IMAGE_URL; - private final String BEARER = "Bearer"; private final OauthProperties properties; + private final ObjectStorageProperties objectStorageProperties; + private final String AUTHORIZATION_CODE = "authorization_code"; @Override @@ -140,19 +139,21 @@ public String getOauthAccessToken(SnsProvider snsProvider, String authorizationC @Override public Member getKakaoRegisterUserInfo(String accessToken, Member member) { KakaoUserInfoEntity userInfo = getKakaoUserInfo(accessToken); + log.info("basicProfileImage : {}", objectStorageProperties.basicProfileImageUrl()); // 회원가입 시 받은 정보를 바탕으로 member로 변환해서 리턴. - return userInfo.toKakaoDomain(member, BASIC_PROFILE_IMAGE_URL); + return userInfo.toKakaoDomain(member, objectStorageProperties.basicProfileImageUrl()); } @Override public Member getOauthRegisterUserInfo(String accessToken, Member member) { switch (member.getSnsProvider()) { case KAKAO: - return getKakaoUserInfo(accessToken).toKakaoDomain(member, BASIC_PROFILE_IMAGE_URL); + return getKakaoUserInfo(accessToken) + .toKakaoDomain(member, objectStorageProperties.basicProfileImageUrl()); default: return getGoogleUserInfo(accessToken) - .toGoogleDomain(member, BASIC_PROFILE_IMAGE_URL); + .toGoogleDomain(member, objectStorageProperties.basicProfileImageUrl()); } }