Files
messaging-library/config/spotbugs/exclude.xml
T
DongHyeonka f076f6accc refactor(messaging)!: Java 패키지를 dev.cakit.messaging으로 바꾼다
템플릿 재사용 체크리스트는 파생 서비스에게 dev.caskeleton 패키지를
자기 이름으로 바꾸라고 한다. 라이브러리 패키지가 dev.caskeleton.messaging
그대로면, 체크리스트를 따르는 서비스가 import까지 바꿔 라이브러리
클래스를 찾지 못한다. Maven group(dev.cakit.messaging)과 패키지가 다른
말을 하는 것도 첫 배포 뒤에는 고칠 수 없다.

첫 배포(1.0.0) 전에 한 번 바꾼다(설계 NS3, 이름은 소유자 2026-11-08
결정 dev.cakit). 기계적으로 만들었다: 소스 폴더 dev/caskeleton/messaging
44곳을 git mv로 dev/cakit/messaging으로, 파일 411개의
dev.caskeleton.messaging·dev/caskeleton/messaging 문자열을
dev.cakit.messaging·dev/cakit/messaging으로 바꿨다. Kafka 클라이언트
설정 키 caskeleton.messaging.credential.{registry,id}(이 라이브러리
안에서만 쓰는 상수)도 cakit.messaging.credential.*로 바꿨다.
SpotBugs 제외 목록에서 템플릿 타입(@RequiresPermission) 줄을 뺐다.

위험: 지금 쓰는 소비자는 템플릿 하나이고, 템플릿은 1.0.0을 받는
변경에서 import를 함께 바꾼다. 배포한 버전이 없으니 깨질 다른 소비자는
없다.

검증: 남은 caskeleton 문자열은 build-logic 패키지(배포하지 않는 빌드
도구)뿐이다(git grep -i caskeleton).

BREAKING CHANGE: dev.caskeleton.messaging.* 타입이 dev.cakit.messaging.*로
옮겨졌다. import 접두사를 바꾸면 된다. Kafka 설정 키
caskeleton.messaging.credential.*은 cakit.messaging.credential.*이다.

Refs: design-docs repo-structure/05-library-repos.md 6.3절, 15절 변경(2026-11-08)
2026-11-08 16:11:52 +09:00

200 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
feature-static-analysis-quality-contract D3/D4 — SpotBugs + FindSecBugs exclude filter.
SpotBugs (D3) and FindSecBugs (D4, via spotbugsPlugins) analyse bytecode. Inter-procedural
taint analysis has known limits (FindSecBugs false positives) and generated code carries
patterns the source author never wrote. Add ONLY confirmed false positives here, each as a
narrowly-scoped <Match> — never a blanket bug-pattern exclusion across all sources.
Reference: https://github.com/spotbugs/spotbugs / https://find-sec-bugs.github.io/
-->
<FindBugsFilter>
<!-- The messaging codec retention test measures whether a round trip retains per-message state.
Measuring retained memory requires forcing a collection first and again at the end;
without it the "after" reading is dominated by garbage that simply had not been collected
yet and the test could never distinguish a leak from ordinary allocation. Scoped to the
one test class, so an explicit gc anywhere else stays reportable. -->
<Match>
<Bug pattern="DM_GC"/>
<Source name="PlatformOverheadPerformanceTest.java"/>
</Match>
<!-- The outbox and inbox container tests apply the real shipped Flyway migration by reading it
from the classpath and executing it, which is the whole point: a test that re-declared the
schema inline would certify a schema nothing deploys. The SQL is a build artifact, not
input, and the database is a throwaway container. Scoped to these two classes so any other
dynamic SQL stays reportable. -->
<Match>
<Bug pattern="SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE"/>
<Source name="~(Inbox|Outbox)PostgresIT.java"/>
</Match>
<!-- =========================================================================================
Confidence MEDIUM (review 2026-11-01 08-07). Everything below was added when the report
level went from HIGH to MEDIUM. Each entry was judged against the code it names; defects
were fixed in the code instead of listed here. Counts are in QualityConventionsPlugin.
========================================================================================= -->
<!-- EI_EXPOSE_REP / EI_EXPOSE_REP2, pattern 1 of 4 — references that are not values.
SpotBugs calls any field "mutable" whose type has a set/add/remove/delete/write-shaped
method, and asks for a copy whenever one is stored from a parameter or returned. For a
field that holds a collaborator (a port, a repository, an EntityManager, a MeterRegistry,
an executor, a template, a settings bean), a handle (a channel, a future, a reflected
Method, an exception kept as a cause) or a nested setter-bound settings object, sharing the
reference is the design: constructor injection stores collaborators, and a copy would be a
different collaborator. The check stays on for the types where a copy IS the remedy —
collections, arrays, Date, ByteBuffer and JSON trees — so a value type that keeps a
caller's list or array is still reported. SpotBugs field types are exact names, not
patterns: an array of any other element type is not re-checked by this list. -->
<Match>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
<Not>
<Or>
<Field type="java.util.Collection"/>
<Field type="java.util.List"/>
<Field type="java.util.Set"/>
<Field type="java.util.SortedSet"/>
<Field type="java.util.NavigableSet"/>
<Field type="java.util.Queue"/>
<Field type="java.util.Deque"/>
<Field type="java.util.Map"/>
<Field type="java.util.SortedMap"/>
<Field type="java.util.NavigableMap"/>
<Field type="java.util.ArrayList"/>
<Field type="java.util.LinkedList"/>
<Field type="java.util.HashSet"/>
<Field type="java.util.LinkedHashSet"/>
<Field type="java.util.TreeSet"/>
<Field type="java.util.EnumSet"/>
<Field type="java.util.HashMap"/>
<Field type="java.util.LinkedHashMap"/>
<Field type="java.util.TreeMap"/>
<Field type="java.util.EnumMap"/>
<Field type="java.util.Date"/>
<Field type="java.nio.ByteBuffer"/>
<Field type="byte[]"/>
<Field type="char[]"/>
<Field type="short[]"/>
<Field type="int[]"/>
<Field type="long[]"/>
<Field type="float[]"/>
<Field type="double[]"/>
<Field type="boolean[]"/>
<Field type="java.lang.Object[]"/>
<Field type="java.lang.String[]"/>
<Field type="tools.jackson.databind.JsonNode"/>
<Field type="tools.jackson.databind.node.ObjectNode"/>
<Field type="tools.jackson.databind.node.ArrayNode"/>
<Field type="com.fasterxml.jackson.databind.JsonNode"/>
<Field type="com.fasterxml.jackson.databind.node.ObjectNode"/>
<Field type="com.fasterxml.jackson.databind.node.ArrayNode"/>
</Or>
</Not>
</Match>
<!-- EI pattern 3 of 4 — settings binding carriers. Setter-bound @ConfigurationProperties
JavaBeans are mutable by contract (a public setter opens more than the getter does), and
the constructor-bound records listed here have no invariant of their own: each is read
once at startup by the factory that compiles it into the runtime type, and that factory
copies (HttpClientProfileFactory and DynamicTargetAutoConfiguration Set.copyOf every list;
MessagingConfigurationCompiler copies into DestinationAccessPolicy and SchemaPolicy;
RedisRuntimeAutoConfiguration validates and maps; FileserverStartupValidator reads the
ancestors once). A settings record that validates a collection in its own constructor
copies it there instead (FileserverPlatformSettings.Security). -->
<Match>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
<Or>
<Class name="dev.cakit.messaging.autoconfigure.MessagingSettings"/>
<Class name="dev.cakit.messaging.autoconfigure.BrokerSecuritySettings$Access"/>
<Class name="dev.cakit.messaging.autoconfigure.DestinationSettings$Schema"/>
</Or>
</Match>
<!-- EI pattern 4 of 4 — the collection is already an unmodifiable copy. Each field below is
assigned an unmodifiable collection at construction (List/Set/Map.copyOf,
Collectors.toUnmodifiable*, Stream.toList, Collections.unmodifiable* over a fresh copy),
but through a branch, a stream or a private constructor fed by a copying factory, which
SpotBugs does not follow; it recognises only a field assigned straight from copyOf. Listed
by class and field, so another collection added to the same class is still reported. -->
<Match>
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2"/>
<Or>
<And><Class name="dev.cakit.messaging.api.header.MessageHeaders"/><Field name="values"/></And>
</Or>
</Match>
<!-- CredentialRuntime takes ownership of the secret array the registry resolved for it, so that
clear() overwrites the only copy. Copying in the constructor would leave the provider's
array behind, uncleared, which is the outcome the char[] field type exists to prevent. -->
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
<Class name="dev.cakit.messaging.security.CredentialRuntime"/>
<Method name="&lt;init&gt;"/>
</Match>
<!-- CT_CONSTRUCTOR_THROW (finalizer attack: a subclass's finalize() keeps a half-built object).
A final class cannot be attacked this way, and every class that could be made final was.
These three groups must stay subclassable. -->
<!-- CT group 1 — CGLIB proxies. @RequiresPermission is enforced by a method-security advisor,
and Spring Boot proxies with CGLIB, which subclasses the bean
(RequiresPermissionProxyabilityTest fails the build if such a class is final). The
Annotation matcher covers every class annotated at class level, including ones added
later. A class that annotates only some methods is proxied all the same but is not matched
here; name it when one appears. A @Configuration class is CGLIB-subclassed for its @Bean
methods for the same reason. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
<Or>
<Annotation name="org.springframework.context.annotation.Configuration"/>
</Or>
</Match>
<!-- FindSecBugs REDOS, one Match per constructor or static initialiser. Every pattern flagged
is "segment (separator segment)*" where the separator is a character the segment class
cannot contain ('.', '-', ';', or a class of those), so each input splits exactly one way
and backtracking is linear, not exponential. The application-core and messaging values
also check the length (at most 64-256 characters) before the pattern runs; JsonPathName and SafeSortField
match developer-declared paths; the SNS host comes from a URI host. -->
<Match>
<Bug pattern="REDOS"/>
<Or>
<And><Class name="dev.cakit.messaging.api.ContentType"/><Method name="&lt;clinit&gt;"/></And>
</Or>
</Match>
<!-- SQL_INJECTION_JDBC: transition() and transitionWithNextAttempt() append a fixed WHERE clause
to a SET clause that every caller passes as a string literal from this class; every value
is a bound parameter. The method names are the lambdas javac generates inside them. -->
<Match>
<Bug pattern="SQL_INJECTION_JDBC"/>
<Class name="dev.cakit.messaging.outbox.JdbcOutboxRepository"/>
<Method name="~lambda\$transition(WithNextAttempt)?\$\d+"/>
</Match>
<!-- PREDICTABLE_RANDOM: log sampling (SamplingTurboFilter.decide) and retry jitter
(BackoffCalculator's default source, HttpClientProfileAutoConfiguration.jitterRandom) only
need spread, not unpredictability; nothing security-relevant is derived from any of these
values. Knowing the next jitter tells a caller when a retry lands, which the retry policy
already bounds. SecureRandom would read as a security requirement that is not there. -->
<Match>
<Bug pattern="PREDICTABLE_RANDOM"/>
<Or>
<And><Class name="dev.cakit.messaging.policy.BackoffCalculator"/><Method name="~lambda\$new\$\d+"/></And>
</Or>
</Match>
<!-- MS_EXPOSE_REP on a static that is already immutable: a Jackson 3 ObjectMapper cannot be
reconfigured after build() (NotificationJsonMapper), and CertifiedEvidence.RECORDED is a
Stream.toList() result. -->
<Match>
<Bug pattern="MS_EXPOSE_REP"/>
<Or>
<And><Class name="dev.cakit.messaging.testkit.CertifiedEvidence"/><Method name="recorded"/></And>
</Or>
</Match>
</FindBugsFilter>