Skip to content

chore: GR-59 Swagger UI 접속 경로 개방 - #36

Merged
ImJhoon merged 1 commit into
mainfrom
chore/GR-59-swagger-access
Sep 25, 2026
Merged

ImJhoon merged 1 commit into
mainfrom
chore/GR-59-swagger-access

Conversation

@wlsdn020416

@wlsdn020416 wlsdn020416 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

작업 내용

GR-59 선행 최소 작업. 운영 노출 정책·OpenApiConfig·API 그룹·@Tag/@Operation 등 나머지는 한재훈 님 범위다.

  • 기동 호환 확인: springdoc 3.1.0이 Spring Boot 4.1.1에서 기동하며 /v3/api-docs를 응답하는지 확인했다(비호환 예외 없음).
  • SecurityConfig: Swagger 경로 3개를 permitAll로 추가했다. 기존 줄은 늘리지 않고 한 줄만 추가했으며, formLogin·httpBasic 등 다른 설정은 건드리지 않았다.
    // ponytail: 로컬 확인용 전 환경 개방. 운영 노출 정책은 GR-59(한재훈)에서 프로필로 제한
    .requestMatchers("/swagger-ui/**", "/swagger-ui.html", "/v3/api-docs/**").permitAll()
    전 환경에 적용되는 임시 설정이라 주석으로 명시했다.
  • 테스트: SwaggerEndpointTests를 ActuatorEndpointTests와 같은 방식(@SpringBootTest + @AutoConfigureMockMvc)으로 추가했다. 새 테스트 인프라는 추가하지 않았다.

변경 파일은 SecurityConfig.java와 SwaggerEndpointTests.java 두 개뿐이다.

확인 방법

  • ./gradlew test → 110건 통과, failures=0, skipped=0
  • build/test-results/test/TEST-org.example.grab.SwaggerEndpointTests.xml → skipped="0" failures="0" errors="0"
  • docker compose up -d postgres 후 ./gradlew bootRun 수동 확인
    • /v3/api-docs → 200, {"openapi":"3.1.0",...
    • /swagger-ui/index.html → 200
    • /swagger-ui.html → 302 → /swagger-ui/index.html
    • /api/v1/seller/drops → 401 (기존 보호 유지)

체크리스트

  • 로컬에서 빌드·테스트가 통과했다
  • 코딩 컨벤션을 따랐다
  • 스키마·API를 변경했다면 관련 문서를 함께 수정했다 — 이번 변경은 스키마·API 명세 변경 없음(보안 설정·테스트만)

참고

  • 이 설정은 전 환경 개방 임시 설정이라 병합 시 운영에도 Swagger가 노출된다. 운영에서 끄는 작업(프로필·환경 변수)은 한재훈 님 범위다.
  • 로컬에서 Docker 컨테이너(grab-backend:local)로 접속하면 이전 이미지라 로그인 화면이 뜰 수 있다. 소스 실행(./gradlew bootRun) 또는 이미지 재빌드가 필요하다.

관련 이슈

  • GR-59

Summary by CodeRabbit

  • 개선 사항
    • 인증 없이 Swagger UI와 OpenAPI 문서에 접근할 수 있습니다.
  • 테스트
    • Swagger UI와 OpenAPI 문서의 비인증 접근을 확인하는 테스트를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: prgrms-aibe-devcourse/AIBE7_FinalProject_Team3/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: fef80d13-789f-4ac2-b4a0-4a37bf15c3a5

📥 Commits

Reviewing files that changed from the base of the PR and between 7e1abab and a13c103.

📒 Files selected for processing (2)
  • Backend/src/main/java/org/example/grab/global/config/SecurityConfig.java
  • Backend/src/test/java/org/example/grab/SwaggerEndpointTests.java

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

보안 설정에서 Swagger UI와 OpenAPI 문서 경로를 인증 없이 허용합니다. 테스트 두 건으로 OpenAPI 문서와 Swagger UI 엔드포인트의 응답을 확인합니다.

Changes

Swagger 문서 접근

Layer / File(s) Summary
공개 경로 설정 및 검증
Backend/src/main/java/org/example/grab/global/config/SecurityConfig.java, Backend/src/test/java/org/example/grab/SwaggerEndpointTests.java
보안 설정에서 Swagger UI와 OpenAPI 경로를 permitAll()로 허용합니다. 테스트는 /v3/api-docs가 200 상태와 "openapi" 문자열을 반환하는지, /swagger-ui/index.html이 200 상태를 반환하는지 확인합니다.

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: ⚪ Minimal · up to a13c1

Swagger 문서가 모든 환경에서 공개되는 것은 이번 변경의 명시된 목적입니다. 확인된 범위에서 병합을 막을 구체적인 결함은 없습니다.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 Swagger UI 및 관련 Swagger/OpenAPI 경로를 인증 없이 개방하는 주요 변경 사항을 명확하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

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.

@ImJhoon

ImJhoon commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Swagger 기본 설정 확인입니다~

@ImJhoon
ImJhoon merged commit 6e5c084 into main Sep 25, 2026
2 checks passed
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.

2 participants