Repository navigation
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
github-actions
Bot
requested review from
jjunh33,
leegain1,
sangrae2325,
tnals0924 and
xeoxxn
November 8, 2026 18:45
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣연관된 이슈
🎯 해결하려는 문제가 무엇인가요?
챗봇이 공지·행사·아카이빙·열린피드백을 미리 모아 검색 인덱스를 만들어야 하는데, 이 일을 하는 AI 서버 동기화 작업(
sync.py)은 학생 질문 없이 혼자 돈다. 넘겨받을 학생 JWT가 없어서 지금 백엔드 API로는 읽어 올 방법이 없다.(질문할 때 조회하는 재고·내 대여는 학생 JWT 전달로 해결했다 — #310)
❓ 왜 해결해야 하나요?
챗봇은 지금 직접 쓴 시드 문서로만 답한다. 학생회가 실제로 올린 공지·행사로 답해야 슬랑제 시연과 실제 운영이 의미가 있다.
⭐ 어떻게 해결했나요?
1. 새 모듈
api/ai-api(/v1/ai/**) — 컨벤션의 클라이언트 기준(architecture.md 2-2절)에 따라 AI 서버를 세 번째 클라이언트로 뒀다. GET만 있다.GET /v1/ai/noticesNoticeService.getNotices(끝까지 넘김)GET /v1/ai/eventsEventService.getPublishedEvents→getPublishedByIdsGET /v1/ai/archivesArchiveService.getArchives(null, null)→getArchiveGET /v1/ai/feedbacksFeedbackService.search+PageResult.fetchAllcreatedBy,answeredBy), 이미지·첨부는 내보내지 않는다. 특히 열린피드백 질문자2.
/v1/ai/**전용 보안 체인 (gateway:auth) — 기존SecurityConfig는 건드리지 않고@Order(1)체인을 옆에 뒀다.InternalTokenAuthFilter:X-Internal-Token을 설정값과MessageDigest.isEqual로 비교. 맞으면AI_SERVER권한으로 인증AI_SERVER는Roleenum에 넣지 않았다(JWT·PrincipalProvider를 건드리지 않으려고)JwtAuthFilter와 같은 이유 — 빈이면 모든 요청에 걸린다)3. 토큰: 새 비밀값 없이 기존
STREAM_AI_INTERNAL_TOKEN을 재사용한다(ai-server.internal-token).🧩 이 PR의 한계 & 트레이드오프
/v1/ai/**는 프록시에서 막지 않아 밖에서 주소는 닿는다. 토큰 하나가 방어선이다. 슬랑제 이후 프록시 내부망 제한을 검토한다⛓️ 기존 기능에 미치는 영향
/v1/ai/**만 새 체인이 맡는다STREAM_AI_INTERNAL_TOKEN재사용)🔀 Edge Case & 실패 시나리오
CommonErrorCode.UNAUTHORIZED, 기존 EntryPoint)/v1/ai/**→ 401 (새 체인은 JWT 필터가 없다)/v1/app/**→ 기존 체인이라 401STREAM_AI_INTERNAL_TOKEN미설정 →/v1/ai/**전부 401📋 검토한 대안과 선택 이유
/v1/app/**GET 허용: 컨트롤러는 안 늘지만AppApiUser를 기대하는 엔드포인트가 깨지고 role 모델에 예외가 생긴다app-api안에 패키지로: 경로가 학생 JWT 구역(/v1/app)이 되어 보안 규칙이 헷갈린다docs/plans/ai-internal-api-proposal.md(브랜치docs/#71-agent-plan)💬 리뷰 포인트
[r]AiServerSecurityConfig의 체인 순서(@Order(1)+securityMatcher)가 기존 체인과 겹치지 않는지[c]ai-api모듈 신설 / 토큰 재사용 결정이 괜찮은지[c]응답 필드가 충분한지 (승빈sync.py가 이 모양으로 작업 시작)확인한 것: 전체
compileJava·compileTestJava,ModularityTests,DomainImplAccessTests통과확인 못 한 것: 로컬에서 서버를 띄운 실제 호출(로컬 DB 없음). dev 배포 후 아래로 확인한다