Files
document-haness/docs/keycloak-session-store/final/assets/bff-store-lookup-keys/bff-store-lookup-keys.alt.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

1.7 KiB
Raw Blame History

BFF 가 저장하는 두 가지와 그 조회 키

Alternative text

세션 id 로 찾는 Application Session 과 principal 이름으로 찾는 OAuth2AuthorizedClient 가 각각 다른 저장소에 놓인 구성.

Long description

Spring Security 의 자동 구성은 세션을 서블릿 컨테이너 메모리에, authorized client 를 InMemoryOAuth2AuthorizedClientService 에 둔다. 조회 경로가 다른데 이름이 비슷해 하나로 오해하기 쉽다. AuthenticatedPrincipalOAuth2AuthorizedClientRepository 는 principal 이름으로 찾고 조회 키에 session id 가 없다. 그래서 SPRING_SESSION_STORE_TYPE 을 redis 로 바꿔 세션을 옮겨도 토큰은 인스턴스 메모리에 남는다.

Elements and evidence

  • 브라우저 요청 (actor): 쿠키에 세션 id 를 담아 온다. Evidence: L326L331.
  • Application Session (component): 누가 로그인했는지를 담는다. 세션 id 로 찾는다. Evidence: L335L341.
  • OAuth2AuthorizedClient (component): access · refresh token 을 담는다. principal 이름으로 찾는다. Evidence: L335L341.
  • Redis (datastore): 세션을 옮긴 곳. B-1 에서 여기까지는 옮겨졌다. Evidence: L347L351.
  • PostgreSQL (datastore): 토큰을 옮긴 곳. B-2 에서 따로 옮겨야 했다. Evidence: L355L358.

Relationships

  • OAuth2AuthorizedClient → PostgreSQL: 저장. Evidence: L355L358.
  • 브라우저 요청 → OAuth2AuthorizedClient: principal 이름으로 조회. Evidence: L332L341.
  • 브라우저 요청 → Application Session: 세션 id 로 조회. Evidence: L326L331.
  • Application Session → Redis: 저장. Evidence: L347L351.