From 8b0ef86fbd8bf7fcd976fd884043fa5842c26a9c Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 04 Sep 2025 07:53:58 +0000
Subject: [PATCH] [#544] Add requires-admin-action component-restart for max-request-size (#552)

---
 opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java                          |    4 +++-
 opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/HTTPConnectionHandlerConfiguration.xml |    6 +++++-
 opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/LDAPConnectionHandlerConfiguration.xml |    4 ++++
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/HTTPConnectionHandlerConfiguration.xml b/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/HTTPConnectionHandlerConfiguration.xml
index 07c047f..c6d3fe5 100644
--- a/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/HTTPConnectionHandlerConfiguration.xml
+++ b/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/HTTPConnectionHandlerConfiguration.xml
@@ -13,6 +13,7 @@
   information: "Portions Copyright [year] [name of copyright owner]".
 
   Portions copyright 2013-2016 ForgeRock AS.
+  Portions copyright 2025 3A Systems, LLC
   ! -->
 <adm:managed-object name="http-connection-handler"
   plural-name="http-connection-handlers"
@@ -225,7 +226,10 @@
       they send extremely large requests to the server causing it to
       attempt to allocate large amounts of memory.
     </adm:description>
-    <adm:default-behavior>
+      <adm:requires-admin-action>
+          <adm:component-restart />
+      </adm:requires-admin-action>
+      <adm:default-behavior>
       <adm:defined>
         <adm:value>5 megabytes</adm:value>
       </adm:defined>
diff --git a/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/LDAPConnectionHandlerConfiguration.xml b/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/LDAPConnectionHandlerConfiguration.xml
index 5b9d489..f84d0c9 100644
--- a/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/LDAPConnectionHandlerConfiguration.xml
+++ b/opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/LDAPConnectionHandlerConfiguration.xml
@@ -14,6 +14,7 @@
 
   Copyright 2007-2009 Sun Microsystems, Inc.
   Portions copyright 2011-2016 ForgeRock AS.
+  Portions copyright 2025 3A Systems, LLC
   ! -->
 <adm:managed-object name="ldap-connection-handler"
   plural-name="ldap-connection-handlers"
@@ -311,6 +312,9 @@
       send extremely large requests to the server causing it to
       attempt to allocate large amounts of memory.
     </adm:description>
+    <adm:requires-admin-action>
+      <adm:component-restart />
+    </adm:requires-admin-action>
     <adm:default-behavior>
       <adm:defined>
         <adm:value>5 megabytes</adm:value>
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
index fc43c03..c0a6467 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
@@ -13,6 +13,7 @@
  *
  * Copyright 2006-2009 Sun Microsystems, Inc.
  * Portions Copyright 2012-2016 ForgeRock AS.
+ * Portions Copyright 2025 3A Systems, LLC.
  */
 package org.opends.server.protocols.ldap;
 
@@ -85,7 +86,7 @@
         "ds-cfg-use-tcp-no-delay: true",
         "ds-cfg-allow-tcp-reuse-address: true",
         "ds-cfg-send-rejection-notice: true",
-        "ds-cfg-max-request-size: 5 megabytes",
+        "ds-cfg-max-request-size: 10 megabytes",
         "ds-cfg-num-request-handlers: 2",
         "ds-cfg-allow-start-tls: false",
         "ds-cfg-use-ssl: false",
@@ -105,6 +106,7 @@
     Collection<String> cips = LDAPConnHandler.getEnabledSSLCipherSuites();
     Collection<String> protos = LDAPConnHandler.getEnabledSSLProtocols();
     int maxReqSize = LDAPConnHandler.getMaxRequestSize();
+    assertEquals(maxReqSize,10*1000*1000);
     String shutListName=LDAPConnHandler.getShutdownListenerName();
     SSLClientAuthPolicy policy = LDAPConnHandler.getSSLClientAuthPolicy();
     Collection<ClientConnection> cons=LDAPConnHandler.getClientConnections();

--
Gitblit v1.10.0