Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/schema-and-wire-models/concept/concept-adapter-outbound-httpclient-c06.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

3.1 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-outbound-httpclient-c06 와이어 바이트와 디코드 바이트를 따로 세고, 읽는 도중에 상한을 건다 schema-and-wire-models clean-architecture-backend-template 게시 전 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 concept:adapter-outbound-httpclient-c06 2026-09-01
key file
adapter-outbound-httpclient-c06 ../../../final/evidence/rendered/adapter-outbound-httpclient-c06.svg
key file
adapter-outbound-httpclient-c06-diagram ../../../final/assets/diagrams/adapter-outbound-httpclient-c06.svg
../../../final/evidence/raw/adapter-outbound-httpclient-c06.txt
원본 분석 절은 analysis/11-adapter-outbound-httpclient.md#L403 이다.
adapter-outbound-httpclient

와이어 바이트와 디코드 바이트를 따로 세고, 읽는 도중에 상한을 건다

예산이 둘로 나뉘어 있고 강제 시점이 버퍼링 이후가 아니라 읽는 도중이며, 원격이 준 status는 채택되지 않는다.

본문

ResponseSizeLimiter와이어 바이트와 디코드 바이트를 따로 센다 — "a compressed payload passes a wire check and then expands, so a single limit either rejects legitimate traffic or lets a decompression bomb through."

예산이 강제되는 자리

:::evidence key="adapter-outbound-httpclient-c06-diagram" alt="와이어 바이트 예산, 읽는 도중 상한 강제, 디코드 바이트 예산, 오류 본문 제한 읽기가 읽는 순서대로 쌓여 있다" caption="응답 크기 예산이 강제되는 자리" zoom="false" :::

버퍼링이 끝난 뒤에는 늦다

CountingBoundedInputStream이 상한을 읽는 도중에 적용한다 — "a response that is discovered to be too large only once it is fully buffered has already cost the memory the limit exists to protect." BoundedErrorBody는 오류 본문을 RFC 9457 문서를 해독할 만큼만 읽고, "The bytes never reach an exception message or a log." toString()은 길이와 truncated 여부만 낸다.

원격이 준 status는 버린다

RemoteProblemDecoder의 규칙 한 줄이 이 계층의 성격을 요약한다 — "The wire status wins. A remote status member is read and discarded, because trusting it would let an upstream relabel a 503 as a 400 and change our retry behaviour from its own body." 확장 속성도 allowlist로 걸러 "an upstream cannot inject unbounded attributes into our telemetry." test 넷이 그 갈래를 고정한다(mapsProblemJsonWithoutTrustingBodyStatus·dropsExtensionsThatAreNotAllowlisted·treatsANonProblemContentTypeAsAnEmptyProblem·survivesAnUnparseableProblemDocument).

ResponseSizeLimiter 참조 위치

:::evidence key="adapter-outbound-httpclient-c06" alt="코드베이스에서 ResponseSizeLimiter 를 검색한 출력 20줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="ResponseSizeLimiter 코드베이스 검색 — 20줄 · exit 0" zoom="true" :::