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>
This commit is contained in:
DongHyeonka
2026-09-04 22:51:59 +09:00
co-authored by Claude Opus 5
parent 43bccd08a8
commit b2963105a8
5017 changed files with 372751 additions and 4943 deletions
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="1038" height="371" viewBox="0 0 1038 371" role="img" aria-labelledby="diagram-title diagram-description">
<title id="diagram-title">BFF 가 저장하는 두 가지와 그 조회 키</title>
<desc id="diagram-description">Spring Security 의 자동 구성은 세션을 서블릿 컨테이너 메모리에, authorized client 를 InMemoryOAuth2AuthorizedClientService 에 둔다. 조회 경로가 다른데 이름이 비슷해 하나로 오해하기 쉽다. AuthenticatedPrincipalOAuth2AuthorizedClientRepository 는 principal 이름으로 찾고 조회 키에 session id 가 없다. 그래서 SPRING_SESSION_STORE_TYPE 을 redis 로 바꿔 세션을 옮겨도 토큰은 인스턴스 메모리에 남는다.</desc>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;bff-store-lookup-keys&quot;,&quot;profile&quot;:&quot;component-flow&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/keycloak-session-store/final/document.md&quot;,&quot;document_sha256&quot;:&quot;609353e10bfd37a9bbb6a79ecf2a32f3d3c02d5d161879a14ad4713e49e7e5e8&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;B-1 · 세션만 Redis 로 옮기면 — 반쪽만 옮겨진다&quot;,&quot;line&quot;:345}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" />
</marker>
<style>
:root { color-scheme: light; }
text { font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: #111827; }
.canvas { fill: #ffffff; }
.group-box { fill: #ffffff; stroke: #9ca3af; stroke-width: 1.4; stroke-dasharray: 7 5; }
.group-label-bg { fill: #ffffff; }
.group-label { font-size: 13px; font-weight: 650; fill: #374151; }
.edge { fill: none; stroke: #374151; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; marker-end: url(#arrow); }
.edge.style-dashed, .edge.semantic-dashed, .edge.assumption { stroke-dasharray: 7 5; }
.edge.style-dotted { stroke-dasharray: 2 5; }
.edge.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.edge.emphasis-muted { stroke: #9ca3af; }
.edge.emphasis-warning, .edge.kind-failure, .edge.kind-error { stroke: #dc2626; stroke-width: 2.2; }
.edge-label-bg { fill: #ffffff; }
.edge-label { font-size: 12px; font-weight: 560; text-anchor: middle; }
.node-shape { fill: #ffffff; stroke: #4b5563; stroke-width: 1.7; }
.node-shape.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.node-shape.emphasis-muted { stroke: #9ca3af; fill: #f9fafb; }
.node-shape.emphasis-warning { stroke: #d97706; stroke-width: 2; fill: #fffdf5; }
.node-shape.kind-database, .node-shape.kind-datastore, .node-shape.kind-storage { fill: #f8fafc; }
.node-shape.kind-queue, .node-shape.kind-event, .node-shape.kind-topic { fill: #fafafa; }
.node-shape.assumption { stroke-dasharray: 4 4; }
.storage-bottom, .controller-divider { fill: none; stroke: #4b5563; stroke-width: 1.4; }
.controller-led { fill: #4b5563; }
.actor-symbol { fill: none; stroke: #4b5563; stroke-width: 1.8; stroke-linecap: round; }
.actor-symbol.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.node-label { font-size: 14px; font-weight: 650; text-anchor: middle; }
.node-role { font-size: 10px; letter-spacing: 0.04em; text-anchor: middle; fill: #6b7280; }
.node-detail-divider { stroke: #d1d5db; stroke-width: 1; }
.node-detail { font-size: 11px; fill: #374151; }
.assumption-badge { font-size: 9px; font-weight: 700; fill: #92400e; }
.failure-mark { stroke: #dc2626; stroke-width: 4; stroke-linecap: round; }
.lifeline { stroke: #9ca3af; stroke-width: 1.2; stroke-dasharray: 5 5; }
.timeline-axis { stroke: #374151; stroke-width: 1.8; marker-end: url(#arrow); }
.timeline-stem { stroke: #6b7280; stroke-width: 1.3; }
.timeline-marker { fill: #ffffff; stroke: #374151; stroke-width: 1.7; }
.timeline-marker.primary { fill: #2563eb; stroke: #2563eb; }
.timeline-marker.warning { fill: #dc2626; stroke: #dc2626; }
.timeline-label { font-size: 13px; font-weight: 650; text-anchor: middle; }
.timeline-detail { font-size: 11px; fill: #4b5563; text-anchor: middle; }
</style>
</defs>
<rect class="canvas" width="1038" height="371" />
<polyline class="edge kind-write style-solid emphasis-normal" points="568.0,264.5 648.0,264.5 648.0,277.5 728.0,277.5" data-evidence="355-358" />
<rect class="edge-label-bg" x="650.0" y="257.0" width="44.0" height="22" rx="3" />
<text class="edge-label" x="672.0" y="272.0">저장</text>
<polyline class="edge kind-read style-solid emphasis-normal" points="220.0,202.0 300.0,202.0 300.0,264.5 380.0,264.5" data-evidence="332-341" />
<rect class="edge-label-bg" x="258.1" y="219.2" width="131.9" height="22" rx="3" />
<text class="edge-label" x="324.0" y="234.2">principal 이름으로 조회</text>
<polyline class="edge kind-read style-solid emphasis-normal" points="220.0,184.0 305.2,184.0 305.2,121.5 390.5,121.5" data-evidence="326-331" />
<rect class="edge-label-bg" x="286.8" y="138.8" width="85.0" height="22" rx="3" />
<text class="edge-label" x="329.2" y="153.8">세션 id 로 조회</text>
<polyline class="edge kind-write style-solid emphasis-normal" points="557.5,121.5 646.2,121.5 646.2,108.5 735.0,108.5" data-evidence="347-351" />
<rect class="edge-label-bg" x="648.2" y="101.0" width="44.0" height="22" rx="3" />
<text class="edge-label" x="670.2" y="116.0">저장</text>
<g id="node-request">
<g class="actor-symbol emphasis-primary" data-evidence="326-331"><circle cx="145.0" cy="171.0" r="11.0" /><line x1="145.0" y1="187.0" x2="145.0" y2="196.0" /><line x1="127.0" y1="197.0" x2="163.0" y2="197.0" /><line x1="145.0" y1="196.0" x2="130.0" y2="213.0" /><line x1="145.0" y1="196.0" x2="160.0" y2="213.0" /></g>
<text class="node-label" x="145.0" y="228.0">브라우저 요청</text>
</g>
<g id="node-app-session">
<rect class="node-shape kind-component emphasis-primary role-store" data-evidence="335-341" x="390.5" y="86.0" width="167.0" height="71.0" rx="7" />
<text class="node-label" x="474.0" y="113.0">Application Session</text>
<line class="node-detail-divider" x1="404.5" y1="134.0" x2="543.5" y2="134.0" />
<text class="node-detail" x="406.5" y="151.0">조회 키: 세션 id</text>
</g>
<g id="node-authorized-client">
<rect class="node-shape kind-component emphasis-warning role-store" data-evidence="335-341" x="380.0" y="229.0" width="188.0" height="71.0" rx="7" />
<text class="node-label" x="474.0" y="256.0">OAuth2AuthorizedClient</text>
<line class="node-detail-divider" x1="394.0" y1="277.0" x2="554.0" y2="277.0" />
<text class="node-detail" x="396.0" y="294.0">조회 키: principal 이름</text>
</g>
<g id="node-redis">
<rect class="node-shape kind-datastore emphasis-primary role-target" data-evidence="347-351" x="735.0" y="73.0" width="251.0" height="71.0" /><ellipse class="node-shape kind-datastore emphasis-primary role-target" cx="860.5" cy="73.0" rx="125.5" ry="13.0" /><path class="storage-bottom" d="M 735.0 144.0 A 125.5 13.0 0 0 0 986.0 144.0" />
<text class="node-label" x="860.5" y="100.0">Redis</text>
<line class="node-detail-divider" x1="749.0" y1="121.0" x2="972.0" y2="121.0" />
<text class="node-detail" x="751.0" y="138.0">SPRING_SESSION_STORE_TYPE=redis</text>
</g>
<g id="node-postgres">
<rect class="node-shape kind-datastore emphasis-primary role-target" data-evidence="355-358" x="728.0" y="242.0" width="265.0" height="71.0" /><ellipse class="node-shape kind-datastore emphasis-primary role-target" cx="860.5" cy="242.0" rx="132.5" ry="13.0" /><path class="storage-bottom" d="M 728.0 313.0 A 132.5 13.0 0 0 0 993.0 313.0" />
<text class="node-label" x="860.5" y="269.0">PostgreSQL</text>
<line class="node-detail-divider" x1="742.0" y1="290.0" x2="979.0" y2="290.0" />
<text class="node-detail" x="744.0" y="307.0">JdbcOAuth2AuthorizedClientService</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.1 KiB