-
Notifications
You must be signed in to change notification settings - Fork 0
feat(Menu): 관리자 접근 제한 #63
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
The head ref may contain hidden characters: "feature/#62-\uAD00\uB9AC\uC790store\uC811\uADFC\uC81C\uD55C"
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,7 +42,7 @@ public ResponseEntity<?> refreshToken(@RequestBody RefreshTokenRequest request){ | |||||||||||||||
|
|
||||||||||||||||
| long currentAccessTokenExpiration = accessTokenExpiration; | ||||||||||||||||
| if (role.equals("SUPER_ADMIN")) { | ||||||||||||||||
| currentAccessTokenExpiration = 7L * 24 * 60 * 60 * 1000L; // 7일 | ||||||||||||||||
| currentAccessTokenExpiration = 100L * 24 * 60 * 60 * 1000L; // 100일 | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
44
to
46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 액세스 토큰 만료 시간이 너무 긴 것에 대한 보안 우려 SUPER_ADMIN 역할의 액세스 토큰 만료 시간을 100일로 설정하는 것은 보안상 위험할 수 있습니다:
다음과 같이 더 짧은 만료 시간으로 수정하는 것을 권장합니다: - currentAccessTokenExpiration = 100L * 24 * 60 * 60 * 1000L; // 100일
+ currentAccessTokenExpiration = 24 * 60 * 60 * 1000L; // 24시간📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| // 리프레시 토큰 유효성 검증 | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,11 @@ public enum ErrorMessage { | |
|
|
||
| // menu | ||
| MENU_PARAMETER_EMPTY("메뉴 생성 시 파라미터 정보가 없습니다.", "menu001"), | ||
| MENU_NOT_FOUND("해당 메뉴를 찾을 수 없습니다.", "menu001"), | ||
| MENU_NOT_FOUND("해당 메뉴를 찾을 수 없습니다.", "menu002"), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain기존 에러 코드 변경에 대한 하위 호환성 검증 필요
다음 스크립트를 실행하여 기존 에러 코드 "menu001"을 참조하는 코드가 있는지 확인해주세요: 🏁 Script executed: #!/bin/bash
# Description: 기존 "menu001" 에러 코드를 참조하는 코드 검색
# Expected: 기존 코드에서 "menu001" 참조가 있다면 업데이트 필요
echo "=== 기존 menu001 에러 코드 참조 검색 ==="
rg -n "menu001" --type javaLength of output: 235 기존 스크립트 실행 결과, 아래 위치에서 여전히
제안 사항
🤖 Prompt for AI Agents |
||
| MENU_CREATION_UNAUTHORIZED("메뉴 생성 권한이 없습니다.(슈퍼계정 or 주점 관리자만 가능)", "menu003"), | ||
| MENU_VIEW_UNAUTHORIZED("메뉴 보기 권한이 없습니다.(슈퍼계정 or 주점 관리자만 가능)", "menu004"), | ||
| MENU_UPDATE_UNAUTHORIZED("메뉴 수정 권한이 없습니다.(슈퍼계정 or 주점 관리자만 가능)", "menu005"), | ||
| MENU_DELETE_UNAUTHORIZED("메뉴 삭제 권한이 없습니다.(슈퍼계정 or 주점 관리자만 가능)", "menu006"), | ||
|
|
||
| // store | ||
| STORE_PARAMETER_EMPTY("주점 생성 시 파라미터 정보가 없습니다.", "store001"), | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.nowait.domaincorerdb.menu.exception; | ||
|
|
||
| import com.nowait.common.exception.ErrorMessage; | ||
|
|
||
| public class MenuCreationUnauthorizedException extends RuntimeException { | ||
| public MenuCreationUnauthorizedException() { | ||
| super(ErrorMessage.MENU_CREATION_UNAUTHORIZED.getMessage()); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.nowait.domaincorerdb.menu.exception; | ||
|
|
||
| import com.nowait.common.exception.ErrorMessage; | ||
|
|
||
| public class MenuDeleteUnauthorizedException extends RuntimeException { | ||
| public MenuDeleteUnauthorizedException() { | ||
| super(ErrorMessage.MENU_DELETE_UNAUTHORIZED.getMessage()); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.nowait.domaincorerdb.menu.exception; | ||
|
|
||
| import com.nowait.common.exception.ErrorMessage; | ||
|
|
||
| public class MenuUpdateUnauthorizedException extends RuntimeException { | ||
| public MenuUpdateUnauthorizedException() { | ||
| super(ErrorMessage.MENU_UPDATE_UNAUTHORIZED.getMessage()); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.nowait.domaincorerdb.menu.exception; | ||
|
|
||
| import com.nowait.common.exception.ErrorMessage; | ||
|
|
||
| public class MenuViewUnauthorizedException extends RuntimeException { | ||
| public MenuViewUnauthorizedException() { | ||
| super(ErrorMessage.MENU_VIEW_UNAUTHORIZED.getMessage()); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
하드코딩된 storeId 값을 검토해야 합니다.
모든 JWT 인증 사용자에게 동일한
storeId(5000L)가 할당되고 있습니다. 이는 관리자 접근 제한 기능의 목적에 맞지 않을 수 있습니다.다음 중 하나를 고려해보세요:
🤖 Prompt for AI Agents