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: auth 관련 api가 무조건 200 리턴 버그 #779

Merged
merged 17 commits into from
Oct 1, 2023

Conversation

jimin52
Copy link
Member

@jimin52 jimin52 commented Sep 21, 2023

개요

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

작업 사항

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

목적

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

scarf005 and others added 11 commits August 21, 2023 09:56
ci: `patches/` 오류 수정을 main에 적용
도커파일에서 빌드시 devdependencies를 무시하나 tsc는 빌드에 필요
fix(build): typescript를 dependencies로 이전
ci: 버그 픽스용 비정기 배포
ci: 버그 픽스용 비정기 배포
토큰에서 id 정보 찾아서 유저 정보 반환하는 controller
@jimin52 jimin52 linked an issue Sep 21, 2023 that may be closed by this pull request
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
@scarf005 scarf005 changed the title 778 auth 관련 api 무조건 200 리턴 버그 fix: auth 관련 api가 무조건 200 리턴 버그 Sep 21, 2023
@jimin52 jimin52 self-assigned this Sep 21, 2023
@jimin52 jimin52 marked this pull request as draft September 21, 2023 08:45
@jimin52 jimin52 temporarily deployed to development September 21, 2023 08:46 — with GitHub Actions Inactive
router
.get('/search', search)
.get('/search', authValidate(roleSet.librarian), search)

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
@jimin52 jimin52 marked this pull request as ready for review September 21, 2023 08:54
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
image

수정 후에도 동일한 오류가 발생하고 있습니다. 사용한 명령어는 다음과 같습니다.

$ curl -I 'localhost:3000/api/auth/me'
$ curl -I 'localhost:3000/api/auth/me?id=100'

@jimin52
Copy link
Member Author

jimin52 commented Sep 25, 2023

헷갈려서 한참을 찾았네요.. 제가 만든건 users/me api 입니다.
옛날에 만들었던 auth/me api 에 버그가 있네요 ㅜㅜ
auth/me api 는 따로 버그를 수정해야 할 것 같습니다

@jimin52 jimin52 closed this Sep 26, 2023
@jimin52 jimin52 reopened this Sep 26, 2023
@jimin52 jimin52 temporarily deployed to development September 26, 2023 01:23 — with GitHub Actions Inactive
@jimin52 jimin52 requested a review from scarf005 September 26, 2023 01:23
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
image

curl -I 'http://localhost:3000/api/users/me'
curl -I 'http://localhost:3000/api/users/me?id=3'

500 에러가 발생하는 것 같습니다.

@jimin52 jimin52 temporarily deployed to development September 26, 2023 01:35 — with GitHub Actions Inactive
.post('/create', create)
.patch('/update/:id', authValidate(roleSet.librarian), update)
.patch('/myupdate', authValidate(roleSet.all), myupdate)
.get('/me', authValidate(roleSet.service), mydata)

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
@jimin52 jimin52 marked this pull request as draft September 26, 2023 01:37
@jimin52 jimin52 marked this pull request as ready for review September 26, 2023 01:40
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

잘 되는 것 같네요. 수고하셨습니다!

@jimin52 jimin52 merged commit c5bd7ae into develop Oct 1, 2023
@jimin52 jimin52 deleted the 778-auth-관련-api-무조건-200-리턴-버그 branch October 1, 2023 05:23
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.

/auth 관련 api 무조건 200 리턴 버그
2 participants