Skip to content

[Fix] 서버 부팅 시 HMAC_SECRET 환경변수 에러 방지#71

Closed
zweadfx wants to merge 1 commit intomainfrom
fix/hmac-secret-optional
Closed

[Fix] 서버 부팅 시 HMAC_SECRET 환경변수 에러 방지#71
zweadfx wants to merge 1 commit intomainfrom
fix/hmac-secret-optional

Conversation

@zweadfx
Copy link
Copy Markdown
Contributor

@zweadfx zweadfx commented Apr 8, 2026

1. 개요

  • 관련 이슈: [Feat] Discord 웹훅 로그 상세화 — 로드맵 생성/수정 파이프라인 내부 추적 #69 관련 후속 조치)

    2. 작업 내용

    • app/core/config.pySettings 클래스에서 HMAC_SECRET을 필수 필드(str)에서 선택 필드(str | None = None)로 변경했습니다.
    • 이를 통해 서버 배포나 로컬 환경 세팅 시 .env 파일에 해당 키가 누락되어도 앱 부팅 과정에서 크래시(Crash)가 발생하는 문제를 방지합니다.
    • 실제 해싱 로직이 실행되는 시점(process_chat_request, google_places_service)에 값이 없을 때만 명시적으로 예외(ValueError)를 던지도록 하여 보안 상의
      요구사항("fail loudly if missing")은 그대로 유지했습니다.

    3. AI 활용 및 검증

    • AI가 생성한 코드 포함

    • 100% 직접 작성

    • 검증 방법:

      • HMAC_SECRET.env에 없는 상태로 서버가 정상적으로 부팅되는지 확인.
      • pytest tests/를 통해 관련 유닛 테스트들이 모두 정상 통과함을 확인.

    4. 스크린샷 (선택)

    (생략)

Summary by CodeRabbit

변경 사항

  • 설정
    • HMAC_SECRET 설정이 이제 선택 사항으로 변경되었습니다. 환경 변수를 설정하지 않아도 애플리케이션을 시작할 수 있습니다.

- HMAC_SECRET을 선택적 변수로 변경하여 .env 누락 시 서버가 강제 종료되는 문제 해결
- API 요청 시 실제 해싱이 일어날 때만 명시적 에러를 발생시키도록 보장
@zweadfx zweadfx self-assigned this Apr 8, 2026
@zweadfx zweadfx added the bug 정상 동작하지 않는 문제나 오류를 수정하는 작업 label Apr 8, 2026
@zweadfx zweadfx requested a review from iamb0ttle as a code owner April 8, 2026 04:46
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09a2e91c-1161-4153-9615-a2fe3a1e7785

📥 Commits

Reviewing files that changed from the base of the PR and between a69502b and 87a2b49.

📒 Files selected for processing (1)
  • app/core/config.py

개요

app/core/config.py에서 HMAC_SECRET 필드를 필수 문자열에서 선택적 문자열(기본값 None)로 변경하여, HMAC 시크릿 없이도 애플리케이션을 시작할 수 있도록 수정했습니다.

변경 사항

Cohort / File(s) 요약
설정 필드 수정
app/core/config.py
HMAC_SECRET 필드를 필수 str에서 선택적 str | None = None으로 변경하여 환경 변수에서 HMAC 시크릿을 제공하지 않아도 설정 유효성 검증을 통과하도록 수정

예상 코드 리뷰 노력

🎯 1 (Trivial) | ⏱️ ~5 분

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확히 설명합니다. HMAC_SECRET 환경변수 에러 방지라는 주요 변경사항을 간결하게 요약했습니다.
Description check ✅ Passed PR 설명이 템플릿 구조를 따르고 모든 필수 섹션(개요, 작업 내용, AI 활용 및 검증, 체크리스트)을 포함하고 있습니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/hmac-secret-optional

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zweadfx zweadfx closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 정상 동작하지 않는 문제나 오류를 수정하는 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant