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] API Endpoint, Password Validation, File Upload Consistency #217

Open
IceCandle opened this issue Jan 25, 2025 · 3 comments
Open

[FIX] API Endpoint, Password Validation, File Upload Consistency #217

IceCandle opened this issue Jan 25, 2025 · 3 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@IceCandle
Copy link

๐Ÿ› ์–ด๋–ค ๋ฒ„๊ทธ์ธ๊ฐ€์š”?

API Endpoint Typo, Password Regex Mismatch, File Upload Validation Inconsistencies

๐Ÿฉน ์–ด๋–ค ์ƒํ™ฉ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ๋ฒ„๊ทธ์ธ๊ฐ€์š”?

In apis.ts, the endpoint POST /user/snuโ€”mail-verification/google-email contains a typo (snuโ€”mail with an em dash)

Frontend password validation (PASSWORD_REGEX) allows @#$!^*, while the backend expects @#$%^&+=!

Image Extensions: Frontend allows png, jpg, ..., heic, but backend may not support heif/heic.
File Size Limits: Frontend checks for 1MB (images) and 5MB (PDFs), but backend limits are undefined.

๐Ÿฉน ์˜ˆ์ƒํ–ˆ๋˜ ์ •์ƒ์ ์ธ ๊ฒฐ๊ณผ๋Š” ๋ฌด์—‡์ธ๊ฐ€์š”?

File: signUp/GoogleSocialSignUpButton.tsx
// Before
path: "user/snuโ€”mail-verification/google-email",
// After
path: "user/snu-mail-verification/google-email",
File: feature/auth/presentation/authPresentation.ts
// Before
const PASSWORD_REGEX =
/^(?=.[a-z])(?=.[A-Z])(?=.\d)(?=.[@#$!^])[A-Za-z\d@#$!^]{8,20}$/;
// After
const PASSWORD_REGEX =
/^(?=.[a-z])(?=.[A-Z])(?=.\d)(?=.[@#$%^&+=!])[A-Za-z\d@#$%^&+=!]{8,20}$/;
File: companyPresentation.ts
if (input.file.size > MAX_IMAGE_SIZE) {
setResponseMessage("์ด๋ฏธ์ง€๋Š” 1MB ์ดํ•˜๋กœ ์—…๋กœ๋“œํ•ด์ฃผ์„ธ์š”.");
}

๐Ÿ“ ์ฐธ๊ณ  ์ž๋ฃŒ

No response

@Yeonu-Kim
Copy link
Collaborator

Yeonu-Kim commented Jan 25, 2025

@IceCandle ๊ท€ํ•œ ์‹œ๊ฐ„ ๋‚ด์ฃผ์…”์„œ ์ •๋ง ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ํ”ผ๋“œ๋ฐฑ์— ๋Œ€ํ•œ ๋‹ต๋ณ€์„ ๋“œ๋ฆฌ๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

์งˆ๋ฌธ 1.
In apis.ts, the endpoint POST /user/snuโ€”mail-verification/google-email contains a typo (snuโ€”mail with an em dash)
-> ํ˜„์žฌ API ๋ฌธ์„œ์—์„œ๋Š” snu-mail-verification์œผ๋กœ ์š”์ฒญ์„ ๋ฐ›๊ณ  ์žˆ๊ณ , api.ts์—์„œ๋„ /user/snuโ€”mail-verification/google-email์ธ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์—†์—ˆ์Šต๋‹ˆ๋‹ค. ํ˜น์‹œ ํ™•์ธํ•˜์‹  ๋ถ€๋ถ„์„ ํผ๋งˆ๋งํฌ๋กœ ๋‹ฌ์•„์ฃผ์‹ค ์ˆ˜ ์žˆ์œผ์‹ค๊นŒ์š”?

์งˆ๋ฌธ 2.
Frontend password validation (PASSWORD_REGEX) allows @#$!^*, while the backend expects @#$%^&+=!
-> ํ™•์ธํ•ด์ฃผ์…”์„œ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. * ์ด ํฌํ•จ๋˜์ง€ ์•Š๋Š” ๊ฒƒ์„ ํ™•์ธํ–ˆ๊ณ , ๋ฐฑ์—”๋“œ์—์„œ *์„ ํฌํ•จํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์ˆ˜์ • ์š”์ฒญ๋“œ๋ ธ์Šต๋‹ˆ๋‹ค. ๋•๋ถ„์— ๋ฒ„๊ทธ๋ฅผ ์žก์„ ์ˆ˜ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค.

์งˆ๋ฌธ 3.
Image Extensions: Frontend allows png, jpg, ..., heic, but backend may not support heif/heic.
File Size Limits: Frontend checks for 1MB (images) and 5MB (PDFs), but backend limits are undefined.
-> ํ˜„์žฌ S3์— ์ง์ ‘ presigned url์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋ฏธ์ง€๋ฅผ ์—…๋กœ๋“œ ํ•˜๊ณ  ์žˆ์œผ๋ฉฐ, heif/heic์„ ๋ฐ›์ง€ ๋ชปํ•˜๋Š” ๊ฒƒ์€ ์•„๋‹Œ ๊ฒƒ์œผ๋กœ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ํ•œ๋ฒˆ ํ…Œ์ŠคํŠธํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
์ด๋ฏธ์ง€ ์šฉ๋Ÿ‰ ์ œํ•œ ๋˜ํ•œ S3์— ์ง์ ‘ ์ €์žฅํ•˜๋Š” ๊ฒƒ์ด๋ฏ€๋กœ ๋ฐฑ์—”๋“œ์—์„œ ๋”ฐ๋กœ ์ œํ•œํ•  ํ•„์š”๋Š” ์—†์—ˆ์Šต๋‹ˆ๋‹ค!


๋˜ ๋‹ค๋ฅธ ์ด์Šˆ๊ฐ€ ์žˆ๋‹ค๋ฉด ์ œ๋ณดํ•ด์ฃผ์‹œ๋ฉด ๊ฐ์‚ฌํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ฃผ์‹  ์˜๊ฒฌ ํ† ๋Œ€๋กœ ๋” ๋‚˜์€ ์„œ๋น„์Šค๋ฅผ ๋งŒ๋“ค๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ทธ๋ฆฌ๊ณ  ๊ฐœ์ธ์ ์œผ๋กœ ๊ถ๊ธˆํ•œ ๊ฒŒ ์žˆ๋Š”๋ฐ, ํ˜น์‹œ ์ด ํ”ผ๋“œ๋ฐฑ์€ ์–ด๋–ป๊ฒŒ ์ž‘์„ฑํ•˜์…จ๋‚˜์š”? ใ…‹ใ…‹ใ…‹ ์•ฝ๊ฐ„ AI์˜ ๋Š๋‚Œ์ด ์žˆ๋Š”๋ฐ ํ˜น์‹œ ์‚ฌ์šฉํ•˜์…จ๋‹ค๋ฉด ๊ต‰์žฅํžˆ ์ข‹์€ ๊ธฐ๋Šฅ์„ ๊ฐ€์ง„ ๊ฑฐ ๊ฐ™์•„์„œ ์•Œ๋ ค์ฃผ์‹œ๋ฉด ์ €๋„ ํ™œ์šฉํ•ด๋ณด๊ณ  ์‹ถ์Šต๋‹ˆ๋‹ค. ๐Ÿ˜Š

@IceCandle
Copy link
Author

localServer/apis.ts์˜ 83๋ฒˆ์งธ ์ค„์ด path: "user/snuโ€”mail-verification/google-email"์ž…๋‹ˆ๋‹ค.

CreateCompanyForm.tsx์—์„œ ์ž…๋ ฅ ํ•„๋“œ๋ฅผ ๋‹จ๊ณ„๋ณ„๋กœ ๋ถ„ํ• ํ•˜๊ฑฐ๋‚˜ ํ•„์ˆ˜ ์นธ์„ ํ‘œ์‹œํ•˜๋ฉด UI ๊ฐœ์„ ์— ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

Deepseek R1์— directory structure๋ฅผ ์ฃผ๊ณ  ํ•„์š”ํ•˜๋‹ค๊ณ  ๋‹ต๋ณ€ํ•œ ํŒŒ์ผ์„ ์ฒจ๋ถ€ํ•œ ๋‹ค์Œ ํ”ผ๋“œ๋ฐฑ์„ ๋‹ฌ๋ผ๊ณ  ์š”์ฒญํ–ˆ์Šต๋‹ˆ๋‹ค.

@Yeonu-Kim
Copy link
Collaborator

@IceCandle ๋น ๋ฅธ ๋‹ต๋ณ€ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
ํ”ผ๋“œ๋ฐฑ 1. localServer/apis.ts์˜ 83๋ฒˆ์งธ ์ค„์ด path: "user/snuโ€”mail-verification/google-email"์ž…๋‹ˆ๋‹ค.
-> ์•„ํ•˜ - ๊ฐ€ ์•„๋‹ˆ๋ผ โ€”๋กœ ๋“ค์–ด๊ฐ”๋‚˜๋ณด๋„ค์š”. ์ฐพ์•„์ฃผ์…”์„œ ์ •๋ง ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

ํ”ผ๋“œ๋ฐฑ 2. CreateCompanyForm.tsx์—์„œ ์ž…๋ ฅ ํ•„๋“œ๋ฅผ ๋‹จ๊ณ„๋ณ„๋กœ ๋ถ„ํ• ํ•˜๊ฑฐ๋‚˜ ํ•„์ˆ˜ ์นธ์„ ํ‘œ์‹œํ•˜๋ฉด UI ๊ฐœ์„ ์— ๋„์›€์ด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
-> ํ•„์ˆ˜ ์นธ ํ‘œ์‹œ๋Š” ์•„์ง ์ ์šฉํ•˜์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. ๋น ๋ฅด๊ฒŒ ์ ์šฉํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ใ…œใ…œ
์ž…๋ ฅ ํ•„๋“œ ๋‹จ๊ณ„๋ฅผ ๋ถ„ํ• ํ•˜๋Š” ๊ฑด ๊ธฐํš์˜ ๋ฌธ์ œ์ด๊ธฐ๋Š” ํ•œ๋ฐ, ๋‹จ๊ณ„๋ฅผ ๋‚˜๋ˆ„๊ฒŒ ๋˜๋ฉด ํ•œ๋ˆˆ์— ํผ์„ ๊ฒ€ํ† ํ•˜๊ธฐ๊ฐ€ ์–ด๋ ต๋‹ค๋Š” ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ธ€์„ ์ž‘์„ฑํ•˜๋Š” ๋Œ€์ƒ์ด ํšŒ์‚ฌ๊ฐ€ ์•„๋‹ˆ๋ผ ๊ทธ ํšŒ์‚ฌ์— ํˆฌ์žํ•˜๋Š” ํˆฌ์ž์‚ฌ์ด๋ฏ€๋กœ ํšŒ์‚ฌ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์™„๋ฒฝํ•˜๊ฒŒ ์•Œ์ง€ ์•Š์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜์„œ ํšŒ์‚ฌ ์ •๋ณด๋ฅผ ์ž‘์„ฑํ•œ ๋’ค์— ํ•œ๋ˆˆ์— ๊ฒ€ํ† ํ•˜๋ ค๋ฉด ํผ์ด ๊ธธ๋”๋ผ๋„ ํ•œ ํŽ˜์ด์ง€์— ์žˆ๋Š” ๊ฒƒ์ด ๋‚ซ๋‹ค๊ณ  ์ƒ๊ฐํ–ˆ์Šต๋‹ˆ๋‹ค.

ํ”ผ๋“œ๋ฐฑ 3. Deepseek R1์— directory structure๋ฅผ ์ฃผ๊ณ  ํ•„์š”ํ•˜๋‹ค๊ณ  ๋‹ต๋ณ€ํ•œ ํŒŒ์ผ์„ ์ฒจ๋ถ€ํ•œ ๋‹ค์Œ ํ”ผ๋“œ๋ฐฑ์„ ๋‹ฌ๋ผ๊ณ  ์š”์ฒญํ–ˆ์Šต๋‹ˆ๋‹ค.
-> ์˜ค Deepseek๋Š” ์ฒ˜์Œ ๋“ค์–ด๋ณด๋Š”๋ฐ ์—„์ฒญ ์ข‹์€ ๊ฑฐ ๊ฐ™๋„ค์š”!! ์ข‹์€ AI ์•Œ๋ ค์ฃผ์…”์„œ ์ •๋ง ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants