Skip to content

Commit 70dfafb

Browse files
authored
Merge pull request #417 from VitaCheck/develop
[MAIN] 25-10-30 release v1
2 parents 2b11b72 + 58bf408 commit 70dfafb

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

module-auth/src/main/java/com/vitacheck/auth/config/SecurityConfig.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public class SecurityConfig {
3636
"/error", "/fcm_test.html", "/firebase-messaging-sw.js",
3737
"/api/v1/ingredients/**", "/api/v1/purposes/**", "/api/v1/supplements/**",
3838
"/api/v1/combinations/**", "/api/v1/terms", "/api/v1/search/**", "/api/v1/logs/**",
39-
"/internal/trigger-notifications", "/health", "/api/v1/test"
39+
// "/internal/trigger-notifications", // <-- 기존에 이 경로였나요? NotificationSettingsController 확인 필요
40+
"/api/v1/notification-settings/internal/trigger-notifications", // <-- 이 경로를 추가해야 합니다!
41+
"/health", "/api/v1/test"
4042
};
4143

4244
@Bean

src/main/java/com/vitacheck/Notification/controller/NotificationSettingsController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ public CustomResponse<String> updateMyNotificationSetting(
9393
@Operation(summary = "내부용 알림 발송 트리거", description = "Cron Job에 의해 호출되어 알림 발송 로직을 실행합니다. (외부 노출 금지)")
9494
public CustomResponse<String> triggerNotifications(HttpServletRequest request) {
9595
// 보안을 위해 localhost에서 온 요청인지 확인합니다.
96-
// String remoteAddr = request.getRemoteAddr();
97-
// if (!remoteAddr.equals("127.0.0.1") && !remoteAddr.equals("0:0:0:0:0:0:0:1")) {
98-
// // 권한 없음 에러를 반환합니다.
99-
// throw new CustomException(ErrorCode.INVALID_REQUEST);
100-
// }
96+
String remoteAddr = request.getRemoteAddr();
97+
if (!remoteAddr.equals("127.0.0.1") && !remoteAddr.equals("0:0:0:0:0:0:0:1")) {
98+
// 권한 없음 에러를 반환합니다.
99+
throw new CustomException(ErrorCode.INVALID_REQUEST);
100+
}
101101

102102
notificationScheduler.sendRoutineNotifications();
103103
return CustomResponse.ok("알림 발송 작업이 성공적으로 실행되었습니다.");

0 commit comments

Comments
 (0)