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:
1 parent
f31ef142e8
commit
4913bf3ecc
10 files changed
+27
-78
No files matched your search
@@ -10,14 +10,13 @@ import time
|
||||
import urllib.request
|
||||
|
||||
API_HOST = os.environ.get("API_HOST", "http://localhost:8000")
|
||||
API_KEY = os.environ.get("API_KEY", "combooks-key-change-me")
|
||||
|
||||
|
||||
def _post(path: str, body: dict) -> dict:
|
||||
req = urllib.request.Request(
|
||||
f"{API_HOST}{path}",
|
||||
data=json.dumps(body).encode("utf-8"),
|
||||
headers={"Content-Type": "application/json", "X-API-Key": API_KEY},
|
||||
headers={"Content-Type": "application/json"},
|
||||
method="POST",
|
||||
)
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
@@ -25,7 +24,7 @@ def _post(path: str, body: dict) -> dict:
|
||||
|
||||
|
||||
def _get(path: str) -> dict:
|
||||
req = urllib.request.Request(f"{API_HOST}{path}", headers={"X-API-Key": API_KEY})
|
||||
req = urllib.request.Request(f"{API_HOST}{path}")
|
||||
with urllib.request.urlopen(req) as resp:
|
||||
return json.loads(resp.read())
|
||||
|
||||
|
||||
Reference in new issue
Block a user