API Key 인증 완전 제거

사내 운영 전제로 X-API-Key 인증을 전면 제거.
- app/core/auth.py 삭제
- routes.py에서 Depends(require_api_key) 모두 제거
- config.Settings에서 api_keys / api_key_set 제거
- .env / .env.example에서 API_KEYS 제거
- docker-compose.yml에서 API_KEYS 환경변수 제거 (KOSIMCSE_MODEL 추가)
- UI(index.html)에서 DEFAULT_API_KEY 상수 + X-API-Key 헤더 모두 제거
- scripts/sample_curl.sh, sample_python.py에서 키 헤더 제거
- tests: test_detect_requires_api_key → test_detect_no_auth_required로 갱신
- README: 인증 컬럼 제거, curl 예시에서 헤더 제거
This commit is contained in:
HyeongBaeYang committed 2026-05-14 08:58:28 +09:00
1 parent f31ef142e8
commit 4913bf3ecc
10 files changed
+27 -78

No files matched your search

+4 -10
View File
@@ -5,8 +5,6 @@ from fastapi.testclient import TestClient
from app.main import app
API_KEY = "combooks-key-change-me"
def test_health():
with TestClient(app) as client:
@@ -17,13 +15,14 @@ def test_health():
assert body["corpus_size"] >= 0
def test_detect_requires_api_key():
def test_detect_no_auth_required():
"""인증 제거 - 키 없이도 200 응답."""
with TestClient(app) as client:
resp = client.post(
"/v1/plagiarism/detect",
json={"doc_id": "x", "text": "테스트 본문"},
)
assert resp.status_code == 401
assert resp.status_code == 200
def test_detect_returns_schema():
@@ -34,7 +33,6 @@ def test_detect_returns_schema():
"doc_id": "t-1",
"text": "어린왕자는 작은 별에서 온 소년이다. 그는 여우를 만나 길들임을 배운다.",
},
headers={"X-API-Key": API_KEY},
)
assert resp.status_code == 200
body = resp.json()
@@ -53,12 +51,8 @@ def test_batch_flow():
{"doc_id": "b-1", "text": "앤 셜리는 초록 지붕 집에 입양된 소녀다."},
]
},
headers={"X-API-Key": API_KEY},
)
assert resp.status_code == 202
job_id = resp.json()["job_id"]
status = client.get(
f"/v1/plagiarism/batch/{job_id}",
headers={"X-API-Key": API_KEY},
)
status = client.get(f"/v1/plagiarism/batch/{job_id}")
assert status.status_code == 200