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

fix: 778 auth 관련 api 무조건 200 리턴 버그 #780

Closed
wants to merge 12 commits into from

Conversation

jimin52
Copy link
Member

@jimin52 jimin52 commented Sep 21, 2023

개요
/auth 로 접속하면 1번 유저를 리턴하는 버그가 있었음

작업 사항
users/search 에 librarian validate 추가
users/me 엔드포인트 추가. 로그인한 유저만 가능하도록 쿠키에서 값 받게 변경

목적
본인 정보만 me 로 조회할 수 있게 하고 모든 유저 정보 접근은 사서만 가능하게 설정

scarf005 and others added 10 commits September 7, 2023 18:19
* refactor: v1 api와 다른 부분 수정

* refactor: books API schema default sort value 추가 및 callSign 오타 수정

* refactor: status: zod.enum -> zod.nativeEnum 변경

z.enum으로 했을때 number 반환값에 대한 처리가 되지 않아 enumStatus 생성 후 nativeEnum으로 변경하였습니다.

* feat: books//:id v2 구현

* feat: books/search v2 구현

* feat: book/update v2 구현

* feat: books/info/:id v2 구현

* refactor: BookNotFoundError import 오타 수정

* feat: books/info/sorted v2 구현

* feat: books/info/tag v2 구현

book_info.id 로 distinct가 되지 않는 오류가 있어요

* refactor: 의미에 맞는 변수명으로 수정 및 코드 간략화

Co-authored-by: scarf <[email protected]>

* refactor: book_info 중복 select 부분 처리

Co-authored-by: scarf <[email protected]>

* feat: books/donator v2 구현

v1 구현 시 얘기했었던 기부자가 유저가 아니더라도 수정될 수 있도록 수정 & email은 더이상 관리하지 않기 때문에 변수명에서 제거

* refactor: 대출 가능 여부 boolean 반환값으로 수정

kysely 사용중 select가 없을 경우 sql syntax 에러로 해당 부분 수정 및 boolean 값 반환되도록 수정

* feat: [get] books/create v2 구현

axios.get 동작 중 발생하는 에러(catch 영역)에 대한 처리를 어떻게 해야할지 모르겠어요

* fix: 임시로 타입 오류 무시

---------

Co-authored-by: scarf <[email protected]>
* build: prettier 설정

* style: prettier 적용

---------

Co-authored-by: nocontribute <>
* refactor: `/stock` 제거

#767 (comment)

* refactor: contracts에서 500번대 오류 제거

백엔드에서 복구 불가능한 오류일 시 반환하기 때문에, 프론트엔드에서 따로 처리하는 것이 좋을 것 같습니다.

* refactor: `/history` -> `/lendings`

#767 (comment)

Co-authored-by: jwoo <[email protected]>

* refactor: `/users ` 정리

#767 (comment)

Co-authored-by: honeyl3ee <[email protected]>

* refactor: `/tag` 서비스 임시 제거

고도화를 하기 위해서는 내부 구현을 바꾸어야 하는 문제가 있어 우선순위를 낮추었습니다.

주석처리를 할까 고민했으나 제거 이전 커밋(1565441)으로 체크아웃시 전체 코드를 확인 가능하기 때문에 복잡도 감소를 위해 코드를 제거하였습니다.

* refactor: `/books` 경로 정리

#767 (comment)
#767 (comment)

Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: jwoo <[email protected]>

* feat: swagger에서 1줄 요약 표시

---------

Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>
토큰에서 id 정보 찾아서 유저 정보 반환하는 controller
backend/src/v1/books/books.service.ts Dismissed Show dismissed Hide dismissed
session: false,
failureRedirect: `${oauthUrlOption.clientURL}/login?errorCode=${errorCode.ACCESS_DENIED}`,
}),
getToken,

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
session: false,
failureRedirect: `${oauthUrlOption.clientURL}/logout`,
}),
intraAuthentication,

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
.post('/create', create)
.patch('/update/:id', authValidate(roleSet.librarian), update)
.patch('/myupdate', authValidate(roleSet.all), myupdate)
.get('/me', authValidate(roleSet.all), mydata)

Check failure

Code scanning / CodeQL

Missing rate limiting High

This route handler performs
authorization
, but is not rate-limited.
@scarf005 scarf005 changed the title hotfix: 778 auth 관련 api 무조건 200 리턴 버그 fix: 778 auth 관련 api 무조건 200 리턴 버그 Sep 21, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

image

위 4개 커밋만 PR에 남아있으면 될까요?

@jimin52
Copy link
Member Author

jimin52 commented Sep 21, 2023

네 그럴 의도였는데 pr 이 이상하게 생성된것 같아요

@jimin52
Copy link
Member Author

jimin52 commented Sep 21, 2023

음.. 일단 제가 고친 부분때문에 타입 에러가 발생해서 수정해야할것 같네요

searchUsersById 서비스 함수의 종속성이 생각보다 많음.controller 에서 items 의 length 를 확인하도록
@jimin52 jimin52 temporarily deployed to development September 21, 2023 08:33 — with GitHub Actions Inactive
@jimin52 jimin52 temporarily deployed to development September 21, 2023 08:33 — with GitHub Actions Inactive
@jimin52
Copy link
Member Author

jimin52 commented Sep 21, 2023

일단 main 에 핫픽스하는 이 풀리퀘스트는 닫겠습니다

@jimin52 jimin52 closed this Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 완료
Development

Successfully merging this pull request may close these issues.

4 participants