G-1: 메신저 Webhook Relay + _send_to_room 실제 httpx 호출 구현 G-2: POST /api/tasks/bulk SR 대량작업 엔드포인트 (최대 100건) G-3: 라이선스 만료 알림 스케줄러 (매일 09:00 KST) G-4: 체험판 upgrade_banner 필드 + license.py 배너 로직 G-5: core/auto_rca.py + incidents/problem auto-rca 엔드포인트 G-6: core/deploy_impact.py + vibe impact-analysis 엔드포인트 G-7: core/ticket_classifier.py + SR 생성 시 AI 분류 + ai-suggestion API G-8: VulnPatchRecord 모델 + vuln_scan 패치추적 4개 엔드포인트 G-9: core/jira_sync.py + gateway Jira/Confluence 연동 엔드포인트 G-10: core/push_notify.py + routers/push.py + PushSubscription 모델 G-11: approvals 다중승인 (위임/서명/기한초과/마감연장) G-12: alembic.ini + migrations/ + cicd/migrate_to_postgres.sh 하네스: guardia-orchestrator 확장기능 Phase 반영 봇명령어: /sr /status /license /bulk 슬래시 명령어 추가 설치스크립트: setup/ (Ubuntu, CentOS, RHEL, Windows) --test 옵션 포함 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
106 lines
3.8 KiB
HTML
106 lines
3.8 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
GUARDiA 재고 대시보드 (HTML/JS) — 코드 리뷰 testcase
|
|
의도적 문제점:
|
|
- XSS 취약점 (innerHTML 사용)
|
|
- 인라인 스크립트 (CSP 미적용)
|
|
- 에러 처리 없음
|
|
- API 키 하드코딩
|
|
-->
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>GUARDiA 재고 대시보드</title>
|
|
<link rel="stylesheet" href="css/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>재고 관리 대시보드</h1>
|
|
|
|
<div class="search-bar">
|
|
<input type="text" id="searchInput" placeholder="품목명 검색...">
|
|
<button onclick="searchItems()">검색</button>
|
|
</div>
|
|
|
|
<div id="itemList" class="item-grid"></div>
|
|
|
|
<div class="add-form">
|
|
<h2>신규 품목 등록</h2>
|
|
<form onsubmit="addItem(event)">
|
|
<input type="text" id="newName" placeholder="품목명" required>
|
|
<input type="number" id="newQty" placeholder="수량" min="0" required>
|
|
<input type="number" id="newPrice" placeholder="가격" min="0" step="0.01" required>
|
|
<select id="newCategory">
|
|
<option value="">카테고리 선택</option>
|
|
<option value="전자기기">전자기기</option>
|
|
<option value="사무용품">사무용품</option>
|
|
<option value="소모품">소모품</option>
|
|
</select>
|
|
<button type="submit">등록</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// 보안이슈: API 키 하드코딩
|
|
const API_KEY = "secret-api-key-12345";
|
|
const API_BASE = "http://localhost:8081/api";
|
|
|
|
async function loadItems() {
|
|
const resp = await fetch(`${API_BASE}/items`, {
|
|
headers: { "X-API-Key": API_KEY }
|
|
});
|
|
const items = await resp.json();
|
|
renderItems(items);
|
|
}
|
|
|
|
function renderItems(items) {
|
|
const list = document.getElementById("itemList");
|
|
// XSS 취약점: innerHTML에 사용자 데이터 직접 삽입
|
|
list.innerHTML = items.map(item => `
|
|
<div class="item-card">
|
|
<h3>${item.name}</h3>
|
|
<p>재고: ${item.quantity}개</p>
|
|
<p>가격: ${item.price.toLocaleString()}원</p>
|
|
<p>카테고리: ${item.category || '미분류'}</p>
|
|
<button onclick="deleteItem(${item.id})">삭제</button>
|
|
</div>
|
|
`).join("");
|
|
}
|
|
|
|
async function searchItems() {
|
|
const q = document.getElementById("searchInput").value;
|
|
// 문제: 검색어 검증 없음
|
|
const resp = await fetch(`${API_BASE}/items/search?name=${q}`);
|
|
const items = await resp.json();
|
|
renderItems(items);
|
|
}
|
|
|
|
async function addItem(e) {
|
|
e.preventDefault();
|
|
const payload = {
|
|
name: document.getElementById("newName").value,
|
|
quantity: parseInt(document.getElementById("newQty").value),
|
|
price: parseFloat(document.getElementById("newPrice").value),
|
|
category: document.getElementById("newCategory").value,
|
|
};
|
|
await fetch(`${API_BASE}/items`, {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify(payload)
|
|
});
|
|
loadItems();
|
|
}
|
|
|
|
async function deleteItem(id) {
|
|
// 문제: 삭제 전 확인 없음
|
|
await fetch(`${API_BASE}/items/${id}`, { method: "DELETE" });
|
|
loadItems();
|
|
}
|
|
|
|
loadItems();
|
|
</script>
|
|
</body>
|
|
</html>
|