diff --git a/openam-documentation/openam-doc-source/src/main/asciidoc/admin-guide/chap-monitoring.adoc b/openam-documentation/openam-doc-source/src/main/asciidoc/admin-guide/chap-monitoring.adoc index 7e9431c01b..2aba9b563b 100644 --- a/openam-documentation/openam-doc-source/src/main/asciidoc/admin-guide/chap-monitoring.adoc +++ b/openam-documentation/openam-doc-source/src/main/asciidoc/admin-guide/chap-monitoring.adoc @@ -428,7 +428,7 @@ With this configuration, OpenAM writes the `Authentication` debug log to files s OpenAM reads the `debugconfig.properties` file once, at startup. After you change the file, restart OpenAM or the container in which it runs for the changes to take effect. -If rotation is enabled with an empty suffix, with a suffix that OpenAM detects as too coarse for the rotation settings, or with a suffix pattern that OpenAM cannot parse, or if a rotation property is set to zero, OpenAM ignores the whole file, including the prefix, and does not rotate debug logs at all. In that case OpenAM writes a message such as the following to the standard error output of the container, for example `catalina.out` for Apache Tomcat: +If rotation is enabled with an empty suffix, with a suffix that OpenAM detects as too coarse for the rotation settings, or with a suffix pattern that OpenAM cannot parse, or if a rotation property is set to zero or a negative value, OpenAM ignores the whole file, including the prefix, and does not rotate debug logs at all. In that case OpenAM writes a message such as the following to the standard error output of the container, for example `catalina.out` for Apache Tomcat: [source, console] ---- diff --git a/openam-documentation/openam-doc-source/src/main/asciidoc/upgrade-guide/chap-upgrade-servers.adoc b/openam-documentation/openam-doc-source/src/main/asciidoc/upgrade-guide/chap-upgrade-servers.adoc index 0e52c414f2..da30929d2b 100644 --- a/openam-documentation/openam-doc-source/src/main/asciidoc/upgrade-guide/chap-upgrade-servers.adoc +++ b/openam-documentation/openam-doc-source/src/main/asciidoc/upgrade-guide/chap-upgrade-servers.adoc @@ -85,6 +85,11 @@ The token endpoint fails closed to match: while the property is enabled, an auth Update hybrid-flow clients to send a `code_challenge` at the authorization endpoint and the matching `code_verifier` at the token endpoint, or disable Code Verifier Parameter Required for the realm. Disabling it never relaxes verification for codes that *were* issued with a challenge. See xref:../reference/chap-config-ref.adoc#oauth2-provider-configuration["OAuth2 Provider"] in the __Reference__. ==== +[IMPORTANT] +==== +Starting with this release `debugconfig.properties` is validated more strictly. A file with `org.forgerock.openam.debug.rotation=-1`, or with a trailing space after a rotation value next to a suffix that is empty, too coarse or cannot be parsed, is now rejected as a whole: OpenAM prints "'/debugconfig.properties' isn't valid, the default configuration will be used instead" to the standard error output and uses no prefix and no rotation. Leave a rotation value empty to turn that rotation off. Trailing spaces are also removed from the prefix and the suffix, so they no longer appear in debug log file names. See xref:../admin-guide/chap-monitoring.adoc#log-rotate-debug["Rotating Debug Logs"] in the __Administration Guide__. +==== + [#upgrade-server] .To Upgrade From a Supported OpenAM Version ==== diff --git a/openam-shared/src/main/java/com/sun/identity/shared/debug/file/DebugConfiguration.java b/openam-shared/src/main/java/com/sun/identity/shared/debug/file/DebugConfiguration.java index 85815107ff..900dca3aeb 100644 --- a/openam-shared/src/main/java/com/sun/identity/shared/debug/file/DebugConfiguration.java +++ b/openam-shared/src/main/java/com/sun/identity/shared/debug/file/DebugConfiguration.java @@ -24,7 +24,7 @@ public interface DebugConfiguration { /** * Get the debug prefix configuration * - * @return prefix + * @return prefix, never {@code null}; an empty string if no prefix is configured */ public String getDebugPrefix(); @@ -33,7 +33,7 @@ public interface DebugConfiguration { * Suffix is an empty string or contains a date format if the * rotation interval is enable ({@code rotation interval > 0}) * - * @return suffix + * @return suffix, never {@code null}; an empty string if no suffix is configured */ public String getDebugSuffix(); diff --git a/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugConfigurationFromProperties.java b/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugConfigurationFromProperties.java index b71da26199..324f134018 100644 --- a/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugConfigurationFromProperties.java +++ b/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugConfigurationFromProperties.java @@ -12,6 +12,7 @@ * information: "Portions copyright [year] [name of copyright owner]". * * Copyright 2015-2016 ForgeRock AS. + * Portions Copyright 2026 3A Systems, LLC. */ package com.sun.identity.shared.debug.file.impl; @@ -20,7 +21,6 @@ import com.sun.identity.shared.debug.DebugConstants; import com.sun.identity.shared.debug.file.DebugConfiguration; import org.forgerock.openam.utils.IOUtils; -import org.forgerock.openam.utils.StringUtils; import java.io.IOException; import java.io.InputStream; @@ -46,6 +46,7 @@ public class DebugConfigurationFromProperties implements DebugConfiguration { * It will reset the current properties for every Debug instance * * @param debugFilePropertiesPath path to the debug configuration file + * @throws InvalidDebugConfigurationException if the file can't be found, can't be read or isn't valid */ public DebugConfigurationFromProperties(String debugFilePropertiesPath) throws InvalidDebugConfigurationException { InputStream is = null; @@ -58,15 +59,20 @@ public DebugConfigurationFromProperties(String debugFilePropertiesPath) throws I Properties rotationConfig = new Properties(); rotationConfig.load(is); - debugPrefix = rotationConfig.getProperty(DebugConstants.CONFIG_DEBUG_LOGFILE_PREFIX); - debugSuffix = rotationConfig.getProperty(DebugConstants.CONFIG_DEBUG_LOGFILE_SUFFIX); + debugPrefix = getTrimmedProperty(rotationConfig, DebugConstants.CONFIG_DEBUG_LOGFILE_PREFIX); + debugSuffix = getTrimmedProperty(rotationConfig, DebugConstants.CONFIG_DEBUG_LOGFILE_SUFFIX); - String maxFileSizedInMb = rotationConfig.getProperty(DebugConstants.CONFIG_DEBUG_LOGFILE_MAX_SIZE); - if (!StringUtils.isEmpty(maxFileSizedInMb)) { + String maxFileSizedInMb = getTrimmedProperty(rotationConfig, DebugConstants.CONFIG_DEBUG_LOGFILE_MAX_SIZE); + if (!maxFileSizedInMb.isEmpty()) { try { - maxFileSizeInByte = Integer.parseInt(maxFileSizedInMb); + int maxFileSizeInMb = Integer.parseInt(maxFileSizedInMb); + if (maxFileSizeInMb <= 0) { + throw new InvalidDebugConfigurationException("File size rotation needs to be greater than " + + "zero. File size rotation = '" + maxFileSizeInMb + "' MB. Leave the value empty to " + + "disable file size rotation.", null); + } //Convert MaxFileSize to byte - maxFileSizeInByte <<= 20; + maxFileSizeInByte = (long) maxFileSizeInMb << 20; } catch (NumberFormatException e) { //Can't parse the number String message = "The '" + DebugConstants.CONFIG_DEBUG_LOGFILE_MAX_SIZE + "' value : " @@ -76,10 +82,16 @@ public DebugConfigurationFromProperties(String debugFilePropertiesPath) throws I } } - String rotation = rotationConfig.getProperty(DebugConstants.CONFIG_DEBUG_LOGFILE_ROTATION); - if (!StringUtils.isEmpty(rotation)) { + String rotation = getTrimmedProperty(rotationConfig, DebugConstants.CONFIG_DEBUG_LOGFILE_ROTATION); + if (!rotation.isEmpty()) { try { - rotationInterval = Integer.parseInt(rotation); + int interval = Integer.parseInt(rotation); + if (interval <= 0) { + throw new InvalidDebugConfigurationException("Rotation interval needs to be greater than " + + "zero. rotationInterval = '" + interval + "'. Leave the value empty to disable time " + + "rotation.", null); + } + rotationInterval = interval; } catch (NumberFormatException e) { //Can't parse the number String message = "'" + DebugConstants.CONFIG_DEBUG_LOGFILE_ROTATION + "' value can't be parsed: '" + @@ -96,12 +108,20 @@ public DebugConfigurationFromProperties(String debugFilePropertiesPath) throws I String message = "Can't load debug file properties. Please check the configuration file '" + debugFilePropertiesPath + "'."; throw new InvalidDebugConfigurationException(message); + } catch (RuntimeException ex) { + //the file can't be read, for example it contains a malformed Unicode escape + throw new InvalidDebugConfigurationException("Can't load debug file properties from '" + + debugFilePropertiesPath + "': " + ex, ex); } finally { IOUtils.closeIfNotNull(is); } } + private static String getTrimmedProperty(Properties properties, String key) { + return properties.getProperty(key, "").trim(); + } + @Override public String getDebugPrefix() { return debugPrefix; @@ -129,12 +149,7 @@ public long getRotationFileSizeInByte() { */ private void validate() throws InvalidDebugConfigurationException { - if (getRotationFileSizeInByte() != -1) { - if (getRotationFileSizeInByte() <= 0) { - throw new InvalidDebugConfigurationException("File size rotation needs to be greater than " + - "zero. File size rotation = '" + getRotationFileSizeInByte() + "'", null); - } - + if (getRotationFileSizeInByte() > 0) { if (getDebugSuffix().isEmpty()) { throw new InvalidDebugConfigurationException("Log size rotation is enabled (File size rotation = " + getRotationFileSizeInByte() + ") but the debug suffix is empty"); @@ -151,12 +166,7 @@ private void validate() throws InvalidDebugConfigurationException { } } - if (getRotationInterval() != -1) { - if (getRotationInterval() <= 0) { - throw new InvalidDebugConfigurationException("Rotation interval needs to be greater than zero. " + - "rotationInterval = '" + rotationInterval + "'", null); - } - + if (getRotationInterval() > 0) { if (getDebugSuffix().isEmpty()) { throw new InvalidDebugConfigurationException("Log time rotation is enabled (rotation interval = " + getRotationInterval() + ") but the debug suffix is empty"); diff --git a/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugFileImpl.java b/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugFileImpl.java index 89189d634d..d8ead23d48 100644 --- a/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugFileImpl.java +++ b/openam-shared/src/main/java/com/sun/identity/shared/debug/file/impl/DebugFileImpl.java @@ -184,9 +184,7 @@ private String wrapFilename(String fileName) { StringBuilder newFileName = new StringBuilder(); //Set prefix - if (configuration.getDebugPrefix() != null) { - newFileName.append(configuration.getDebugPrefix()); - } + newFileName.append(configuration.getDebugPrefix()); //Set name newFileName.append(fileName); @@ -224,7 +222,7 @@ private void initialize() throws IOException { fileCreationTime -= fileCreationTime % (1000 * 60); } - nextRotation = fileCreationTime + configuration.getRotationInterval() * 60 * 1000; + nextRotation = fileCreationTime + configuration.getRotationInterval() * 60L * 1000; boolean directoryAvailable = false; String debugDir = debugDirectory.get(); diff --git a/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugConfigurationFromPropertiesTest.java b/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugConfigurationFromPropertiesTest.java index 2816833fab..277d261ee1 100644 --- a/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugConfigurationFromPropertiesTest.java +++ b/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugConfigurationFromPropertiesTest.java @@ -12,6 +12,7 @@ * information: "Portions copyright [year] [name of copyright owner]". * * Copyright 2014-2016 ForgeRock AS. + * Portions Copyright 2026 3A Systems, LLC. */ package com.sun.identity.shared.debug; @@ -87,48 +88,130 @@ public void sizeAndTimeRotationConfig() throws Exception { Assert.assertEquals(debugConfigurationFromProperties.getRotationInterval(), 3); Assert.assertEquals(debugConfigurationFromProperties.getRotationFileSizeInByte(), 2 << 20); } + + @Test + public void largeSizeRotation() throws Exception { + DebugConfigurationFromProperties debugConfigurationFromProperties = new DebugConfigurationFromProperties + (DEBUG_CONFIG_DIRECTORY + "valid/largeSizeRotation.properties"); + Assert.assertEquals(debugConfigurationFromProperties.getRotationFileSizeInByte(), 2048L << 20); + } + + @Test + public void noPrefixAndSuffixLines() throws Exception { + DebugConfigurationFromProperties debugConfigurationFromProperties = new DebugConfigurationFromProperties + (DEBUG_CONFIG_DIRECTORY + "valid/noPrefixAndSuffixLines.properties"); + Assert.assertEquals(debugConfigurationFromProperties.getDebugPrefix(), ""); + Assert.assertEquals(debugConfigurationFromProperties.getDebugSuffix(), ""); + Assert.assertEquals(debugConfigurationFromProperties.getRotationInterval(), -1, "Debug rotation should be " + + "empty"); + Assert.assertEquals(debugConfigurationFromProperties.getRotationFileSizeInByte(), -1, "Debug file size " + + "rotation should be empty"); + } + + @Test + public void trailingWhitespace() throws Exception { + DebugConfigurationFromProperties debugConfigurationFromProperties = new DebugConfigurationFromProperties + (DEBUG_CONFIG_DIRECTORY + "valid/trailingWhitespace.properties"); + Assert.assertEquals(debugConfigurationFromProperties.getDebugPrefix(), "openam_"); + Assert.assertEquals(debugConfigurationFromProperties.getDebugSuffix(), "-MM.dd.yyyy-HH.mm.ss.SSS"); + Assert.assertEquals(debugConfigurationFromProperties.getRotationInterval(), 3); + Assert.assertEquals(debugConfigurationFromProperties.getRotationFileSizeInByte(), 2 << 20); + } /* * Invalid configuration */ - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Can't load debug file properties from '.*': " + + "java\\.lang\\.IllegalArgumentException: Malformed .*") + public void malformedUnicodeEscape() throws Exception { + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/malformedUnicodeEscape.properties"); + } + + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Suffix '.*' can't be parsed\\.") public void cantParseSuffix() throws Exception { new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/cantParseSuffix.properties"); } - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Rotation interval needs to be greater than zero\\. .*\\. " + + "Leave the value empty to disable time rotation\\.") public void negativeRotation() throws Exception { new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/negativeTimeRotation.properties"); } - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Rotation interval needs to be greater than zero\\. .*\\. " + + "Leave the value empty to disable time rotation\\.") + public void minusOneRotation() throws Exception { + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/minusOneTimeRotation.properties"); + } + + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Rotation interval needs to be greater than zero\\. .*\\. " + + "Leave the value empty to disable time rotation\\.") + public void zeroRotation() throws Exception { + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/zeroTimeRotation.properties"); + } + + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Suffix '.*' isn't compatible with the rotation interval requested " + + "'3'\\.") public void rotationNotCompatibleWithSuffix() throws Exception { - new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/rotatioTimenNotCompatibleWithSuffix" + + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/timeRotationNotCompatibleWithSuffix" + ".properties"); } - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Log time rotation is enabled .* but the debug suffix is empty") public void suffixEmptyAndRotationEnabled() throws Exception { - new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/suffixEmptyAndRotationTimeEnabled" + + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/suffixEmptyAndRotationTimeEnable" + ".properties"); } - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "File size rotation needs to be greater than zero\\. " + + "File size rotation = '-2' MB\\. Leave the value empty to disable file size rotation\\.") public void negativeSizeRotation() throws Exception { new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/negativeSizeRotation.properties"); } - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "File size rotation needs to be greater than zero\\. .*\\. " + + "Leave the value empty to disable file size rotation\\.") + public void zeroSizeRotation() throws Exception { + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/zeroSizeRotation.properties"); + } + + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Log size rotation is enabled .* but the debug suffix is empty") public void suffixEmptyAndSizeRotationEnable() throws Exception { - new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/suffixEmptyAndSizeRotationEnable" + + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/suffixEmptyAndSizeRotationTimeEnable" + ".properties"); } - @Test(expectedExceptions = InvalidDebugConfigurationException.class) + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "This suffix '.*' isn't compatible with the file size rotation " + + "enable\\.") public void suffixNotCompatibleWithFileSizeRotationEnable() throws Exception { new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/suffixNotCompatibleWithFileSize" + "RotationEnable.properties"); } + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Log time rotation is enabled .* but the debug suffix is empty") + public void noSuffixLineAndTimeRotationEnabled() throws Exception { + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/noSuffixLineAndTimeRotationEnabled" + + ".properties"); + } + + @Test(expectedExceptions = InvalidDebugConfigurationException.class, + expectedExceptionsMessageRegExp = "Log size rotation is enabled .* but the debug suffix is empty") + public void noSuffixLineAndSizeRotationEnabled() throws Exception { + new DebugConfigurationFromProperties(DEBUG_CONFIG_DIRECTORY + "invalid/noSuffixLineAndSizeRotationEnabled" + + ".properties"); + } + } diff --git a/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugRotationTest.java b/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugRotationTest.java index 45bbfc7f5f..57670572c5 100644 --- a/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugRotationTest.java +++ b/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugRotationTest.java @@ -12,6 +12,7 @@ * information: "Portions copyright [year] [name of copyright owner]". * * Copyright 2014-2016 ForgeRock AS. + * Portions Copyright 2026 3A Systems, LLC. */ package com.sun.identity.shared.debug; @@ -29,6 +30,7 @@ import java.util.List; import static org.forgerock.openam.utils.Time.*; +import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertTrue; @@ -71,6 +73,31 @@ public void checkLogFileSize(String debugName, int maxMb) { } } + /** A rotation interval longer than {@code Integer.MAX_VALUE} milliseconds does not rotate every minute. */ + @Test + public void longTimeRotation() throws Exception { + String DEBUG_CONFIG_FOR_TEST = "/debug_config_test/debugconfigLongRotation.properties"; + + initializeProperties(); + initializeProvider(DEBUG_CONFIG_FOR_TEST); + + Calendar calInitTime = getCalendarInstance(); + calInitTime.set(2015, Calendar.MAY, 16, 0, 0, 0); + calInitTime.set(Calendar.MILLISECOND, 0); + AccelerateTimeService accelerateClock = new AccelerateTimeService(calInitTime.getTimeInMillis()); + debugFileProvider.setClock(accelerateClock); + + final String debugName = "debugTestForLongRotation"; + IDebug debugTest = provider.getInstance(debugName); + + debugTest.error("Should appear in the first file", null); + accelerateClock.incrementTime(1000 * 60 + 10); + debugTest.error("Should appear in the first file too", null); + + File[] logFiles = new File(debugDirectory).listFiles((dir, name) -> name.startsWith(debugName)); + assertEquals(logFiles.length, 1, "Debug files rotated before the rotation interval"); + } + public void rotationInNormalDate() throws Exception { Calendar calRandomDate = getCalendarInstance(); calRandomDate.set(Calendar.YEAR, 1989); diff --git a/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugTest.java b/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugTest.java index 48de0b28b4..d0b232ba48 100644 --- a/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugTest.java +++ b/openam-shared/src/test/java/com/sun/identity/shared/debug/DebugTest.java @@ -133,4 +133,18 @@ public void shouldContinueALineBreakInTheMessageIndented() throws Exception { Assert.assertTrue(log.contains("\n forged"), log); } + /** A configuration file without the prefix and suffix lines writes to a file named after the debug log. */ + @Test + public void shouldWriteWithoutPrefixAndSuffixLines() throws Exception { + // given + initializeProvider("/debug_config_test/config_validation/valid/noPrefixAndSuffixLines.properties"); + IDebug debug = provider.getInstance(logName); + + // when + debug.error("Should appear in log", null); + + // then + checkLogFileStatus(true, logName); + } + } diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/cantParseSuffix.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/cantParseSuffix.properties index d874583da5..4359c48af6 100644 --- a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/cantParseSuffix.properties +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/cantParseSuffix.properties @@ -12,7 +12,8 @@ # information: "Portions copyright [year] [name of copyright owner]". # # Copyright 2015 ForgeRock AS. +# Portions Copyright 2026 3A Systems, LLC. # org.forgerock.openam.debug.prefix= -org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.ww +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.qq org.forgerock.openam.debug.rotation=3 \ No newline at end of file diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/malformedUnicodeEscape.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/malformedUnicodeEscape.properties new file mode 100644 index 0000000000..9aa1d498ee --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/malformedUnicodeEscape.properties @@ -0,0 +1,18 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix=\user_ +org.forgerock.openam.debug.suffix= +org.forgerock.openam.debug.rotation= diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/minusOneTimeRotation.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/minusOneTimeRotation.properties new file mode 100644 index 0000000000..656d759c96 --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/minusOneTimeRotation.properties @@ -0,0 +1,18 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH +org.forgerock.openam.debug.rotation=-1 diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/noSuffixLineAndSizeRotationEnabled.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/noSuffixLineAndSizeRotationEnabled.properties new file mode 100644 index 0000000000..d876b31c6f --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/noSuffixLineAndSizeRotationEnabled.properties @@ -0,0 +1,18 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.rotation= +org.forgerock.openam.debug.rotation.maxsize=2 diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/noSuffixLineAndTimeRotationEnabled.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/noSuffixLineAndTimeRotationEnabled.properties new file mode 100644 index 0000000000..4b669e3b25 --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/noSuffixLineAndTimeRotationEnabled.properties @@ -0,0 +1,17 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.rotation=3 diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/zeroSizeRotation.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/zeroSizeRotation.properties new file mode 100644 index 0000000000..8663ddf654 --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/zeroSizeRotation.properties @@ -0,0 +1,19 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.mm.ss.SSS +org.forgerock.openam.debug.rotation= +org.forgerock.openam.debug.rotation.maxsize=0 diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/zeroTimeRotation.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/zeroTimeRotation.properties new file mode 100644 index 0000000000..a722949123 --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/invalid/zeroTimeRotation.properties @@ -0,0 +1,18 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH +org.forgerock.openam.debug.rotation=0 diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/valid/largeSizeRotation.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/valid/largeSizeRotation.properties new file mode 100644 index 0000000000..da6b0dec2a --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/valid/largeSizeRotation.properties @@ -0,0 +1,19 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.mm.ss.SSS +org.forgerock.openam.debug.rotation= +org.forgerock.openam.debug.rotation.maxsize=2048 diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/valid/noPrefixAndSuffixLines.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/valid/noPrefixAndSuffixLines.properties new file mode 100644 index 0000000000..9fa9ccd08a --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/valid/noPrefixAndSuffixLines.properties @@ -0,0 +1,16 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.rotation= diff --git a/openam-shared/src/test/resources/debug_config_test/config_validation/valid/trailingWhitespace.properties b/openam-shared/src/test/resources/debug_config_test/config_validation/valid/trailingWhitespace.properties new file mode 100644 index 0000000000..fe4a84a2f9 --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/config_validation/valid/trailingWhitespace.properties @@ -0,0 +1,19 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix=openam_ +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.mm.ss.SSS +org.forgerock.openam.debug.rotation=3 +org.forgerock.openam.debug.rotation.maxsize=2 diff --git a/openam-shared/src/test/resources/debug_config_test/debugconfigLongRotation.properties b/openam-shared/src/test/resources/debug_config_test/debugconfigLongRotation.properties new file mode 100644 index 0000000000..088eab184a --- /dev/null +++ b/openam-shared/src/test/resources/debug_config_test/debugconfigLongRotation.properties @@ -0,0 +1,18 @@ +# +# The contents of this file are subject to the terms of the Common Development and +# Distribution License (the License). You may not use this file except in compliance with the +# License. +# +# You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the +# specific language governing permission and limitations under the License. +# +# When distributing Covered Software, include this CDDL Header Notice in each file and include +# the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL +# Header, with the fields enclosed by brackets [] replaced by your own identifying +# information: "Portions copyright [year] [name of copyright owner]". +# +# Copyright 2026 3A Systems, LLC. +# +org.forgerock.openam.debug.prefix= +org.forgerock.openam.debug.suffix=-MM.dd.yyyy-HH.mm +org.forgerock.openam.debug.rotation=43200