fix: 3차 확인 리뷰의 Minor 19건을 고친다
문제: 3차 수정의 확인 리뷰가 새 Important 없이 Minor 19건을 남겼다. 동작에 닿는 것이 셋이다. JDK read-idle watchdog이 공용 ForkJoinPool에서 돌아 그 풀이 바쁘면 300ms timeout이 6초 가까이 늦었다. 붙여 쓴 -x<task>를 verifyStrictLaneStages가 읽지 않아 lane을 뺀 workflow가 통과했다. 사용자 전송이 중간 클래스를 거쳐 @SystemCaller bean을 부르면 ArchUnit 규칙을 지났다. 잠금 대기 검사기는 FK·trigger·REINDEX와 lock_timeout = 0을 못 봤고, 쿼터 보정 SQL은 코드와 다른 모양의 행을 넣었다. 방법: 영역별 4묶음이 맡은 Minor만 test-driven-development 절차로 고쳤다(재리뷰 README 12절). - watchdog은 전용 데몬 스레드 하나에서 돌고 스트림을 닫으면 작업을 취소한다. read당 비용은 그대로다(21–24ns). - 사용자 전송 → @SystemCaller는 직접·간접 의존 모두 거부한다. 리뷰가 권한 직접 의존 검사는 중간 클래스 하나로 다시 열려서 버렸다. - 검사기를 보강하면서 새로 걸린 이미 배포된 마이그레이션 5개는 내용을 바꾸지 않고 동결 목록에 더했다(main과 blob이 같다). - 비밀 목록 bean은 규칙보다 먼저 만들어 실제 클래스로 검사한다. 위험·한계: 회복 필요 예외 메시지 끝에 scope digest가 붙고 기동 실패 문구가 바뀌어, 문구 전체에 맞추던 로그 매처는 고쳐야 한다. 코드가 든 Redis 계정 참조의 fixture- 검사는 문서로만 막았다(코드로 막으려면 새 의존 edge가 필요하다). failure-retention ≥ replay-ttl 기동 검사는 넣지 않았다. -mx 같은 짧은 플래그 묶음과 graphql 전송 fixture는 남았다. spotbugsTestFixtures(게이트 밖)의 정규식 경고가 15건으로 늘었다. 검증: ci, 두 빌드의 verifyStrictLaneStages --dry-run, mainCheck, :integrationCheck, -p optional-platforms ci integrationCheck performanceCheck, :performanceCheck, :releaseCheck(-PgitRevision), verify-compose-profile-contracts(18 lane) 첫 실행 통과. watchdog은 공용 풀을 채운 상태에서 300ms 설정이 300ms에 끝나는 것을 쟀다. Refs: docs/reviews/2026-11-03-rereview/README.md 11·12절, round3/
This commit is contained in:
@@ -88,8 +88,9 @@ configurations, Redis as one 376-line class.
|
||||
- **An environment-only guard is a `StartupRule` bean** (`support.startup`): it returns violations,
|
||||
and the one `StartupRuleRunner` raises them before any other singleton exists (declare it with a
|
||||
`static` `@Bean` method that takes only the `Environment`, the bean factory or an `ObjectProvider`
|
||||
of static `RequiredProductionSecrets`; the runner fails the boot naming any other bean a rule
|
||||
creates, and naming any rule or `RequiredProductionSecrets` that has an `@Value`/`@Autowired`/
|
||||
of static `RequiredProductionSecrets`; in every profile the runner creates each rule and each
|
||||
`RequiredProductionSecrets` before any rule runs, and fails the boot naming any other bean one of
|
||||
them creates, and naming any whose runtime class has an `@Value`/`@Autowired`/
|
||||
`@Inject`/`@Resource` member, a `@PostConstruct`/`@PreDestroy` callback or a
|
||||
`@ConfigurationProperties` binding — those are created before the post-processors and would stay
|
||||
unset). A guard that needs another bean stays a bean. A
|
||||
|
||||
@@ -133,8 +133,10 @@ README의 "startup" 절에 있다.
|
||||
lane용으로 적어 둔 공개 비밀번호(`infra/redis-sdk/acl`의 Redis ACL fixture, compose lane의
|
||||
`REDIS_LANE_*`)라서, lane 환경이나 lane ACL 파일을 베낀 배포가 그대로 운영에 뜨는 것을 막는다
|
||||
(review 2026-11-03 RR-07-04). 이 검사는 비밀값만 본다 — 레지스트리의 `secret` 행
|
||||
(`CLASSIFIED_SECRETS`), 모듈이 기여한 비밀, `secret://…/<VAR>` 참조가 가리키는 변수
|
||||
(review 2026-11-04 RR2-04-01). `fixture-`는 평범한 단어라서 `fixture-api` Deployment의 pod 이름
|
||||
(`CLASSIFIED_SECRETS`), 모듈이 기여한 비밀, 환경 값에 든 `secret://…/<VAR>` 참조가 가리키는 변수
|
||||
(review 2026-11-04 RR2-04-01). 코드에 든 참조(Redis SDK admin 계정의 `RedisAccountContribution`)는 보지
|
||||
못하므로, 그 계정을 조립하는 쪽이 변수를 `RequiredProductionSecrets` bean으로도 낸다(RR3-04-03,
|
||||
`src/adapter/outbound/redis-sdk/README.md`). `fixture-`는 평범한 단어라서 `fixture-api` Deployment의 pod 이름
|
||||
(`HOSTNAME`)이나 앱 이름까지 거부하면 운영에서만 기동이 막혔다. `__LOCAL_DEV_` 표시는 정당한 값이 가질
|
||||
일이 없으니 모든 값을 본다. 실패 메시지는 변수 이름만 적고 값은 적지 않는다. (2) 레지스트리에서 `secret` +
|
||||
`prod_default: null`로 분류된 모든 키는 prod 에서 비어 있지 않게 주입돼야 한다 — 빈 시크릿으로
|
||||
|
||||
+59
-9
@@ -462,6 +462,10 @@ class ApplicationBoundaryArchitectureTest {
|
||||
* framework types an endpoint is built from. {@code org.springframework.messaging} is named only
|
||||
* for STOMP ({@code simp}, {@code @MessageMapping}): a broker listener's {@code @Payload} and
|
||||
* {@code @Header} live beside them and are a system consumer's, not a user's.
|
||||
*
|
||||
* <p>The framework half is a list, unlike the package allowlist above: a transport library
|
||||
* missing from it is not recognised as one. A service that brings in a new transport library adds
|
||||
* its packages here (review 2026-11-04 RR3-01-02).
|
||||
*/
|
||||
private static final DescribedPredicate<JavaClass> ARE_USER_TRANSPORT_TYPES =
|
||||
JavaClass.Predicates.resideInAnyPackage(
|
||||
@@ -474,14 +478,33 @@ class ApplicationBoundaryArchitectureTest {
|
||||
"org.springframework.messaging.simp..",
|
||||
"io.grpc..",
|
||||
"jakarta.servlet..",
|
||||
"jakarta.websocket..")
|
||||
"jakarta.websocket..",
|
||||
"jakarta.ws.rs..",
|
||||
"graphql..")
|
||||
.or(
|
||||
com.tngtech.archunit.core.domain.properties.HasName.Predicates.name(
|
||||
"org.springframework.stereotype.Controller"))
|
||||
.or(
|
||||
com.tngtech.archunit.core.domain.properties.HasName.Predicates.name(
|
||||
"org.springframework.messaging.handler.annotation.MessageMapping"))
|
||||
.as("user-transport types (web, GraphQL, gRPC, WebSocket/STOMP endpoints)");
|
||||
.as("user-transport types (web, JAX-RS, GraphQL, gRPC, WebSocket/STOMP endpoints)");
|
||||
|
||||
/**
|
||||
* A class a user request comes in through: it lives in a user-transport package or is built from
|
||||
* a user-transport type. A configuration that only registers a system caller is neither, which is
|
||||
* why the rule below names these rather than every inbound class.
|
||||
*/
|
||||
private static final DescribedPredicate<JavaClass> ARE_USER_TRANSPORTS =
|
||||
new DescribedPredicate<>(
|
||||
"are user transports (in a user-transport package or built from one)") {
|
||||
@Override
|
||||
public boolean test(JavaClass candidate) {
|
||||
return ARE_USER_TRANSPORT_TYPES.test(candidate)
|
||||
|| candidate.getDirectDependenciesFromSelf().stream()
|
||||
.anyMatch(
|
||||
dependency -> ARE_USER_TRANSPORT_TYPES.test(dependency.getTargetClass()));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A class marked {@link SystemCaller}, or nested in one: a handler's anonymous or inner helper
|
||||
@@ -533,13 +556,14 @@ class ApplicationBoundaryArchitectureTest {
|
||||
* {@link SystemCaller} is a claim, so it is checked: the marked class lives in a system-driven
|
||||
* inbound package and is no endpoint a user can call — a controller, a GraphQL or STOMP mapping,
|
||||
* a gRPC service. Without this the mark would be the next way to silence the rule above (review
|
||||
* 2026-11-03 RR-01-12).
|
||||
* 2026-11-03 RR-01-12). The claim covers the classes nested in the marked one, because the rule
|
||||
* above exempts exactly those: an endpoint nested in a job is checked as the job is (review
|
||||
* 2026-11-04 RR3-01-01).
|
||||
*/
|
||||
@ArchTest
|
||||
static final ArchRule SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS =
|
||||
classes()
|
||||
.that()
|
||||
.areAnnotatedWith(SystemCaller.class)
|
||||
.that(ARE_SYSTEM_CALLERS)
|
||||
.should()
|
||||
.resideInAnyPackage(SYSTEM_DRIVEN_INBOUND_PACKAGES)
|
||||
.andShould(
|
||||
@@ -547,10 +571,36 @@ class ApplicationBoundaryArchitectureTest {
|
||||
com.tngtech.archunit.lang.conditions.ArchConditions.dependOnClassesThat(
|
||||
ARE_USER_TRANSPORT_TYPES)))
|
||||
.as(
|
||||
"SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS: a @SystemCaller lives in a "
|
||||
+ "system-driven inbound package (..adapter.inbound.messaging.., "
|
||||
+ "..adapter.inbound.scheduler..) and depends on no user-transport type — the mark "
|
||||
+ "says no user request reaches the class, so a user transport cannot carry it")
|
||||
"SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS: a @SystemCaller, and every class "
|
||||
+ "nested in one, lives in a system-driven inbound package "
|
||||
+ "(..adapter.inbound.messaging.., ..adapter.inbound.scheduler..) and depends on "
|
||||
+ "no user-transport type — the mark says no user request reaches the class, so a "
|
||||
+ "user transport cannot carry it")
|
||||
.allowEmptyShould(true);
|
||||
|
||||
/**
|
||||
* The other way round: a user transport does not reach a {@link SystemCaller}, directly or
|
||||
* through classes in between. A "run now" endpoint handed the job bean never names the {@link
|
||||
* SystemInvoked} use case, so the rules above do not see it, yet a user request then runs a write
|
||||
* no permission guards (review 2026-11-04 RR3-01-01). The configuration that registers the
|
||||
* handler is no transport and may depend on it.
|
||||
*
|
||||
* <p>Like every rule here it reads class dependencies. A lookup at run time ({@code getBean},
|
||||
* {@code ObjectProvider}) is not a dependency and is not seen.
|
||||
*/
|
||||
@ArchTest
|
||||
static final ArchRule USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS =
|
||||
noClasses()
|
||||
.that(ARE_USER_TRANSPORTS)
|
||||
.should()
|
||||
.transitivelyDependOnClassesThat(ARE_SYSTEM_CALLERS)
|
||||
.as(
|
||||
"USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS: a class a user request comes in "
|
||||
+ "through (a user-transport package, or built from a web, JAX-RS, GraphQL, gRPC "
|
||||
+ "or WebSocket type) does not reach a @SystemCaller, directly or through other "
|
||||
+ "classes — the system caller runs a @SystemInvoked write with no permission "
|
||||
+ "check. A user-triggered run of the same work is its own use case with "
|
||||
+ "@RequiresPermission (manual 07 「시스템이 부르는 쓰기」)")
|
||||
.allowEmptyShould(true);
|
||||
|
||||
/**
|
||||
|
||||
+1
@@ -168,6 +168,7 @@ class ArchRuleDiscoveryContractTest {
|
||||
"SYSTEM_INVOKED_USE_CASES_DECLARE_NO_PERMISSION",
|
||||
"TEMPLATE_PACKAGES_DO_NOT_DEPEND_ON_FEATURE_PACKAGES",
|
||||
"THROWABLES_ARE_NAMED_EXCEPTION",
|
||||
"USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS",
|
||||
"USE_CASE_CAPABILITY_MATCHES_TRANSACTION_PORT_BOUNDARY",
|
||||
"USE_CASE_PORTS_CARRY_ONE_OPERATION",
|
||||
"VALIDATION_CONSTRAINTS_STAY_AT_WEB_BOUNDARY",
|
||||
|
||||
+91
@@ -7,11 +7,16 @@ import com.tngtech.archunit.core.importer.ClassFileImporter;
|
||||
import com.tngtech.archunit.lang.EvaluationResult;
|
||||
import dev.caskeleton.application.architecture.violations.ApplicationDiagnosticFrameworkViolation;
|
||||
import dev.caskeleton.bootstrap.architecture.allowed.adapter.inbound.messaging.SystemCallerHandlerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.allowed.adapter.inbound.messaging.SystemCallerHandlerRegistrationFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.allowed.application.CleanProjectionQueryPort;
|
||||
import dev.caskeleton.bootstrap.architecture.fixtures.application.RootWriteTransactionBoundaryUseCase;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.messaging.SystemCallerRestControllerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.messaging.UnmarkedSystemInvokedHandlerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.scheduler.SystemCallerWithNestedEndpointFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.scheduler.SystemJobLauncherFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.web.controller.SystemCallerControllerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.web.controller.SystemCallerInvokingControllerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.web.controller.SystemCallerRelayingControllerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.web.controller.SystemInvokedCallingControllerFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.outbound.RawExternalResponseFixture;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.outbound.messaging.GenericTypeLeakingAdapterFixture;
|
||||
@@ -188,6 +193,47 @@ class ArchitectureViolationFixtureTest {
|
||||
private static final JavaClasses SYSTEM_CALLER_THAT_IS_AN_HTTP_ENDPOINT_FIXTURE_ONLY =
|
||||
new ClassFileImporter().importClasses(SystemCallerRestControllerFixture.class);
|
||||
|
||||
// Review 2026-11-04 RR3-01-01: a user transport that never names the use case but calls the
|
||||
// system caller holding it — directly, and through one unmarked class in between.
|
||||
private static final JavaClasses CONTROLLER_CALLING_A_SYSTEM_CALLER_FIXTURE_ONLY =
|
||||
new ClassFileImporter()
|
||||
.importClasses(
|
||||
SystemCallerInvokingControllerFixture.class,
|
||||
SystemCallerHandlerFixture.class,
|
||||
SystemInvokedFixtureUseCase.class);
|
||||
|
||||
private static final JavaClasses CONTROLLER_RELAYING_TO_A_SYSTEM_CALLER_FIXTURE_ONLY =
|
||||
new ClassFileImporter()
|
||||
.importClasses(
|
||||
SystemCallerRelayingControllerFixture.class,
|
||||
SystemJobLauncherFixture.class,
|
||||
SystemCallerHandlerFixture.class,
|
||||
SystemInvokedFixtureUseCase.class);
|
||||
|
||||
// The configuration that registers the handler: it depends on a system caller and is no
|
||||
// transport, so the rule above must leave it alone.
|
||||
private static final JavaClasses SYSTEM_CALLER_REGISTRATION_FIXTURE_ONLY =
|
||||
new ClassFileImporter()
|
||||
.importClasses(
|
||||
SystemCallerHandlerRegistrationFixture.class,
|
||||
SystemCallerHandlerFixture.class,
|
||||
SystemInvokedFixtureUseCase.class);
|
||||
|
||||
// An endpoint nested in a marked job: the mark exempts nested classes, so they carry its claim.
|
||||
private static final JavaClasses ENDPOINT_NESTED_IN_A_SYSTEM_CALLER_FIXTURE_ONLY =
|
||||
new ClassFileImporter()
|
||||
.importClasses(
|
||||
SystemCallerWithNestedEndpointFixture.class,
|
||||
SystemCallerWithNestedEndpointFixture.RunNowEndpoint.class,
|
||||
SystemInvokedFixtureUseCase.class);
|
||||
|
||||
// RR3-01-02: a JAX-RS endpoint carrying the mark. importPackages, so the compile-only
|
||||
// jakarta.ws.rs types are read from bytecode and never linked.
|
||||
private static final JavaClasses JAXRS_SYSTEM_CALLER_FIXTURE_ONLY =
|
||||
new ClassFileImporter()
|
||||
.importPackages(
|
||||
"dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.messaging.jaxrs");
|
||||
|
||||
// Review 2026-11-03 RR-01-03: one class that builds the draft by hand.
|
||||
private static final JavaClasses HAND_BUILT_DRAFT_FIXTURE_ONLY =
|
||||
new ClassFileImporter().importClasses(HandBuiltIntegrationEventDraftFixture.class);
|
||||
@@ -246,6 +292,51 @@ class ArchitectureViolationFixtureTest {
|
||||
assertThat(result.hasViolation()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aControllerThatCallsASystemCallerBeanIsCaught() {
|
||||
EvaluationResult result =
|
||||
ApplicationBoundaryArchitectureTest.USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS.evaluate(
|
||||
CONTROLLER_CALLING_A_SYSTEM_CALLER_FIXTURE_ONLY);
|
||||
|
||||
assertThat(result.hasViolation()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aControllerThatReachesASystemCallerThroughAnotherClassIsCaught() {
|
||||
EvaluationResult result =
|
||||
ApplicationBoundaryArchitectureTest.USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS.evaluate(
|
||||
CONTROLLER_RELAYING_TO_A_SYSTEM_CALLER_FIXTURE_ONLY);
|
||||
|
||||
assertThat(result.hasViolation()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aConfigurationThatRegistersASystemCallerMayDependOnIt() {
|
||||
EvaluationResult result =
|
||||
ApplicationBoundaryArchitectureTest.USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS.evaluate(
|
||||
SYSTEM_CALLER_REGISTRATION_FIXTURE_ONLY);
|
||||
|
||||
assertThat(result.getFailureReport().getDetails()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void anEndpointNestedInASystemCallerIsCaught() {
|
||||
EvaluationResult result =
|
||||
ApplicationBoundaryArchitectureTest.SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS
|
||||
.evaluate(ENDPOINT_NESTED_IN_A_SYSTEM_CALLER_FIXTURE_ONLY);
|
||||
|
||||
assertThat(result.hasViolation()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aJaxRsEndpointMarkedAsASystemCallerIsCaught() {
|
||||
EvaluationResult result =
|
||||
ApplicationBoundaryArchitectureTest.SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS
|
||||
.evaluate(JAXRS_SYSTEM_CALLER_FIXTURE_ONLY);
|
||||
|
||||
assertThat(result.hasViolation()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
void aFeatureThatBuildsAnIntegrationEventDraftByHandIsCaught() {
|
||||
EvaluationResult result =
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package dev.caskeleton.bootstrap.architecture.allowed.adapter.inbound.messaging;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* The configuration that registers a system caller as a bean. It depends on the handler and is no
|
||||
* user transport, so {@code USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS} must not flag it — that is
|
||||
* why the rule names user transports rather than every inbound class (review 2026-11-04 RR3-01-01).
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
public class SystemCallerHandlerRegistrationFixture {
|
||||
|
||||
@Bean
|
||||
SystemCallerHandlerFixture systemCallerHandler() {
|
||||
return new SystemCallerHandlerFixture();
|
||||
}
|
||||
}
|
||||
+3
-1
@@ -4,6 +4,8 @@
|
||||
* {@code @SystemInvoked} use case it constructed itself. {@code
|
||||
* ONLY_SYSTEM_CALLERS_REACH_SYSTEM_INVOKED_USE_CASES} and {@code
|
||||
* SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS} must NOT flag it — it is the one legitimate
|
||||
* way a consumer reaches a system write (manual 09 「소비」 step 4).
|
||||
* way a consumer reaches a system write (manual 09 「소비」 step 4). The configuration that registers
|
||||
* that handler as a bean is here too: {@code USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS} must not
|
||||
* flag it either (review 2026-11-04 RR3-01-01).
|
||||
*/
|
||||
package dev.caskeleton.bootstrap.architecture.allowed.adapter.inbound.messaging;
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.messaging.jaxrs;
|
||||
|
||||
import dev.caskeleton.application.security.SystemCaller;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.application.SystemInvokedFixtureUseCase;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* Negative fixture for {@code SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS}: a JAX-RS endpoint
|
||||
* in a system-driven package carrying the mark. The transport-type half of the rule is a list, so a
|
||||
* transport missing from it passes (review 2026-11-04 RR3-01-02). Loaded with {@code
|
||||
* importPackages}: {@code jakarta.ws.rs-api} is compile-only here, so JUnit must never link it.
|
||||
*/
|
||||
@SystemCaller(reason = "fixture: a JAX-RS endpoint hiding in the messaging package")
|
||||
@Path("/fixture/jaxrs-system-write")
|
||||
public class JaxRsSystemCallerFixture {
|
||||
|
||||
private final SystemInvokedFixtureUseCase useCase = new SystemInvokedFixtureUseCase();
|
||||
|
||||
@POST
|
||||
public void trigger() {
|
||||
useCase.handle();
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.scheduler;
|
||||
|
||||
import dev.caskeleton.application.security.SystemCaller;
|
||||
import dev.caskeleton.bootstrap.architecture.violations.application.SystemInvokedFixtureUseCase;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Negative fixture for {@code SYSTEM_CALLERS_ARE_SYSTEM_DRIVEN_INBOUND_ADAPTERS}: a scheduled job
|
||||
* that carries the mark, with an HTTP endpoint nested inside it. The mark exempts nested classes
|
||||
* from {@code ONLY_SYSTEM_CALLERS_REACH_SYSTEM_INVOKED_USE_CASES}, so the claim has to be checked
|
||||
* on them too (review 2026-11-04 RR3-01-01).
|
||||
*/
|
||||
@SystemCaller(reason = "fixture: the scheduler ticks it")
|
||||
public final class SystemCallerWithNestedEndpointFixture {
|
||||
|
||||
private final SystemInvokedFixtureUseCase useCase = new SystemInvokedFixtureUseCase();
|
||||
|
||||
public void run() {
|
||||
useCase.handle();
|
||||
}
|
||||
|
||||
/** A user transport living under the job's mark. */
|
||||
@RestController
|
||||
public static class RunNowEndpoint {
|
||||
|
||||
private final SystemInvokedFixtureUseCase useCase = new SystemInvokedFixtureUseCase();
|
||||
|
||||
@PostMapping("/fixture/nested-run-now")
|
||||
public void runNow() {
|
||||
useCase.handle();
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.scheduler;
|
||||
|
||||
import dev.caskeleton.bootstrap.architecture.allowed.adapter.inbound.messaging.SystemCallerHandlerFixture;
|
||||
|
||||
/**
|
||||
* The class in between for {@code SystemCallerRelayingControllerFixture}: unmarked, no transport
|
||||
* type, and it calls the system caller it is given.
|
||||
*/
|
||||
public class SystemJobLauncherFixture {
|
||||
|
||||
private final SystemCallerHandlerFixture handler;
|
||||
|
||||
public SystemJobLauncherFixture(SystemCallerHandlerFixture handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public void launch() {
|
||||
handler.handle();
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.web.controller;
|
||||
|
||||
import dev.caskeleton.bootstrap.architecture.allowed.adapter.inbound.messaging.SystemCallerHandlerFixture;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Negative fixture for {@code USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS}: a "run now" endpoint
|
||||
* that is handed the system caller bean and calls it. It never names the {@code @SystemInvoked} use
|
||||
* case, so the rule on that dependency does not see it, yet a user request now runs a write no
|
||||
* permission guards (review 2026-11-04 RR3-01-01).
|
||||
*/
|
||||
@RestController
|
||||
public class SystemCallerInvokingControllerFixture {
|
||||
|
||||
private final SystemCallerHandlerFixture handler;
|
||||
|
||||
public SystemCallerInvokingControllerFixture(SystemCallerHandlerFixture handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@PostMapping("/fixture/run-now")
|
||||
public void runNow() {
|
||||
handler.handle();
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.web.controller;
|
||||
|
||||
import dev.caskeleton.bootstrap.architecture.violations.adapter.inbound.scheduler.SystemJobLauncherFixture;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* Negative fixture for {@code USER_TRANSPORTS_DO_NOT_REACH_SYSTEM_CALLERS}: the same "run now"
|
||||
* endpoint with one more class in between. The launcher is neither a transport nor a system caller,
|
||||
* so only a rule that follows the chain sees that a user request still reaches the system write
|
||||
* (review 2026-11-04 RR3-01-01).
|
||||
*/
|
||||
@RestController
|
||||
public class SystemCallerRelayingControllerFixture {
|
||||
|
||||
private final SystemJobLauncherFixture launcher;
|
||||
|
||||
public SystemCallerRelayingControllerFixture(SystemJobLauncherFixture launcher) {
|
||||
this.launcher = launcher;
|
||||
}
|
||||
|
||||
@PostMapping("/fixture/run-now-via-launcher")
|
||||
public void runNow() {
|
||||
launcher.launch();
|
||||
}
|
||||
}
|
||||
+8
-3
@@ -163,9 +163,14 @@ public final class SecretSourceValidator implements StartupRule {
|
||||
|
||||
/**
|
||||
* Names every secret that holds a lane fixture password: the keys the registry classifies {@code
|
||||
* secret}, the ones a module contributed, and every variable a credential reference names. Read
|
||||
* through the same backend the application resolves them with. The value is never put in the
|
||||
* message.
|
||||
* secret}, the ones a module contributed, and every variable a credential reference among the
|
||||
* environment's values names. Read through the same backend the application resolves them with.
|
||||
* The value is never put in the message.
|
||||
*
|
||||
* <p>A reference held in code is not seen — the typed Redis SDK's admin account is a {@code
|
||||
* RedisAccountContribution} bean, which this rule cannot read without creating it early. Its
|
||||
* composer names the variable in a {@link RequiredProductionSecrets} bean as well (review
|
||||
* 2026-11-04 RR3-04-03, {@code RedisSdkComposition}).
|
||||
*/
|
||||
private static void collectFixturePasswordViolations(
|
||||
Environment environment,
|
||||
|
||||
Reference in New Issue
Block a user