The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.
Follows the import procedure in README.md.
source/ the originating repository verbatim — 78 documents, 28 SVGs,
8 manifests, plus .source-revision recording the commit
final/ the SSOT
document.md 729 lines written from the 29 experiment documents, not
concatenated: what was predicted, what was measured, and
where the measurement itself was wrong
evidence/raw 125 outputs, flattened to <experiment>__<file> because
the originals collided (01-baseline.txt appeared three
times) and the audit only globs the top level
evidence/meta one per raw file; command and exitCode are null and the
README says why rather than inventing them
evidence/browser 22 captures
assets/ three diagrams through techviz
.techviz/ their VizSpecs
A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.
Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.
verify-pipeline.py passes. audit-records.py reports no issues.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
50 lines
2.8 KiB
Markdown
50 lines
2.8 KiB
Markdown
---
|
|
kind: CONCEPT
|
|
slug: adapter-inbound-grpc-c01
|
|
title: 인증이 예외 변환 바깥에 있어도 진단이 새지 않는다
|
|
topic: result-and-failure-algebra
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: concept:adapter-inbound-grpc-c01
|
|
evidenceCapturedOn: 2026-09-01
|
|
assets:
|
|
- key: adapter-inbound-grpc-c01
|
|
file: ../../../final/evidence/rendered/adapter-inbound-grpc-c01.svg
|
|
- key: adapter-inbound-grpc-c01-diagram
|
|
file: ../../../final/assets/diagrams/adapter-inbound-grpc-c01.svg
|
|
evidence:
|
|
- ../../../final/evidence/raw/adapter-inbound-grpc-c01.txt
|
|
source:
|
|
- 원본 분석 절은 analysis/15-adapter-inbound-grpc.md#L140 이다.
|
|
module: adapter-inbound-grpc
|
|
---
|
|
|
|
# 인증이 예외 변환 바깥에 있어도 진단이 새지 않는다
|
|
|
|
`ServerInterceptors.intercept(service, exceptionInterceptor, authenticationInterceptor)`는 인증을 예외 변환보다 바깥에 놓는다. 그런데도 인증 실패가 변환되지 않은 예외로 새지 않는 이유는 인증 인터셉터가 자기 예외를 스스로 삼키기 때문이다.
|
|
|
|
## 본문
|
|
|
|
<!-- body:start -->
|
|
|
|
`ServerInterceptors.intercept(service, exceptionInterceptor, authenticationInterceptor)` — gRPC 규약상 **마지막 인터셉터의 `interceptCall`이 먼저** 호출되므로 인증이 바깥, 예외 처리가 안쪽이다. 등록할 때 적은 순서와 실제로 요청을 감싸는 순서가 뒤집혀 있다.
|
|
|
|
## 바깥에서 안으로 놓이는 순서
|
|
|
|
:::evidence key="adapter-inbound-grpc-c01-diagram" alt="인증과 업무 처리와 예외 변환이 위에서 아래로 이어지는 구조" caption="인터셉터의 순서" zoom="false"
|
|
:::
|
|
|
|
## 인증이 예외 변환 바깥에 있어도 되는 이유
|
|
|
|
인증 인터셉터가 예외 처리 바깥에 있는데도 안전한 이유는 그것이 스스로 예외를 삼키기 때문이다. CLAUDE.md의 약속("정책이 `false`를 반환하거나 예외를 던진 요청은 ... 안정적인 `UNAUTHENTICATED` status/code/category로 종료된다")이 코드와 일치하고, 정책이 `false`를 돌려준 경우와 예외를 던진 경우가 모두 같은 `call.close(Status.UNAUTHENTICATED.withDescription(OperationalError.UNAUTHENTICATED.code()), trailersFor(...))`로 끝난다. 정책 진단은 클라이언트에 닿지 않는다.
|
|
|
|
두 인터셉터가 같은 일을 두 번 하는 구조가 아니다. 중복 아님.
|
|
|
|
## 분석 원문이 적은 순서 판정
|
|
|
|
:::evidence key="adapter-inbound-grpc-c01" alt="분석 문서 analysis/15-adapter-inbound-grpc.md 에서 이 기록의 근거 절을 그대로 잘라낸 15줄. 코드베이스를 측정한 것이 아니라 원본 판정이 무엇을 적었는지를 보여 준다." caption="analysis/15-adapter-inbound-grpc.md 발췌 — 15줄" zoom="true"
|
|
:::
|
|
|
|
<!-- body:end -->
|