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>
59 lines
3.6 KiB
Markdown
59 lines
3.6 KiB
Markdown
---
|
|
kind: CONCEPT
|
|
slug: adapter-outbound-cache-redis-c12
|
|
title: 탈출구가 두 겹의 사전 승인으로 닫혀 있다
|
|
topic: admission-budget-and-backpressure
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: concept:adapter-outbound-cache-redis-c12
|
|
evidenceCapturedOn: 2026-09-01
|
|
assets:
|
|
- key: adapter-outbound-cache-redis-c12
|
|
file: ../../../final/evidence/rendered/adapter-outbound-cache-redis-c12.svg
|
|
- key: adapter-outbound-cache-redis-c12-diagram
|
|
file: ../../../final/assets/diagrams/adapter-outbound-cache-redis-c12.svg
|
|
evidence:
|
|
- ../../../final/evidence/raw/adapter-outbound-cache-redis-c12.txt
|
|
source:
|
|
- 원본 분석 절은 analysis/10-adapter-outbound-cache-redis.md#L684 이다.
|
|
module: adapter-outbound-cache-redis
|
|
---
|
|
|
|
# 탈출구가 두 겹의 사전 승인으로 닫혀 있다
|
|
|
|
`RedisRawGateway`에는 `execute(String, byte[]...)`가 없다. 원시 명령은 정책 카탈로그의 분류와 배포의 승인 등록 둘 다를 통과해야 하고, 어느 쪽도 요청 시점에 결정되지 않는다.
|
|
|
|
## 본문
|
|
|
|
<!-- body:start -->
|
|
|
|
`RedisRawGateway`의 javadoc이 존재 이유와 한계를 함께 적는다 — "There is no `execute(String, byte[]...)` here or anywhere else in the SDK. The escape hatch exists because **some commands genuinely have no typed form worth building**, not because arbitrary command execution is acceptable; every one of them is named, bounded, and audited before it can be sent."
|
|
|
|
## 원시 명령이 지나야 하는 두 문
|
|
|
|
:::evidence key="adapter-outbound-cache-redis-c12-diagram" alt="정책 카탈로그 분류에서 배포 승인 등록으로, 다시 원시 게이트웨이로 이어지는 왼쪽에서 오른쪽 흐름" caption="원시 명령이 지나야 하는 두 문" zoom="false"
|
|
:::
|
|
|
|
승인이 **두 개의 독립된 문**을 모두 통과해야 한다(`RawCommandApprovals`).
|
|
|
|
1. 명령이 정책 카탈로그에서 `RAW_ONLY`로 분류돼 있어야 한다 — "the organization's decision about which commands may ever leave through this door"
|
|
1. 배포가 그 명령에 대한 승인(`ApprovedRawCommand`)을 등록해야 한다
|
|
|
|
"Neither alone is enough, and neither is decided at request time." 그리고 R3/R4는 어느 쪽이든 거부된다.
|
|
|
|
## RedisRawGateway 참조 위치
|
|
|
|
:::evidence key="adapter-outbound-cache-redis-c12" alt="코드베이스에서 RedisRawGateway 를 검색한 출력 7줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="RedisRawGateway 코드베이스 검색 — 7줄 · exit 0" zoom="true"
|
|
:::
|
|
|
|
## 승인이 배포 산출물인 이유
|
|
|
|
`ApprovedRawCommand`는 **배포 산출물**이다 — 명령 identity, 최대 인자 수, 요청/응답 바이트 상한, 타임아웃, 응답 디코더를 프로세스 시작 전에 고정한다. 토큰은 `RawCommandApprovals`만 발급하고, 검증은 (a) 토큰 타입이 내부 record인지, (b) **발급 레지스트리 인스턴스가 같은지**(`issued.origin != this`), (c) 정책 id가 일치하는지, (d) 제시된 승인이 등록된 것과 같은지 넷을 본다.
|
|
|
|
## 키 위치를 모르면 기본이 거부다
|
|
|
|
**`RawMovableKeys`가 이 패키지에서 가장 흥미롭다.** movable key spec(예: `SORT`)은 키 위치를 인자 목록이 결정하므로 정적으로 알 수 없고, 그러면 네임스페이스 검사를 할 수 없다. 기본은 여전히 거부다. 예외로 `SORT`/`SORT_RO` 파서 하나가 등록돼 있는데, 그 설계가 명시적이다 — "a parser that knows **exactly one command shape** and refuses everything else."
|
|
|
|
<!-- body:end -->
|