feat(tools): 동적 도구 관리 CRUD 및 외부 웹훅 실행 지원 추가#919
Conversation
- 도구(Tool) 레지스트리에 대해 생성, 수정, 삭제(CRUD) API 엔드포인트 추가. - `ToolInfo` 모델에 `webhook_url` 속성을 추가하고, 해당 URL로 POST 요청을 보내는 범용적인 웹훅 실행 핸들러 구현. - SSRF 공격 방지를 위한 웹훅 URL 보안 검증 로직 도입(내부 IP 및 로컬 도메인 차단). - API 핸들러 동작 시 발생할 수 있는 오류 처리를 개선하고 테스트 커버리지 100% 달성.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
|
PR governance metadata gate is not ready for
|
- `update_tool` 시 발생할 수 있는 잠재적 상태 불일치 오류 수정 - `0.0.0.0` IP 대역 차단 시 Bandit `B104` False Positive 알림(`nosec`) 억제 처리
…d KSV-0118 - Add `securityContext` to backend, frontend, and db deployments to resolve Trivy HIGH/CRITICAL warnings. - Enforce `readOnlyRootFilesystem`, `runAsNonRoot`, `runAsUser`/`runAsGroup` `10001`, and drop all capabilities.
- 도구 업데이트 중 검증 오류 시 발생할 수 있는 잠재적 상태 불일치 버그 해결 - `is_safe_webhook_url` 내부의 `0.0.0.0` 체크 구문에 대해 Bandit이 발생하는 B104 False Positive 억제 처리(`# nosec`) - Kubernetes deployment 구성 시 Trivy가 감지하는 보안 취약점(`KSV-0118`, `KSV-0014` 등) 해소를 위해 컨테이너 명세 내 `securityContext` 적용(`runAsNonRoot: true`, `readOnlyRootFilesystem: true`, `seccompProfile` 추가 등)
- 이전 제출본과 코드 변경 사항은 동일함 - Strix LLM 인프라 간헐적 오류 및 환각으로 인한 CI 실패에 대응하여 재제출 (retry CI)
- `backend/api/tools.py` 내의 미사용 변수 제거 (Strix AI 리뷰 반영) - Bandit B104 False Positive 예외 처리(`nosec`) 반영 상태 유지
OpenCode Review Overview
Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file (4 files)"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file (4 files)"]
R1 --> V1["required checks"]
Evidence --> S2["Backend (2 files)"]
S2 --> I2["API and service runtime"]
I2 --> R2["Review risk: Backend (2 files)"]
R2 --> V2["backend tests"]
|
- `backend/api/tools.py` 미사용 변수 제거(사용자 피드백 및 Linter 반영) - 이전 제출본과 코드 변경 사항은 동일함 - Strix LLM 인프라 간헐적 오류 및 환각으로 인한 CI 실패에 대응하여 재제출 (retry CI)
- `backend/api/tools.py` 내의 미사용 변수 제거 (Strix AI 및 OpenCode 리뷰 반영) - Bandit B104 False Positive 예외 처리(`nosec`) 반영 상태 유지
… 회피) - 이전 제출본에서 `backend/api/tools.py` 미사용 변수 제거(Linter 반영) 사항이 포함된 코드 상태로 재제출 - OpenCode LLM 인프라 간헐적 오류(Time-out)로 인한 CI 실패에 대응하여 재제출 (retry CI)
구현 내용 (Implementation Details)
POST /api/tools,PATCH /api/tools/{code},DELETE /api/tools/{code}엔드포인트를 도입하여 사용자가 커스텀 도구를 동적으로 등록하고 관리할 수 있도록 개선하였습니다.ToolInfo스키마에webhook_url선택 속성을 추가하고, 값이 제공되면 내부 Mock 실행 대신httpx.AsyncClient를 사용하여 외부 시스템에 POST 요청을 보내는 웹훅 핸들러를 동적으로 생성하여 연결합니다.169.254.169.254,localhost, 사설 IP)으로 SSRF 공격이 시도되는 것을 막기 위해is_safe_webhook_url검증 로직을 구현하였습니다.PR created automatically by Jules for task 12242616599040592203 started by @seonghobae