Repository navigation
feat: CORS 허용 origin 설정화 — local profile만 localhost 개발 Front 허용 [1.96] - #243
Merged
Merged
Conversation
…영은 proovy.ai.kr 유지 [1.96] - proovy.cors.allowed-origin-patterns(CorsProperties)로 허용 origin을 읽는다. 빈 목록·전체 허용(*)은 기동에서 거부한다(credentials 허용). - application.yaml 기본은 https://proovy.ai.kr, local profile만 http://localhost:[*]를 더한다. prod·test profile은 기본값 그대로다. - 로컬 Front(Vite dev server proxy)의 브라우저 POST(전송·정지)가 Origin: http://localhost:<port>로 403이던 문제를 해결한다. - CorsConfigurationTest: 실제 application.yaml을 profile별(local·prod·test)로 binding해 CorsFilter POST 판정을 확인한다. Refs Team-Proovy/Proovy-front#306 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…VE=test가 application.yaml 기본을 덮는다 [1.96] Refs Team-Proovy/Proovy-front#306 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 tasks done
…검증해 host wildcard 거부, 테스트에서 OS 환경변수 격리 [1.96] - 'https://*'·'http://*:[*]'·'a, *'처럼 credentialed 전체 허용이 되는 값을 기동에서 거부한다(포트 wildcard :[*]만 허용). - CorsConfigurationTest는 SYSTEM_ENVIRONMENT property source를 뺀 environment로 실행해 SPRING_PROFILES_ACTIVE·PROOVY_CORS_ALLOWED_ORIGIN_PATTERNS에 영향받지 않는다. Refs Team-Proovy/Proovy-front#306 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 관련 이슈
🏷️ PR 타입
📝 작업 내용
proovy.cors.allowed-origin-patterns(CorsProperties)로 바꿨다.setAllowedOrigins→setAllowedOriginPatterns.https://proovy.ai.kr— 운영(prod)·CI(test) profile은 이 값 그대로(기존과 같음).http://localhost:[*]를 더한다(Vite dev server 포트 무관).scheme://host[:port|:[*]]만 받는다. 빈 목록·*·https://*·http://*:[*]·"a, *"같은 host wildcard는 기동에서 거부한다(리뷰 r196 [Feat] PostgreSQL 연동 및 JPA 연결 테스트 환경 구축 #1).POST /api/conversations·POST /api/ai-runs/{runId}/cancel)가Origin: http://localhost:<port>로 403이었다(GET은 same-origin이라 Origin이 없어 통과). 1.96 실제 연결 인수 검증에서 발견.📸 스크린샷 / 검증
./gradlew test --tests 'com.proovy.global.security.*'(flock, docker temurin 21,--max-workers=2 -Xmx768m):CorsConfigurationTesttests=5 skipped=0 failures=0 errors=0http://localhost:5196·:5173·https://proovy.ai.kr통과,http://localhost.attacker.example·https://evil.example403https://proovy.ai.kr만 허용, localhost POST 403*·https://*·http://*:[*]·https://*.example.com·"https://proovy.ai.kr, *"·빈 목록 → 기동 실패, 명시 origin·포트 wildcard·쉼표 나열 명시 origin은 통과SPRING_PROFILES_ACTIVE=test·PROOVY_CORS_ALLOWED_ORIGIN_PATTERNS=https://leak.example를 건 컨테이너에서도 5/5 통과(리뷰 r196 [Feat] 전체 저장소 사용량 및 노트별 현황 조회 API #3)Origin: http://localhost:5196POST/api/conversations→ 200,Origin: https://evil.example→ 403testpass (run 39408667331, head 77c5604; 이전 run 39407332322 head 3311770). 첫 실행(2de52ec)은 CI의SPRING_PROFILES_ACTIVE=test환경변수가 application.yaml 기본(local)을 덮어 local 테스트 1건이 실패했고, 테스트에서 profile을 명시해 고쳤다(로컬에서도 같은 env로 재현·통과 확인).✅ 체크리스트
📎 기타 참고사항
후속 메모(리뷰 r196 [Chore] 프로젝트 초기 세팅 및 패키지 구조 정리 #2, 이 PR 범위 밖):
application.yaml의spring.profiles.active: local(기존 설정)이 기본 활성이라, 이 PR 뒤로는SPRING_PROFILES_ACTIVE없이 기동한 서버가 localhost origin(credentialed)을 허용한다. 현재 유일한 배포 경로deploy.yml은 prod를 명시하므로 발생하지 않는다. S14 운영 정비 때 Cloud Run env의 prod 고정을 확인하고, local을 opt-in(로컬 실행 스크립트가 명시)으로 바꾸는 방안을 검토한다.리뷰 r196 [Feat] 자산 일괄 삭제 API #4(127.0.0.1·[::1] origin) 미반영: 결정 범위가
http://localhost:*다. Front 로컬 실행 문서에 localhost로 접속하라고 적는다.리뷰 r196 [Feat] 카카오 소셜 로그인 #5(서비스 origin 중복) 미반영: profile 목록 대체는 Spring 기본 동작이고 값 두 곳(기본·local)과 기본값 한 곳뿐이다. 병합 키를 따로 두면 설정 의미가 늘어 이 PR에서는 단순한 대체를 유지한다.
운영 배포 env(
deploy.yml)는SPRING_PROFILES_ACTIVE=prod라 local 문서가 적용되지 않는다. 운영 허용 origin을 바꾸려면PROOVY_CORS_ALLOWED_ORIGIN_PATTERNS로 덮을 수 있다(이 PR은 값 변경 없음).이 PR merge 뒤 Front 1.96의 최종 인수 검증은 merge commit 기준으로 한다.
🤖 Generated with Claude Code