Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/result-and-failure-algebra/concept/concept-adapter-inbound-grpc-c01.md
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
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>
2026-09-04 22:51:59 +09:00

2.8 KiB

kind, slug, title, topic, project, status, sourceRevision, rootTreeNode, evidenceCapturedOn, assets, evidence, source, module
kind slug title topic project status sourceRevision rootTreeNode evidenceCapturedOn assets evidence source module
CONCEPT adapter-inbound-grpc-c01 인증이 예외 변환 바깥에 있어도 진단이 새지 않는다 result-and-failure-algebra clean-architecture-backend-template 게시 전 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 concept:adapter-inbound-grpc-c01 2026-09-01
key file
adapter-inbound-grpc-c01 ../../../final/evidence/rendered/adapter-inbound-grpc-c01.svg
key file
adapter-inbound-grpc-c01-diagram ../../../final/assets/diagrams/adapter-inbound-grpc-c01.svg
../../../final/evidence/raw/adapter-inbound-grpc-c01.txt
원본 분석 절은 analysis/15-adapter-inbound-grpc.md#L140 이다.
adapter-inbound-grpc

인증이 예외 변환 바깥에 있어도 진단이 새지 않는다

ServerInterceptors.intercept(service, exceptionInterceptor, authenticationInterceptor)는 인증을 예외 변환보다 바깥에 놓는다. 그런데도 인증 실패가 변환되지 않은 예외로 새지 않는 이유는 인증 인터셉터가 자기 예외를 스스로 삼키기 때문이다.

본문

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" :::