fix(notification): FCM 서비스 계정 설정 주입 방식 개선 - #108
Merged
Merged
Conversation
choi-jin-wook
commented
Sep 15, 2026
Collaborator
- FCM 서비스 계정 키를 Base64 환경변수로 주입
- 로컬 환경에서 classpath 자격 증명 파일을 폴백으로 사용
- 운영 환경의 키 누락 시 애플리케이션 기동 실패 처리
- Spring Value 어노테이션으로 FCM 설정값 바인딩
Comment on lines
+65
to
+69
| # FCM 서비스 계정 키. 이미지에 굽지 않고 .env.prod 의 env 로 주입받는다. | ||
| # required: 키가 없으면 기동을 깨서 배포 시점에 드러낸다(kafka.admin.fail-fast 와 같은 철학). | ||
| fcm: | ||
| service-account-b64: ${FCM_SERVICE_ACCOUNT_B64:} | ||
| required: true No newline at end of file |
There was a problem hiding this comment.
application.yml 은 프로파일과 무관하게 항상 로드되는 base 설정이라, 여기서 fcm.required: true 를 켜면 local 을 포함한 모든 프로파일에서 fail-fast 가 적용됩니다. FCMConfig.init() 에서 required 가 true 인 상태로 base64 env 도, classpath 의 serviceAccountKey.json 도 없으면 IllegalStateException 이 던져져 기동 자체가 깨지는데, PR 설명의 "로컬 환경에서는 classpath 자격 증명 파일을 폴백으로 사용", "운영 환경의 키 누락 시에만 기동 실패"라는 의도와 정반대입니다. FCMConfig.java 의 주석("운영(aws 프로파일)에서만 true")과 @Value("${fcm.required:false}") 기본값과도 어긋나고, application-aws.yml 에 이미 같은 값을 넣어둔 게 완전히 무의미해집니다.
base 는 false 로 두고 application-aws.yml 에서만 true 로 덮어써야 의도한 계층 구조가 성립합니다.
Suggested change
| # FCM 서비스 계정 키. 이미지에 굽지 않고 .env.prod 의 env 로 주입받는다. | |
| # required: 키가 없으면 기동을 깨서 배포 시점에 드러낸다(kafka.admin.fail-fast 와 같은 철학). | |
| fcm: | |
| service-account-b64: ${FCM_SERVICE_ACCOUNT_B64:} | |
| required: true | |
| # FCM 서비스 계정 키. 이미지에 굽지 않고 .env.prod 의 env 로 주입받는다. | |
| # required 는 운영(application-aws.yml)에서만 true 로 켠다. 로컬은 classpath 폴백을 사용한다. | |
| fcm: | |
| service-account-b64: ${FCM_SERVICE_ACCOUNT_B64:} | |
| required: false |
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.