Skip to content

feat: 캘린더 조회 API 및 선택적 인증 구현#1

Open
OKEunsu wants to merge 12 commits into
mainfrom
study/8-calendar_booking
Open

feat: 캘린더 조회 API 및 선택적 인증 구현#1
OKEunsu wants to merge 12 commits into
mainfrom
study/8-calendar_booking

Conversation

@OKEunsu

@OKEunsu OKEunsu commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • 캘린더 조회 API 및 관련 도메인 로직 추가
  • 선택적 인증 흐름 반영
  • 계정/캘린더 관련 테스트 코드 업데이트

Notes

  • 리뷰 요청: @codex review

OKEunsu added 12 commits January 3, 2026 04:08
1. 40글자 넘어 가는 테스트 에러
2. 최소길이 4글자 이상 테스트 에러
- DuplicatedEmailError 예외 클래스 추가
- signup 엔드포인트에 이메일 중복 검증 로직 구현
- 이메일 중복 오류 테스트 케이스 추가
- Race condition 대비 IntegrityError 처리 개선
- username과 email 중복 체크 로직 명확화"
- Calendar 엔드포인트 및 스키마 추가
- 선택적 사용자 인증(CurrentUserOptionalDep) 구현
- 호스트/게스트 권한별 응답 스키마 분리 (CalendarOut/CalendarDetailOut)
- pytest parametrize를 활용한 테스트 리팩토링
- 중복 테스트 코드 제거 및 fixture 추가
- 선택적 사용자 인증 의존성 추가 (CurrentUserOptionalDep)
- 호스트 캘린더 조회 엔드포인트 구현
- 권한별 응답 스키마 분리 (CalendarOut/CalendarDetailOut)
- 캘린더 관련 예외 처리 추가 (HostNotFoundError, CalendarNotFoundError)
- pytest parametrize를 활용한 테스트 리팩토링
- API 통합 테스트 추가"

OKEunsu commented Apr 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2482b6143b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread appserver/app.py
app = FastAPI()
def include_routers(_app: FastAPI):
_app.include_router(account_router)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register the calendar router in app startup

The new calendar endpoint is never reachable because include_routers only mounts account_router, so requests to /calendar/{host_username} will always return 404 even after this feature commit. This effectively ships the calendar API as dead code.

Useful? React with 👍 / 👎.

# payload.model_dump(): SignupPayload 객체 → dict 변환
# User.model_validate(): dict → User 모델 변환 (검증 포함)
# from_attributes=True: 객체의 속성에서도 값을 가져올 수 있게 함
user = User.model_validate(payload.model_dump(), from_attributes=True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Populate hashed password before creating users

signup validates payload directly into User without setting hashed_password, but the User model now requires that field. In practice this raises a validation error during signup (or stores the wrong password fields), so new account creation is broken in the normal registration path.

Useful? React with 👍 / 👎.

Comment on lines +33 to +34
if user is not None and user.id == host.id:
return CalendarDetailOut.model_validate(calendar)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Return public calendar payload for non-host viewers

host_calendar_detail only returns a value when the requester is the host; guest and anonymous requests fall through with no return. That causes an invalid response (None/validation failure) instead of the intended CalendarOut, breaking the optional-auth behavior for public calendar reads.

Useful? React with 👍 / 👎.

Comment on lines +28 to +29
if now + timedelta(minutes=ACCESS_TOKEN_EXPIRE_MINUTES) < expires_at:
raise ExpiredTokenError() from e

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fix token expiry check and undefined exception chaining

The expiration branch compares times in the wrong direction and then does raise ExpiredTokenError() from e where e is out of scope. If this branch is hit, it will raise NameError instead of an auth error, and the current predicate does not correctly detect expired tokens.

Useful? React with 👍 / 👎.

@OKEunsu

OKEunsu commented Apr 1, 2026

Copy link
Copy Markdown
Owner Author

@codex address 피드백줘

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant