Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] auth, user 서버 swagger 추가 및 버저닝 적용 #183 #185

Merged
merged 3 commits into from
Feb 16, 2025

Conversation

42inshin
Copy link
Collaborator

@42inshin 42inshin commented Feb 16, 2025

해당 사항 (중복 선택)

  • FEAT : 새로운 기능 추가 및 개선
  • FIX : 기존 기능 수정 및 정상 동작을 위한 간단한 추가, 수정사항
  • BUG : 버그 수정
  • REFACTOR : 결과의 변경 없이 코드의 구조를 재조정
  • TEST : 테스트 코드 추가
  • DOCS : 코드가 아닌 문서를 수정한 경우
  • REMOVE : 파일을 삭제하는 작업만 수행
  • RENAME : 파일 또는 폴더명을 수정하거나 위치(경로)를 변경
  • ETC : 이외에 다른 경우 - 어떠한 사항인지 작성해주세요.

설명

🔗 관련 이슈

해결한 이슈: closed #183

📝 작업 내용

version

  • 헤더에 version을 받아서 버저닝을 할 수 있도록 처리했습니다. 버전이 없는 경우에는 default로 들어올 수 있게 해뒀습니다.
  • 추후에 v2를 만들 경우를 대비해 확장성을 위해 작업해뒀습니다.
app.enableVersioning({
    type: VersioningType.HEADER,
    header: "version",
  });

Swagger

추가 내용

  • 인증은 Basic, access, refresh 각각 넣도록 처리되어 있습니다.
  • 스키마에 dto 열어보시면 상세설명 적혀 있습니다.
  • 새로고침 시에도 유지되게 처리했습니다.(persistAuthorization: true)

[추천]
accessToken의 iat 숫자를 많이 늘리면 오래도록 사용할 수 있습니다. https://jwt.io/에서 변경 가능합니다.
signature에 들어갈 secret key는 .env에 있으니 여유있는 토큰을 만들어서 편하게 쓰세요!

📸 스크린샷(optional)

이미지 설명
image Auth Swagger
image Auth authorizations
image User Swagger
image jwt.io에서 토큰 유효기간 늘리는 방법
image 스키마 설명

@42inshin 42inshin added FEAT 새로운 기능 추가 및 개선 🕹️BE 백엔드 작업 labels Feb 16, 2025
@42inshin 42inshin self-assigned this Feb 16, 2025
@42inshin 42inshin changed the title Be/dev/feat swagger/#183 [BE] auth, user 서버 swagger 추가 및 버저닝 적용 #183 Feb 16, 2025
Copy link
Collaborator

@juwon5272 juwon5272 left a comment

Choose a reason for hiding this comment

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

swagger까지! 고생하셨습니다!!

Copy link
Collaborator

@KSK9820 KSK9820 left a comment

Choose a reason for hiding this comment

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

최고의 가독성!! 감사합니다~!

@42inshin 42inshin merged commit a79612b into dev Feb 16, 2025
@42inshin 42inshin deleted the be/dev/feat_swagger/#183 branch February 16, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕹️BE 백엔드 작업 FEAT 새로운 기능 추가 및 개선
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] FEAT: Swagger 추가 및 header 버저닝
3 participants