Repository navigation
fix: 콜백 주소 기본값을 없애고 필수 설정 누락을 기동 시 막음(N-6) - #100
Merged
Merged
Conversation
app.callback-base-url의 기본값이 개발자 ngrok 주소라, 운영에서 CALLBACK_BASE_URL을 빠뜨려도 서버가 떠서 분석·채팅 서버의 결과가 그 주소로 갔다. 접수는 202로 정상처럼 보이고 실패는 시간 초과로만 드러났다. - callback-base-url 기본값 제거. 비었거나 형식이 틀리면(http/https 아님, 호스트 없음, 사용자 정보·쿼리·조각·끝 슬래시) 기동 실패. 끝 슬래시는 "//api/..."가 되어 콜백이 모두 400으로 막힌다 - prod 프로필이면 https만 받고 ngrok·localhost·loopback 주소를 받지 않는다. 네트워크 연결 검사는 하지 않는다 - INTERNAL_AUTH_REQUIRED(app.internal-auth.required, 기본 false) 추가. true인데 INTERNAL_AUTH_TOKEN이 비면 기동 실패. 기존 내부 인증 동작은 그대로이고, 오류 메시지에 인증값을 싣지 않는다 - 테스트는 src/test/resources/config/application.yaml에서 콜백 주소를 명시적으로 채운다 운영 env에 CALLBACK_BASE_URL이 반드시 있어야 한다. prod 검사를 쓰려면 SPRING_PROFILES_ACTIVE=prod를 넣는다. INTERNAL_AUTH_REQUIRED=true는 Chat·Analysis가 헤더를 보내는 배포를 마친 뒤 마지막에 켠다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danjee2009
reviewed
Oct 15, 2026
danjee2009
left a comment
Member
There was a problem hiding this comment.
검토 범위: 기동 시 콜백 URL과 내부 인증 설정 검증, 관련 설정 테스트를 확인했습니다. GitHub 테스트 체크는 통과했습니다.
사용자 정보·쿼리가 붙은 주소를 막는 검사인데 오류 메시지에 원문을 넣어, 그 안의 자격 증명이 기동 실패 로그에 그대로 남을 수 있었다(PR #100 리뷰). 검증 항목과 호스트만 싣는다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
[P2] 기동 시 콜백 포트도 실제 요청 코드와 동일하게 검증해야 합니다. — RequiredSettingsCheck.java:60 |
음성·영상 분석 요청의 CallbackUrls.require()는 포트를 생략했거나 443인 주소만 받는데, 기동 검사는 https://api.example.com:8443을 통과시켜 실제 분석 요청이 422로 실패할 수 있었다(PR #100 리뷰). prod 프로필 검사에 같은 포트 제한을 넣는다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2-dayeon
approved these changes
Oct 15, 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.
개요
A-1 N-6 "콜백 주소 기본값 제거 및 운영 기동 검증"입니다. main(bd6663e) 기준입니다. 스키마 변경은 없습니다.
app.callback-base-url의 기본값이 개발자 ngrok 주소(https://wildcat-startle-rope.ngrok-free.dev)였습니다.CALLBACK_BASE_URL을 빠뜨려도 서버가 떴고, 분석·채팅 서버의 결과가 그 주소로 갔습니다.RequiredSettingsCheck). 블루/그린 배포라 새 서버가 뜨지 않으면 이전 서버가 그대로 남습니다.변경
1. 콜백 주소 (
app.callback-base-url=CALLBACK_BASE_URL)${CALLBACK_BASE_URL:}).//api/...가 되고, 시큐리티 방화벽이 콜백을 모두 400으로 막습니다.prod프로필에서만 확인하는 것: https만 받고, 포트는 생략하거나 443이어야 합니다(분석 서버와CallbackUrls.require()가 다른 포트를 거부합니다). ngrok·localhost·*.localhost·127.x·[::1]·0.0.0.0도 받지 않습니다.2. 내부 인증 필수 (
app.internal-auth.required=INTERNAL_AUTH_REQUIRED, 신규, 기본false)true인데INTERNAL_AUTH_TOKEN이 비어 있으면 기동이 실패합니다. 비어 있는 채로 "인증 없이 받기"로 조용히 돌아가는 것을 막습니다.InternalCallbackAuthInterceptor)은 그대로입니다. 오류 메시지에 인증값을 싣지 않습니다.true로 바꾸지 않았습니다. 운영 활성화는 배포 절차로 분리합니다(아래).3. 테스트 설정 (
src/test/resources/config/application.yaml, 신규)https://api.repit.test로 명시합니다.classpath:/config/파일이라 기본application.yaml위에 겹쳐 읽히고, 로컬.env값보다 우선합니다(확인함). 그래서 CI(test.yml)는 바꾸지 않았습니다.설정 변경 목록
CALLBACK_BASE_URLhttps://api.repit.example(끝 슬래시 없음)INTERNAL_AUTH_REQUIREDfalsetrue(토큰 필수)SPRING_PROFILES_ACTIVEprod면 운영 주소 검사(https, 포트 생략·443, 개발용 주소 금지)prod명세는
INTERNAL_AUTH_REQUIRED와 운영 프로필이 이미 있다고 가정했습니다. 레포에는 둘 다 없었습니다(Dockerfile은java -jar만 실행). 그래서 위처럼 새로 정했습니다.배포 (N-6 활성화 절차)
CALLBACK_BASE_URL이 들어 있는지 확인합니다. 없으면 새 서버가 뜨지 않습니다.SPRING_PROFILES_ACTIVE=prod를 넣습니다. 넣지 않으면 필수·형식 검사만 합니다.INTERNAL_AUTH_REQUIRED=true는 마지막에 켭니다. Chat·Analysis가X-Internal-Token헤더를 실제로 보내도록 배포를 마치고,INTERNAL_AUTH_TOKEN을 채운 뒤입니다..env의CALLBACK_BASE_URL(ngrok 등)을 그대로 씁니다. 프로필이prod가 아니면 개발용 주소를 받습니다.테스트
./gradlew test전체 640개가 통과했습니다.RequiredSettingsCheckTest(신규,ApplicationContextRunner로 실제 기동 판정)CALLBACK_BASE_URL을 짚습니다.prod)에서는 ngrok·loopback·http·기본이 아닌 포트(:8443)를 막고, 정상 https 주소(포트 생략,:443)면 기동합니다.🤖 Generated with Claude Code