chore(format): spotless 포맷을 바뀐 자바 파일에 적용한다
PR #12의 액추에이터·fileserver·web-advanced 수정 커밋이 긴 주석과 assertion 메시지에 포맷 드리프트를 남겨, runner pr / gradle의 :app-bootstrap:spotlessJavaCheck가 깨졌다. 모듈 시험만 돌리고 포맷 게이트(spotlessCheck)를 건너뛴 탓이다. ./gradlew spotlessApply로 바뀐 3개 파일만 재포맷했다. 이미 push된 커밋이라 force push 금지 → squash 대신 새 커밋으로 올린다. 위험·한계: 포맷만 바뀐다(긴 줄의 줄바꿈). 동작·의미 변화 없음. 검증: spotlessCheck rc=0. 바뀐 3개 모듈 시험 재실행 — ManagementActuatorSecurityContractTest·FileserverAdminControllerRequestBodyValidationTest·WebCodecMapperTest BUILD SUCCESSFUL (1m8s).
This commit is contained in:
+10
-5
@@ -77,14 +77,19 @@ public final class WebXmlMapperFactory {
|
||||
return XmlMapper.builder(factory)
|
||||
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||
.disable(MapperFeature.ALLOW_COERCION_OF_SCALARS)
|
||||
// Deliberately NOT the CBOR mapper's withCoercionConfig(String->Fail, Textual Integer->Fail).
|
||||
// Deliberately NOT the CBOR mapper's withCoercionConfig(String->Fail, Textual
|
||||
// Integer->Fail).
|
||||
// XML is a textual format: every scalar — a numeric or boolean DTO field included — arrives
|
||||
// as a String token (<count>5</count>). Forbidding String-shaped input there would reject all
|
||||
// numeric/boolean binding, and WebCodecMapperTest.xmlRoundTripPreservesWireTypes (which binds
|
||||
// as a String token (<count>5</count>). Forbidding String-shaped input there would reject
|
||||
// all
|
||||
// numeric/boolean binding, and WebCodecMapperTest.xmlRoundTripPreservesWireTypes (which
|
||||
// binds
|
||||
// `int count`) pins exactly that. The parity a reader might expect with the CBOR profile is
|
||||
// not a strictness bypass: FAIL_ON_UNKNOWN_PROPERTIES and the SecureXmlInputFactory hardening
|
||||
// not a strictness bypass: FAIL_ON_UNKNOWN_PROPERTIES and the SecureXmlInputFactory
|
||||
// hardening
|
||||
// apply here too, @Valid constraints run post-binding on every representation, and binding
|
||||
// "5"->int is XML's normal semantics, not the type confusion the CBOR lockdown guards against.
|
||||
// "5"->int is XML's normal semantics, not the type confusion the CBOR lockdown guards
|
||||
// against.
|
||||
// (W4 red team BE-INPUT-001: the divergence is by design, not an omission.)
|
||||
.build();
|
||||
}
|
||||
|
||||
+5
-5
@@ -15,11 +15,11 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
* {@code @Valid}.
|
||||
*
|
||||
* <p>{@code reconcileOrphans} shipped a {@code @RequestBody} without {@code @Valid}, unlike every
|
||||
* sibling handler (relocate/force-delete/…). Harmless today because {@code OrphanReconcileHttpRequest}
|
||||
* declares no Bean Validation constraints — but the moment one is added (a {@code @Min} on the limit,
|
||||
* a {@code @NotBlank} on the reason), it would be silently ignored, exactly the validation-bypass
|
||||
* class this template otherwise guards against. This pins the convention for the whole admin plane so
|
||||
* the gap cannot reopen.
|
||||
* sibling handler (relocate/force-delete/…). Harmless today because {@code
|
||||
* OrphanReconcileHttpRequest} declares no Bean Validation constraints — but the moment one is added
|
||||
* (a {@code @Min} on the limit, a {@code @NotBlank} on the reason), it would be silently ignored,
|
||||
* exactly the validation-bypass class this template otherwise guards against. This pins the
|
||||
* convention for the whole admin plane so the gap cannot reopen.
|
||||
*/
|
||||
class FileserverAdminControllerRequestBodyValidationTest {
|
||||
|
||||
|
||||
+8
-4
@@ -234,20 +234,24 @@ class ManagementActuatorSecurityContractTest {
|
||||
Object address = nested(mgmt, "server", "address");
|
||||
|
||||
assertThat(address)
|
||||
.as("application.yml must pin management.server.address — unset binds all interfaces "
|
||||
+ "(BE-CONFIG-001): health/prometheus/info reachable unauthenticated off-loopback")
|
||||
.as(
|
||||
"application.yml must pin management.server.address — unset binds all interfaces "
|
||||
+ "(BE-CONFIG-001): health/prometheus/info reachable unauthenticated off-loopback")
|
||||
.isNotNull();
|
||||
|
||||
// Keep it env-driven (${MANAGEMENT_SERVER_ADDRESS:<default>}) so a remote-scrape deployment can
|
||||
// opt in, and require the shipped DEFAULT to be a loopback address.
|
||||
String expr = String.valueOf(address);
|
||||
assertThat(expr)
|
||||
.as("management.server.address must stay env-driven ${MANAGEMENT_SERVER_ADDRESS:<loopback>}")
|
||||
.as(
|
||||
"management.server.address must stay env-driven ${MANAGEMENT_SERVER_ADDRESS:<loopback>}")
|
||||
.startsWith("${MANAGEMENT_SERVER_ADDRESS:")
|
||||
.endsWith("}");
|
||||
String defaultValue = expr.substring(expr.indexOf(':') + 1, expr.length() - 1);
|
||||
assertThat(InetAddress.getByName(defaultValue).isLoopbackAddress())
|
||||
.as("management.server.address default must be a loopback address, but was: " + defaultValue)
|
||||
.as(
|
||||
"management.server.address default must be a loopback address, but was: "
|
||||
+ defaultValue)
|
||||
.isTrue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user