Files
clean-architecture-frontend…/tests/integration
DongHyeonka 803d0f45aa fix(bootstrap): 업로드 401을 자격 증명을 붙인 주인에게 보낸다
문제: Fileserver 업로드 client가 서버 401을 AUTH_REQUIRED 실패로만
돌려준다. 세션은 authenticated로 남고 OIDC refresh도, 서버 상태 fence도
일어나지 않는다. JWT 모드(EXTERNAL_BEARER)에는 업로드에 세션 bearer를
붙일 지원 경로가 없어, 제품이 세션 owner를 붙잡아 scope fence 밖에서
부르게 된다. bootstrap은 "자격 증명 주인" 판정 순서를 attachCredentials와
reportServerUnauthenticated 두 곳에 따로 적는다. 매뉴얼 02 7절 업로드 예는
declare module로 capability를 보강해 check:types:node가 그 키를 못 본다.

고른 방법(R9-D2, R9-D13 대안):
- credentialOwner(authProfileId) 하나가 NONE·PRODUCT·SESSION을 정하고,
  V3 attachCredentials와 401 전달이 둘 다 그것을 읽는다(02-10).
- ProductCompositionContext.credentials를 더한다. V3와 같은
  attachCredentials와 같은 401 전달(onUnauthenticated)이다(추가만).
- FileserverUploadClientDependencies에 선택 onUnauthenticated를 더하고,
  client는 서버 401이면 본문과 상관없이 한 번 부른다(추가만).
- 업로드 capability 타입은 indexedDb처럼 템플릿이
  FeaturePlatformCapabilities에 opt-in 키 fileserverUpload로 선언한다.
  R9-D13 권하는 안(product-capabilities.ts가 contribution 파일에서 타입을
  가져옴)은 contribution 파일이 이미 product-capabilities.ts를 type
  import해서 그래프 순환이 된다(r9-fe 승인 2026-11-13).
- 매뉴얼 02 7절을 context.credentials를 펼치는 조각 둘로 바꾸고
  manual-code-block 표식을 단다. 시험은 제품 소유 파일 조각이 그 파일을
  통째로 바꾸게 한다.
버린 대안: 템플릿이 제품 capability를 모양으로 찾아 감싸기 — 제품이 정한
키 이름을 템플릿이 추측해야 한다.

위험·한계: 업로드 capability에 context.credentials를 펼치지 않은 제품은
그대로 401이 세션에 닿지 않는다(매뉴얼 02 7절·04에 적음). 쿠키 세션
모드 조각은 문장으로만 있고 시험 조각은 JWT 모드다.

검증: desktop, RED — 고치기 전 코드에서 새 업로드·주인 시험이 실패
(/tmp/claude-gates/r9b-pr1-red/exec_node.log). check:types·lint·
check:architecture rc=0(/tmp/claude-gates/r9b-pr1-quick). merge 단계는
PR 본문.

Refs: 1112/02-10, 1112/07-01, 1112/09-01
2026-11-13 19:02:07 +09:00
..