[429] 정책 관련 테스트#106
Conversation
- LineMapper /임시 - FamilyLineMapper /임시 - PermissionLineMapper - PermissionMapper
하위 백로그 : 기능
104 : 조회
103 : 권한 변경
196 : 내 권한 상태 조회
하위 백로그 : 기능
104 : 조회
103 : 권한 변경
196 : 내 권한 상태 조회
[4] Authorize및 인가 응답 에러 메시지 분기 처리
Feat/409 permission
feat(upload): 첨부 파일 개수 admin일 경우 제한 없게끔 코드 변경
…ntication)) 으로 코드 적용
…oli-dev/pooli-be into feat/423-adminPolicy-misu
…github.com/pooli-dev/pooli-be into feat/423-adminPolicy-misu
Feat/18 alarm
test(question) : 문의 답변 service 테스트 코드 추가
[423] 관리자 정책/카테고리 추가
|
정책 위반: main에는 dev에서만 PR이 가능합니다. 이 PR은 자동으로 닫습니다. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoRun configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (149)
📝 WalkthroughWalkthroughThis PR introduces comprehensive authentication, authorization, and notification system overhauls. Key additions include: new authentication controllers with custom exception handlers, role-based method security, session and CSRF configurations, a complete notification and alarm management system with user settings, refactored permission and policy management with enhanced validation, a new question-and-answer module with answer creation and deletion workflows, upload service enhancements with user context validation, and supporting database migrations and MyBatis mappers across all modules. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/Client
participant AC as AuthController
participant AM as AuthenticationManager
participant SCR as SecurityContextRepository
participant CTR as CsrfTokenRepository
participant SC as SecurityContext
User->>AC: POST /api/auth/user/login (credentials)
AC->>AM: authenticate(credentials)
AM-->>AC: Authentication result
alt Authentication Success
AC->>AC: Sanitize user details (remove password)
AC->>SCR: Save context with sanitized principal
AC->>CTR: Generate & save CSRF token
AC-->>User: 200 OK + Set-Cookie (JSESSIONID, XSRF-TOKEN)
else Authentication Failure
AC-->>User: 401 Unauthorized
end
User->>AC: POST /api/auth/admin/login (credentials)
AC->>AM: authenticate(credentials)
alt Admin Role Check Fails
AC-->>User: 403 Forbidden (role denied)
else Admin Role Present
AC->>SCR: Save context
AC->>CTR: Generate CSRF token
AC-->>User: 200 OK
end
User->>AC: POST /api/auth/logout
AC->>SCR: Clear context
AC->>CTR: Reset token
AC-->>User: 200 OK + Clear cookies
sequenceDiagram
participant Admin as Admin User
participant NSC as NotiSendController
participant AHS as AlarmHistoryService
participant AHM as AlarmHistoryMapper
participant NLM as NotificationLineMapper
participant DB as Database
Admin->>NSC: POST /api/notifications (NotiSendReqDto)
NSC->>NSC: `@PreAuthorize` check (admin only)
NSC->>AHS: sendNotification(request)
AHS->>AHS: Validate targetType vs lineIds
alt DIRECT target
AHS->>AHS: Use provided lineIds
else ALL target
AHS->>NLM: findAllLineIds()
NLM->>DB: SELECT line_id WHERE deleted_at IS NULL
else OWNER/MEMBER target
AHS->>NLM: findLineIdsByRole(role)
NLM->>DB: JOIN family_line WHERE role = ?
end
AHS->>AHS: Validate target lines exist
AHS->>AHS: Build JSON payload (type=NOTIFICATION)
AHS->>AHM: insertNotificationAlarms(lineIds, code, payload)
AHM->>DB: INSERT INTO ALARM_HISTORY (bulk)
AHS-->>NSC: Success
NSC-->>Admin: 201 Created
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
Suggested Labels
Suggested Reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
|
|
정책 위반: main에는 dev에서만 PR이 가능합니다. 이 PR은 자동으로 닫습니다. |
개요
관련 BackLog
Resolves: (429)
PR 유형
PR Checklist
Summary by CodeRabbit
New Features
Bug Fixes