패키지 dev.caskeleton.grpc와 proto 조직 이름 caskeleton은 백엔드 템플릿의 자리표시 이름이다. 템플릿 재사용 체크리스트는 파생 서비스에게 dev.caskeleton을 자기 패키지로 바꾸라고 한다. 라이브러리 패키지가 같은 이름이면 그 일괄 바꾸기가 라이브러리 import까지 바꿔 클래스를 못 찾게 된다. Maven group(com.hyeonworks.grpc)과 패키지가 다른 말을 하는 것도 같은 문제다. 첫 배포(1.0.0) 전에 한 번 바꾼다(설계 Q4 NS3). 지금 이 패키지를 쓰는 소비자는 템플릿에도 파생 서비스에도 없다. - Java: dev.caskeleton.grpc → com.hyeonworks.grpc(폴더도 옮김) - proto: package caskeleton.grpc.common.v1 → hyeonworks.grpc.common.v1, 생성 Java 패키지 → hyeonworks.grpc.common.v1.generated. 손으로 쓴 com.hyeonworks와 겹치지 않는다는 기존 규칙(생성 코드 시험)을 그대로 지킨다. proto 폴더도 Buf PACKAGE_DIRECTORY_MATCH에 맞게 옮겼다. - 테스트의 가짜 서비스 이름 caskeleton.document.v1 등도 hyeonworks로. 두 이름의 글자 수가 같아 길이·한도 시험에 영향이 없다. - SpotBugs 제외 목록의 클래스 이름, AutoConfiguration.imports. 만든 법: git mv로 폴더를 옮기고, grpc·grpc-advanced·config의 추적 파일에서 dev.caskeleton → com.hyeonworks, caskeleton → hyeonworks를 바꾼 뒤 spotlessApply로 import 순서만 다시 맞췄다. build-logic(배포하지 않는 빌드 도구)과 결정 기록 본문은 바꾸지 않았다. 위험: proto 패키지는 wire 이름이다. 지금 쓰는 곳이 없어 깨질 상대가 없지만, 이 커밋 앞의 schema와 buf breaking으로 비교하면 깨짐으로 나온다. 1.0.0 전 한 번의 변경으로 받아들인다. 검증(desktop): spotlessApply rc=0. ci·mainCheck·releaseRehearsal은 이 커밋 위 트리에서 돌렸다(다음 커밋들 본문). BREAKING CHANGE: Java 패키지 dev.caskeleton.grpc.* → com.hyeonworks.grpc.*, proto 패키지 caskeleton.grpc.common.v1 → hyeonworks.grpc.common.v1. import와 proto import를 새 이름으로 바꾼다. Refs: design-docs repo-structure/05-library-repos.md 6.3절 NS3
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="com.hyeonworks.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="com.hyeonworks.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="com.hyeonworks.grpc.core.GrpcChannelProfileName" />
|
|
<Method name="<clinit>" />
|
|
</And>
|
|
<And>
|
|
<Class name="com.hyeonworks.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="com.hyeonworks.grpc.api.context.GrpcMetadataKey" />
|
|
<Method name="<clinit>" />
|
|
</And>
|
|
<And>
|
|
<Class name="com.hyeonworks.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="com.hyeonworks.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="com.hyeonworks.grpc.testkit.netty.GrpcTlsTestMaterial" />
|
|
<Method name="runKeytool" />
|
|
</Match>
|
|
</FindBugsFilter>
|