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>
49 lines
2.0 KiB
Markdown
49 lines
2.0 KiB
Markdown
---
|
|
kind: REFERENCE
|
|
slug: messaging-schema-protobuf-f02
|
|
title: 신뢰할 수 없는 입력 쪽 경계를 먼저 테스트한다
|
|
topic: verification-path-coverage
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: reference:messaging-schema-protobuf-f02
|
|
verifiedOn: # 이 기록은 이번 회차에 실행 확인을 하지 않았다
|
|
source:
|
|
- analysis/messaging/messaging-schema-protobuf.md#L536
|
|
---
|
|
|
|
# 신뢰할 수 없는 입력 쪽 경계를 먼저 테스트한다
|
|
|
|
## 관계
|
|
|
|
- **registry 조회 로직이 세 codec에 복제돼 있다**
|
|
이 규칙의 근거는 같은 분석 리프의 판정이 소유한다.
|
|
|
|
## 목적
|
|
|
|
디코딩은 브로커에서 온 바이트를 받는 쪽이다. 지금은 자기 코드가 만든 바이트에 대한 방어가 남이 만든 바이트에 대한 방어보다 잘 검증돼 있다. 형제 leaf 는 반대로 되어 있다 — AvroRegistryBoundsTest.theEvolutionDecodeAppliesTheSameBound 가 정확히 이 각도를 덮는다.
|
|
|
|
## 규칙
|
|
|
|
1. 상한 검사가 인코딩 쪽과 디코딩 쪽에 각각 있는지 본다
|
|
ProtobufMessageCodec.java:104-108 의 if (encoded.length > maxBytes) 가 디코딩 쪽 검사다.
|
|
|
|
2. 각 검사에 테스트가 붙었는지 센다
|
|
인코딩 상한은 두 테스트가 덮고, 디코딩 분기를 겨냥한 테스트는 ProtobufCompatibilityTest 12개 중 없다.
|
|
|
|
3. 입력의 출처로 우선순위를 정한다
|
|
maxBytes 보다 큰 byte[] 로 decode 를 부르는 테스트를 먼저 추가한다.
|
|
|
|
## 적용 조건
|
|
|
|
같은 상한이 인코딩과 디코딩 양쪽에 걸려 있고 한쪽 입력만 외부에서 오는 모든 codec.
|
|
|
|
## 예외
|
|
|
|
디코딩 입력이 같은 프로세스에서 만들어진다고 타입이 보장하면 대상이 아니다. 이 codec 의 디코딩 입력은 브로커에서 온다.
|
|
|
|
## 예시
|
|
|
|
ProtobufMessageCodec.java:104-108 의 분기와 ProtobufCompatibilityTest 12개 전수. 확인 방법은 그 12개 중 decode 에 큰 입력을 주는 것이 없음을 보는 것이다.
|
|
|