개선관리 요구사항과 Google 로그인을 완료

This commit is contained in:
Yun Chan 2026-08-28 16:07:09 +09:00
parent cc0a15b7c6
commit 2a39636163
112 changed files with 10166 additions and 527 deletions

View file

@ -316,7 +316,8 @@ async def index_document(
"""문서 인덱싱(관리자, RBAC ADMIN 강제). content_hash 증분 + 청크 임베딩 적재.
임베딩은 무거운 작업 본래 BackgroundTasks/배치 워커 위임 권장(202 Accepted).
DSM verbatim 저작권(license C/D) source 등록 시점 external_llm_ok 가드 책임.
source_id는 사전 등록된 kb.source만 허용하고, 라이선스와 프로토콜 active 상태는
요청값이 아닌 DB 행으로 검증한다.
모델 미가용 embedding NULL 폴백(BM25 , degraded=True) 크래시 X.
"""
req = rag.IndexRequest(
@ -329,6 +330,7 @@ async def index_document(
try:
# 관리자 인덱싱은 RLS 미적용(쓰기 — kb 스키마 직접). role 주입 없이 acquire.
async with acquire() as conn:
await rag.validate_index_source(conn, body.source_id)
result = await rag.index_document(conn, req)
except rag.IndexPolicyViolation as e:
raise HTTPException(status.HTTP_422_UNPROCESSABLE_ENTITY, detail=str(e)) from e