nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: jhipster/jhipster-lite
Pull request #12648 (2025-05-28 20:14:03)

Spring-boot actuators: switch configuration access to be opt-in rather than opt-out
It seems to be a safer configuration for security purpose


Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactory.java
index cb7736316..8c90162f5 100644
--- a/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactory.java
@@ -31,6 +31,12 @@ public class SpringBootActuatorModuleFactory {
         )
         .set(propertyKey("management.endpoint.health.probes.enabled"), propertyValue(true))
         .set(propertyKey("management.endpoint.health.show-details"), propertyValue("always"))
+        .set(propertyKey("management.endpoints.access.default"), propertyValue("none"))
+        .set(propertyKey("management.endpoints.jmx.exposure.exclude"), propertyValue("*"))
+        .and()
+      .springLocalProperties()
+        .set(propertyKey("management.endpoints.web.exposure.include"), propertyValue("*"))
+        .set(propertyKey("management.endpoints.access.default"), propertyValue("unrestricted"))
         .and()
       .build();
     //@formatter:on


Test patch:
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java
index 15d89c470..a60b184e4 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/domain/SpringBootActuatorModuleFactoryTest.java
@@ -38,6 +38,11 @@ class SpringBootActuatorModuleFactoryTest {
                 enabled: true
               show-details: always
           endpoints:
+            access:
+              default: none
+            jmx:
+              exposure:
+                exclude: '*'
             web:
               base-path: /management
               exposure:
@@ -50,6 +55,19 @@ class SpringBootActuatorModuleFactoryTest {
                 - loggers
                 - threaddump
         """
+      )
+      .and()
+      .hasFile("src/main/resources/config/application-local.yml")
+      .containing(
+        """
+        management:
+          endpoints:
+            access:
+              default: unrestricted
+            web:
+              exposure:
+                include: '*'
+        """
       );
   }
 }