41d73a1이 패키지를 com.hyeonworks.grpc로 바꿨다. 소유자(2026-11-08)가 개인 도메인 이름을 공용 라이브러리에 쓰지 않기로 했다. 원래 이름 dev.caskeleton.grpc로 되돌리면 템플릿 재사용 체크리스트(「dev.caskeleton을 자기 패키지로 바꾼다」)가 파생 서비스의 라이브러리 import까지 깨뜨린다 (설계 05 NS1의 단점). 그래서 개인 도메인도 템플릿 자리표시 이름도 아닌 중립 이름 cakit을 쓴다(총괄 결정, 소유자가 맡김). - Java: com.hyeonworks.grpc → dev.cakit.grpc(폴더도 옮김) - proto: package hyeonworks.grpc.common.v1 → cakit.grpc.common.v1, 생성 Java 패키지 → cakit.grpc.common.v1.generated. proto 폴더도 Buf PACKAGE_DIRECTORY_MATCH에 맞게 옮겼다 - 시험의 가짜 서비스 이름(hyeonworks.document.v1 등)과 SpotBugs 제외의 클래스 이름, AutoConfiguration.imports 생성 Java 패키지를 dev.cakit.grpc 아래로 두지 않은 이유: 「생성 코드는 손으로 쓴 루트와 겹치지 않는다」는 규칙을 GrpcContractGeneratedCodeTest가 고정한다. 이름만 바꾸는 이 커밋에서 그 규칙까지 바꾸지 않는다. 만든 법: git mv로 폴더를 옮기고 grpc·grpc-advanced·config/spotbugs의 추적 파일에서 com.hyeonworks → dev.cakit, 그 밖의 hyeonworks → cakit(Gitea 주소 git.learn.hyeonworks.com은 제외)으로 바꾼 뒤 desktop spotlessApply(rc=0)로 import 순서만 맞췄다. 위험: proto 패키지는 wire 이름이다. 아직 배포 전이라 깨질 소비자가 없다. BREAKING CHANGE: Java 패키지 com.hyeonworks.grpc.* → dev.cakit.grpc.*, proto 패키지 hyeonworks.grpc.common.v1 → cakit.grpc.common.v1. 배포한 버전이 없어 옮길 소비자는 없다. Refs: design-docs repo-structure/05-library-repos.md 6.3절(Q3·Q4 정정은 총괄)
176 lines
10 KiB
XML
176 lines
10 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>
|
|
<!-- Generated sources (MapStruct / annotation processors): exclude from analysis. -->
|
|
<Match>
|
|
<Source name="~.*[\\/]generated[\\/].*" />
|
|
</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>
|
|
<!-- 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="dev.cakit.application.security.RequiresPermission" />
|
|
<Annotation name="org.springframework.context.annotation.Configuration" />
|
|
</Or>
|
|
</Match>
|
|
<!-- CT group 2 — designed for extension. Exception hierarchy roots (HttpClientException,
|
|
JpaPersistenceException, RedisOperationException, FileserverException and the optional
|
|
gRPC build's GrpcPlatformException, which GrpcDeadlineExceededException extends, each have
|
|
subclasses), ClientRuntime (BlockingClientRuntime extends it) and the abstract
|
|
JpaRepositoryFragmentSupport, which service repository fragments extend. -->
|
|
<Match>
|
|
<Bug pattern="CT_CONSTRUCTOR_THROW" />
|
|
<Or>
|
|
<Class name="dev.cakit.grpc.api.error.GrpcPlatformException" />
|
|
</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, and so do the
|
|
gRPC identifiers (GrpcIdentifiers.requireBounded, 256); 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.grpc.core.GrpcChannelProfileName" />
|
|
<Method name="<clinit>" />
|
|
</And>
|
|
<And>
|
|
<Class name="dev.cakit.grpc.core.GrpcServiceName" />
|
|
<Method name="<clinit>" />
|
|
</And>
|
|
</Or>
|
|
</Match>
|
|
<!-- FindSecBugs REDOS, the "x([class]*x)?" shape: GrpcMetadataKey.CANONICAL and
|
|
GrpcResolverSafetyPolicy.AUTHORITY. The only unbounded quantifier sits in a group that
|
|
repeats at most once, so a failing match gives back one character at a time from a single
|
|
star — n steps, not 2^n. Measured with java.util.regex on 1k/10k/100k-unit inputs built to
|
|
fail late ("a.a"... + "!"): time grows tenfold per tenfold input, 300k characters in under
|
|
7 ms. The metadata key is also capped at 64 characters before the pattern runs; the
|
|
resolver authority has no cap, and a linear match costs no more than reading the update. -->
|
|
<Match>
|
|
<Bug pattern="REDOS" />
|
|
<Or>
|
|
<And>
|
|
<Class name="dev.cakit.grpc.api.context.GrpcMetadataKey" />
|
|
<Method name="<clinit>" />
|
|
</And>
|
|
<And>
|
|
<Class name="dev.cakit.grpc.advanced.discovery.GrpcResolverSafetyPolicy" />
|
|
<Method name="<clinit>" />
|
|
</And>
|
|
</Or>
|
|
</Match>
|
|
<!-- FindSecBugs UNSAFE_HASH_EQUALS asks for a constant-time compare so that timing cannot leak a
|
|
secret digest. None of these digests is a secret: content SHA-256 the uploader supplied or
|
|
can compute (ContentPublishVerification, MetadataPointerContentPublisher,
|
|
FinalizeUploadApplicationUseCase), an integrity digest of the record's own policy snapshot
|
|
(ObjectOperationRecord), idempotency request/response digests the caller's own replay
|
|
produces (PostgreSqlIdempotencyStore), and a configured worker identity used as a lease
|
|
owner (PosterImageUploadIntent), and the gRPC channel profile fingerprints that
|
|
GrpcPlatformSnapshotService.driftAgainstRelease compares between two snapshots it was
|
|
handed — a configuration hash, published in the snapshot itself, compared offline with no
|
|
caller to time it. A comparison that leaks what the caller already knows leaks nothing. -->
|
|
<Match>
|
|
<Bug pattern="UNSAFE_HASH_EQUALS" />
|
|
<Or>
|
|
<And>
|
|
<Class name="dev.cakit.grpc.admin.GrpcPlatformSnapshotService" />
|
|
<Method name="~lambda\$driftAgainstRelease\$\d+" />
|
|
</And>
|
|
</Or>
|
|
</Match>
|
|
<!-- COMMAND_INJECTION: GrpcTlsTestMaterial.runKeytool starts the running JDK's own keytool
|
|
(java.home/bin) through ProcessBuilder with an argument list — no shell, so no argument is
|
|
parsed as a command. Its callers pass fixed flags, paths of a temporary directory the
|
|
fixture created, and the hostname a test names for its certificate. It lives in
|
|
grpc-testkit, which no production leaf depends on. -->
|
|
<Match>
|
|
<Bug pattern="COMMAND_INJECTION" />
|
|
<Class name="dev.cakit.grpc.testkit.netty.GrpcTlsTestMaterial" />
|
|
<Method name="runKeytool" />
|
|
</Match>
|
|
</FindBugsFilter>
|