253 lines
5.7 KiB
Markdown
253 lines
5.7 KiB
Markdown
# TODO 및 기술 부채 정리
|
|
|
|
## 작성일: 2025년 8월 31일
|
|
|
|
## 1. 긴급 해결 필요 사항 🔴
|
|
|
|
### Git Merge Conflict 해결
|
|
**영향받는 파일들**:
|
|
- `/home/admin/auth-server/app/providers/gmail_passport.py` (HEAD vs eaed063)
|
|
- `/home/admin/auth-server/app/providers/gmail.py`
|
|
- `/home/admin/auth-server/app/api/gmail_refresh.py`
|
|
|
|
**충돌 내용**:
|
|
- HEAD: 최신 변경사항 (UUID/username 처리 개선)
|
|
- eaed063: rb8001 크론잡 트러블슈팅 관련 변경
|
|
|
|
**해결 방법**:
|
|
```bash
|
|
cd /home/admin/auth-server
|
|
git status
|
|
# 각 파일 수동 병합 필요
|
|
git add .
|
|
git commit -m "fix: merge conflicts - Slack OAuth implementation"
|
|
```
|
|
|
|
### DB 스키마 불일치
|
|
**문제**:
|
|
- `companies` 테이블 vs `workspaces` 테이블 공존
|
|
- `SlackWorkspace` 모델이 잘못된 FK 참조
|
|
- Relationship 주석 처리로 임시 해결 중
|
|
|
|
**현재 상태**:
|
|
```sql
|
|
-- 실제 DB
|
|
slack_workspaces.company_id → companies.id
|
|
workspace_members.workspace_id → workspaces.id
|
|
|
|
-- 모델 파일 (잘못됨)
|
|
SlackWorkspace.workspace_id → workspaces.id (실제로는 company_id)
|
|
```
|
|
|
|
**해결 계획**:
|
|
1. 데이터 백업
|
|
2. companies 데이터를 workspaces로 마이그레이션
|
|
3. FK 관계 재설정
|
|
4. 모델 파일 통일
|
|
|
|
## 2. 중요도 높음 🟡
|
|
|
|
### Frontend-Backend 인증 방식 불일치
|
|
**현재 상태**:
|
|
- Frontend: Gmail 방식 (`/auth/verify` 임시 코드)
|
|
- Slack: JWT 직접 전달 계획 → 임시 코드로 변경
|
|
|
|
**영향**:
|
|
- 불필요한 Redis 호출
|
|
- 60초 시간 제한
|
|
- 복잡한 인증 플로우
|
|
|
|
**해결 방법**:
|
|
1. Frontend `auth-context.tsx` 수정
|
|
- JWT 직접 처리 로직 구현
|
|
- Provider별 분기 처리
|
|
2. 또는 통합 인증 서비스 구현
|
|
|
|
### 하드코딩된 설정값
|
|
**위치 및 내용**:
|
|
```python
|
|
# /home/admin/auth-server/app/providers/slack.py
|
|
redirect_uri = "http://localhost:3000" # 하드코딩
|
|
login_callback_url = "https://auth.ro-being.com/auth/slack/login/callback"
|
|
|
|
# docker-compose.yml
|
|
DATABASE_URL=postgresql://robeings:robeings@192.168.219.45/main_db
|
|
```
|
|
|
|
**해결**:
|
|
- `.env` 파일로 이동
|
|
- 환경별 설정 분리 (dev/staging/prod)
|
|
|
|
## 3. 개선 사항 🟢
|
|
|
|
### 코드 품질
|
|
1. **에러 처리 개선**
|
|
- 구체적인 에러 메시지
|
|
- 사용자 친화적 에러 페이지
|
|
- 로깅 강화
|
|
|
|
2. **테스트 추가**
|
|
- 단위 테스트
|
|
- 통합 테스트
|
|
- E2E 테스트
|
|
|
|
3. **문서화**
|
|
- API 문서 (OpenAPI/Swagger)
|
|
- 시퀀스 다이어그램
|
|
- 배포 가이드
|
|
|
|
### 보안 강화
|
|
1. **토큰 관리**
|
|
- Refresh Token 구현
|
|
- 토큰 암호화 저장
|
|
- Rate Limiting
|
|
|
|
2. **OAuth 개선**
|
|
- PKCE 구현
|
|
- State 파라미터 강화
|
|
- Nonce 추가
|
|
|
|
## 4. 장기 로드맵 📅
|
|
|
|
### Q4 2025
|
|
- [ ] DB 스키마 통일
|
|
- [ ] Frontend 인증 방식 통일
|
|
- [ ] 환경변수 정리
|
|
- [ ] Git 충돌 해결
|
|
|
|
### Q1 2026
|
|
- [ ] Multi-tenant 아키텍처
|
|
- [ ] SSO 구현
|
|
- [ ] 2FA 지원
|
|
- [ ] 감사 로그
|
|
|
|
### Q2 2026
|
|
- [ ] 마이크로서비스 분리
|
|
- [ ] API Gateway 도입
|
|
- [ ] 중앙 인증 서버
|
|
- [ ] 모니터링 대시보드
|
|
|
|
## 5. 현재 작업 중인 파일 목록
|
|
|
|
### 수정된 파일 (commit 필요)
|
|
```bash
|
|
/home/admin/auth-server/
|
|
├── app/
|
|
│ ├── api/gmail_refresh.py (CONFLICT)
|
|
│ ├── models/workspace.py
|
|
│ ├── providers/
|
|
│ │ ├── gmail.py (CONFLICT)
|
|
│ │ ├── gmail_passport.py (CONFLICT)
|
|
│ │ └── slack.py (NEW IMPLEMENTATION)
|
|
├── docker-compose.yml
|
|
└── tokens/unknown_gmail.json
|
|
|
|
/home/heejae/frontend-customer/
|
|
└── src/contexts/auth-context.tsx
|
|
```
|
|
|
|
### 신규 생성된 문서
|
|
```bash
|
|
/home/heejae/DOCS/
|
|
├── troubleshooting/
|
|
│ └── 250831_slack_oauth_login_implementation.md
|
|
├── 300_architecture/
|
|
│ └── 380_authentication_system.md
|
|
└── plans/
|
|
└── 250831_todo_and_tech_debt.md (this file)
|
|
```
|
|
|
|
## 6. 명령어 참조
|
|
|
|
### Docker 관련
|
|
```bash
|
|
# Auth server 재시작
|
|
cd /home/admin/auth-server
|
|
docker compose down && docker compose up -d --build
|
|
|
|
# 로그 확인
|
|
docker logs auth-server --tail 100 -f
|
|
docker logs auth-redis --tail 50
|
|
```
|
|
|
|
### Git 관련
|
|
```bash
|
|
# 충돌 해결
|
|
git status
|
|
git diff <file>
|
|
git add <file>
|
|
git commit -m "fix: resolve conflicts"
|
|
|
|
# 변경사항 확인
|
|
git log --oneline -10
|
|
git diff HEAD~1
|
|
```
|
|
|
|
### DB 관련
|
|
```bash
|
|
# PostgreSQL 접속
|
|
PGPASSWORD=robeings psql -h localhost -U robeings -d main_db
|
|
|
|
# 테이블 구조 확인
|
|
\d companies
|
|
\d workspaces
|
|
\d slack_workspaces
|
|
\d users
|
|
\d slack_user_mapping
|
|
|
|
# 데이터 확인
|
|
SELECT * FROM companies;
|
|
SELECT * FROM workspaces;
|
|
SELECT * FROM slack_workspaces;
|
|
```
|
|
|
|
### Redis 관련
|
|
```bash
|
|
# Redis CLI
|
|
docker exec -it auth-redis redis-cli
|
|
|
|
# Keys 확인
|
|
KEYS oauth:state:*
|
|
KEYS auth:temp:*
|
|
|
|
# TTL 확인
|
|
TTL oauth:state:<uuid>
|
|
```
|
|
|
|
## 7. 연락처 및 참고
|
|
|
|
### 관련 시스템
|
|
- Auth Server: https://auth.ro-being.com (포트 9000)
|
|
- Frontend: https://ro-being.com (포트 3000)
|
|
- Gitea: https://git.ro-being.com
|
|
- PostgreSQL: 192.168.219.45:5432
|
|
- Redis: localhost:6379
|
|
|
|
### 환경변수 위치
|
|
- `/home/admin/auth-server/.env`
|
|
- `/home/heejae/frontend-customer/.env`
|
|
|
|
### 주요 문서
|
|
- [Slack OAuth 구현 상세](./troubleshooting/250831_slack_oauth_login_implementation.md)
|
|
- [인증 시스템 아키텍처](./300_architecture/380_authentication_system.md)
|
|
- [UUID 변환 시스템](./300_architecture/uuid_conversion_system.md)
|
|
|
|
## 8. 체크리스트
|
|
|
|
### 배포 전 확인사항
|
|
- [ ] Git 충돌 해결
|
|
- [ ] 환경변수 설정
|
|
- [ ] DB 마이그레이션
|
|
- [ ] Docker 이미지 빌드
|
|
- [ ] 로그 모니터링
|
|
- [ ] 에러 처리 테스트
|
|
- [ ] 롤백 계획 수립
|
|
|
|
### 테스트 시나리오
|
|
- [ ] Gmail 로그인
|
|
- [ ] Slack 로그인
|
|
- [ ] 기존 사용자 연동
|
|
- [ ] 신규 사용자 생성
|
|
- [ ] 토큰 만료 처리
|
|
- [ ] 에러 케이스
|
|
- [ ] 동시 로그인 |