-
Notifications
You must be signed in to change notification settings - Fork 0
[REFACTOR] auth 도메인 리팩터링 #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,7 +17,7 @@ | |||||
| @Component | ||||||
| @RequiredArgsConstructor | ||||||
| public class AppleAuthClientAdapter { | ||||||
| private final RestClient kakaoRestClient; | ||||||
| private final RestClient appleRestClient; | ||||||
| private final AppleClientSecretGenerator secretGenerator; | ||||||
|
|
||||||
| @Value("${apple.client-id}") | ||||||
|
|
@@ -33,7 +33,7 @@ public AppleTokenResponse getTokens(String authorizationCode) { | |||||
| params.add("grant_type", "authorization_code"); | ||||||
|
|
||||||
| try { | ||||||
| return kakaoRestClient.post() | ||||||
| return appleRestClient.post() | ||||||
| .uri("https://appleid.apple.com/auth/token") | ||||||
|
||||||
| .uri("https://appleid.apple.com/auth/token") | |
| .uri("/auth/token") |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ public class SecurityConfig { | |
|
|
||
| private static final String[] PUBLIC_URLS = { | ||
| "/", | ||
| "/health", | ||
| "/favicon.ico", | ||
|
Comment on lines
33
to
35
|
||
| "/v3/api-docs/**", | ||
| "/swagger-ui/**", | ||
|
|
@@ -50,7 +51,7 @@ public class SecurityConfig { | |
| private static final String[] API_URLS = { | ||
| "/api/users/me", | ||
| "/api/users/profile", | ||
| "/api/users/password", | ||
| "/api/users/password" | ||
| }; | ||
|
|
||
| @Bean | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package com.loopon.global.health; | ||
|
|
||
| import com.loopon.global.domain.dto.CommonResponse; | ||
| import io.swagger.v3.oas.annotations.Hidden; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.Map; | ||
|
|
||
| @RestController | ||
| @Hidden | ||
| @RequiredArgsConstructor | ||
| public class HealthCheckController { | ||
|
|
||
| @Value("${spring.profiles.active:default}") | ||
| private String activeProfile; | ||
|
|
||
| @GetMapping("/") | ||
| public ResponseEntity<CommonResponse<Map<String, String>>> systemStatus() { | ||
| Map<String, String> status = Map.of( | ||
| "status", "UP", | ||
| "profile", activeProfile, | ||
| "serverTime", LocalDateTime.now().toString(), | ||
| "message", "LoopOn API Server is running!" | ||
| ); | ||
|
Comment on lines
+22
to
+29
|
||
|
|
||
| return ResponseEntity.ok(CommonResponse.onSuccess(status)); | ||
| } | ||
|
|
||
| @GetMapping("/health") | ||
| public String healthCheck() { | ||
| return "OK"; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { | |
|
|
||
| private final List<String> excludeUrlPatterns = List.of( | ||
| "/", | ||
| "/health", | ||
| "/favicon.ico", | ||
|
Comment on lines
30
to
32
|
||
| "/v3/api-docs/**", | ||
| "/swagger-ui/**", | ||
|
|
@@ -40,6 +41,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter { | |
| "/api/users/upload-profile-image", | ||
| "/api/auth/login/**", | ||
| "/api/auth/reissue", | ||
| "/api/auth/logout", | ||
| "/api/auth/verification/**" | ||
| ); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 논의 필요:
accessToken의 Schema 설명이 "(Bearer)"로 되어 있어 응답 값 자체에Bearer접두어가 포함되는 것으로 오해될 수 있습니다. 실제로는 JWT 문자열만 내려주고 클라이언트가Authorization: Bearer <token>형태로 붙이는 구조라면, 설명을 "액세스 토큰(JWT). Authorization 헤더에는 Bearer 접두어를 붙여 전송"처럼 더 명확히 해주는 게 좋습니다.