Files
document-haness/docs/keycloak-session-store/final/assets/b2-primary-key-overwrite/b2-primary-key-overwrite.alt.md
T

23 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 덮어쓰기를 만드는 기본키
## Alternative text
두 브라우저 세션이 서로 다른 세션 행을 갖지만 토큰 테이블에서는 같은 행을 가리키는 구성.
## Long description
토큰을 PostgreSQL 로 옮겨 다중 인스턴스 문제는 풀렸다. 그러나 기본키가 client_registration_id 와 principal_name 의 조합이고 세션 id 가 들어 있지 않다. 같은 사용자의 두 세션이 같은 행을 쓰므로 나중 로그인이 앞의 토큰을 덮어쓴다. 그리고 로그아웃하면 Redis 세션은 0 키로 정리되지만 PostgreSQL 에는 평문 refresh token 이 한 행 그대로 남는다.
## Elements and evidence
- **브라우저 A 세션** (component): 세션 id 가 다르다. Evidence: L745L747.
- **브라우저 B 세션** (component): 세션 id 가 다르다. Evidence: L745L747.
- **토큰 행** (datastore): 기본키에 세션 id 가 없어 둘이 같은 행을 쓴다. Evidence: L776L781.
- **로그아웃 후 남는 것** (datastore): Redis 세션은 0 키인데 여기는 1 행이 남는다. Evidence: L789L794.
## Relationships
- **브라우저 A 세션 → 토큰 행:** principal 이름. Evidence: L776L781.
- **브라우저 B 세션 → 토큰 행:** 같은 키 · 덮어쓰기. Evidence: L776L781.
- **토큰 행 → 로그아웃 후 남는 것:** 로그아웃 미정리. Evidence: L789L794.