Skip to content

Conversation

@ekfrehd
Copy link
Contributor

@ekfrehd ekfrehd commented Jan 11, 2026

🔍 PR 타입 선택

아래 타입 중 해당하는 하나를 선택해 주세요. 반드시 하나만 선택해 주세요.

  • feat: 새로운 기능 추가
  • fix: 버그 수정
  • docs: 문서 수정
  • style: 코드 포맷팅, 세미콜론 누락, 코드 변경이 없는 경우
  • refactor: 코드 리팩토링
  • test: 테스트 코드 추가 또는 수정
  • chore: 빌드 업무 수정, 패키지 매니저 수정 등 기타 작업

📝 변경 사항 요약

AuthenticationFilter

토큰이 없거나 검증에 실패해도 즉시 401 에러를 뱉지 않고 FilterChain을 통과시키도록 수정

@WithUserContext

required 속성을 추가하여 컨트롤러에서 로그인 필수 여부를 선택할 수 있게 수정 (기본값: true)

UserContextArgumentResolver에서 required=false일 경우 null을 반환하도록 수정

API 적용

GET /trips (목록): 필터 Pass 적용으로 자동 해결

GET /trips/{tripId} (상세): required=false 설정 적용

기획 변경 사항에 따라 여행 생성(POST /trips) 시 초기 상태를 항상 공개(Open) 로 고정하도록 수정

TripCreateRequest 수정

open, password 필드 삭제

Trip 엔티티 생성 시 isOpen은 true, password는 null로 고정

TripService 수정

여행 생성 메서드(createTrip, createTripWithItineraries)에서 assignPasswordIfNotOpen 로직 제거

(참고: updateTripVisibility 등 추후 비공개 전환 시에는 여전히 비밀번호 설정 로직이 동작합니다.)

TripDetailResponse 수정

여행자 구분을 위해 하드코딩 수정

🛠 관련 이슈

Resolves: 2, 3-1 ,3-2 ,4
Ref: #456
Related to: #48, #45
close: #번호

추가 설명 (선택 사항)

변경 사항에 대한 추가 설명을 작성해 주세요.

@ekfrehd ekfrehd changed the title feat: 여행 목록/상세 조회 비로그인 접근 허용 및 인증 로직 개선 feat: 여행 목록/상세 조회 비로그인 접근 허용 및 인증 로직 개선/하드코딩 수정으로 여행자 구분/여행 생성 시 공개 여부 및 비밀번호 설정 로직 제거 Jan 11, 2026
new TripDescription(description),
new TripPeriod(start, end),
open,
true,
Copy link
Contributor

Choose a reason for hiding this comment

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

해당 값 임시로 하드 코딩 한것일까요??
나중에는 아예 제거하는 것인지 문의 드려요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네, 맞습니다! 기획 사항이 변경되어 여행 생성 시에는 항상 공개 상태로 시작하고 이후에 비공개로 전환된다고 전달받았습니다. 그래서 Request DTO에서 open 필드를 제거했고 엔티티 생성 시에는 true(공개)를 고정값으로 넘겨주도록 수정했습니다! 비밀번호(password) 필드도 같은 이유로 제거했습니다!

.introduction("안녕하세여")
.nickName("박정수")
.imageUrl("http://~~~")
.introduction(null)
Copy link
Contributor

Choose a reason for hiding this comment

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

해당 값은 왜 Null로 세팅한 것일까요??
여행 참여 시 입력되는 값인거 같아서 문의드려요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

현재 Trip 서비스에서 참여자의 상세 프로필 정보(자기소개, 프로필 사진)를 조회하려면 Auth 서비스에서 member 정보와 연동이 필요한데 아직 해당 기능이 구현 전 단계입니다. 기존에는 하드코딩된 값이 내려가고 있어 모든 참가자가 똑같아 보이는 문제가 있었습니다. 우선 프론트엔드에서 null일 경우 기본 이미지,텍스트를 보여주는것으로 말씀드릴 예정이라 null로 변경했습니다. 추후 User 서비스 연동 시 실제 데이터로 교체될 예정입니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

@ekfrehd 님 넵! 이해했습니다.
추후 WebClient나 Feign Client 사용해서 연결하는 작업 필요할 거 같습니다.

String path = request.getRequestURI();
String pathLowercase = path.toLowerCase();

if (path.equals("/") ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Trip 조회만 비로그인이 가능한 거로 아는데, 해당 Path에 추가하면 되는것 아닌가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AuthenticationFilter: 프론트 개발자 요청사항은 api분리를 원했으나 비로그인/로그인 유저가 같은 API(GET /trips/{id})를 그대로 사용하는 방법을 모색하던중 , 필터에서 경로를 예외 처리하는 대신 토큰이 없어도 통과시키되, 컨트롤러에서 필수 여부를 체크하는 방식으로 로직을 통합했습니다. 이 부분은 api 분리가 맞다면 수정하겠습니다

ps 프론트 요청 사항 remind
3. GET /trips/{tripId}

  • 비로그인/로그인 API로 분리 필요. 여행 상세 페이지에서 비로그인 시 접근할 수 있는 정보와, 로그인 시 접근할 수 있는 추가 정보로 나누어져 있어서 API도 분리가 필요할 것 같습니다.
  • 참가중인 여행원 데이터가 항상 같은 값으로 내려옵니다. 하드코딩되어있는지 확인 부탁드립니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ex ) 여행에 이미 참여중인 사용자가 토큰을 가진채로 상세페이지 접근
path permitAll ) 이미 참여 중인 유저 접근 시: 서버가 비로그인으로 인식하여 나가기버튼이 아닌 참여하기버튼이 보임 usercontext 생성 안함
API 분리 미채택 이유 : 프론트앤드 코드 불필요한 분기처리와 중복코드가 예상됨 유지보수에 용이하도록 하고 RESTful 특성상 trip상세 재원에 접근하는 api는 하나로 통일하려 했습니다

Copy link
Contributor

@xjvmdutl xjvmdutl Jan 12, 2026

Choose a reason for hiding this comment

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

@ekfrehd 지금 작업해 주신 내용대로 하면 기존 토큰이 없는 사용자도 모든 API 호출이 가능한 거 아닌가요?
토큰이 필요한 API는 컨트롤러에 어떻게 작업이 되어 있는지를 잘 모르겠어서 문의드려요

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.

3 participants