mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-03-19 02:22:11 +01:00
Defaulting JWT settings to false (#4416)
Defaulting the configuration settings for Stirling PDF's JWT to false to avoid any unexpected issues
This commit is contained in:
committed by
GitHub
parent
7bd31a954e
commit
dabc52ef73
@@ -303,11 +303,10 @@ public class ApplicationProperties {
|
||||
|
||||
@Data
|
||||
public static class Jwt {
|
||||
private boolean enableKeystore = true;
|
||||
private boolean enableKeyRotation = false;
|
||||
private boolean enableKeyCleanup = true;
|
||||
private boolean enabled = true;
|
||||
private boolean keyCleanup = true;
|
||||
private int keyRetentionDays = 7;
|
||||
private boolean secureCookie;
|
||||
private Boolean secureCookie;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,16 +376,19 @@ public class ApplicationProperties {
|
||||
|
||||
@JsonIgnore
|
||||
public String getBaseTmpDir() {
|
||||
return baseTmpDir != null && !baseTmpDir.isEmpty()
|
||||
? baseTmpDir
|
||||
: java.lang.System.getProperty("java.io.tmpdir") + "/stirling-pdf";
|
||||
if (baseTmpDir != null && !baseTmpDir.isEmpty()) {
|
||||
return baseTmpDir;
|
||||
}
|
||||
String tmp = java.lang.System.getProperty("java.io.tmpdir");
|
||||
return new File(tmp, "stirling-pdf").getPath();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public String getLibreofficeDir() {
|
||||
return libreofficeDir != null && !libreofficeDir.isEmpty()
|
||||
? libreofficeDir
|
||||
: getBaseTmpDir() + "/libreoffice";
|
||||
if (libreofficeDir != null && !libreofficeDir.isEmpty()) {
|
||||
return libreofficeDir;
|
||||
}
|
||||
return new File(getBaseTmpDir(), "libreoffice").getPath();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -636,7 +636,7 @@ public class PdfUtils {
|
||||
case "equal" -> actualPageCount == pageCount;
|
||||
case "less" -> actualPageCount < pageCount;
|
||||
default ->
|
||||
throw ExceptionUtils.createInvalidArgumentException("comparator", comparator);
|
||||
throw ExceptionUtils.createInvalidArgumentException("comparator", comparator);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -659,15 +659,9 @@ public class PdfUtils {
|
||||
return actualPageWidth == expectedPageWidth && actualPageHeight == expectedPageHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
* Key for storing the dimensions of a rendered image in a map.
|
||||
*/
|
||||
private record PdfRenderSettingsKey(float mediaBoxWidth, float mediaBoxHeight, int rotation) {
|
||||
}
|
||||
/** Key for storing the dimensions of a rendered image in a map. */
|
||||
private record PdfRenderSettingsKey(float mediaBoxWidth, float mediaBoxHeight, int rotation) {}
|
||||
|
||||
/**
|
||||
* Value for storing the dimensions of a rendered image in a map.
|
||||
*/
|
||||
private record PdfImageDimensionValue(int width, int height) {
|
||||
}
|
||||
/** Value for storing the dimensions of a rendered image in a map. */
|
||||
private record PdfImageDimensionValue(int width, int height) {}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import stirling.software.common.model.ApplicationProperties.Driver;
|
||||
import stirling.software.common.model.ApplicationProperties.Premium;
|
||||
import stirling.software.common.model.ApplicationProperties.Security;
|
||||
import stirling.software.common.model.exception.UnsupportedProviderException;
|
||||
import stirling.software.common.util.RegexPatternUtils;
|
||||
|
||||
class ApplicationPropertiesLogicTest {
|
||||
|
||||
@@ -39,15 +38,12 @@ class ApplicationPropertiesLogicTest {
|
||||
new ApplicationProperties.TempFileManagement();
|
||||
|
||||
String expectedBase =
|
||||
RegexPatternUtils.getInstance()
|
||||
.getTrailingSlashesPattern()
|
||||
.matcher(java.lang.System.getProperty("java.io.tmpdir"))
|
||||
.replaceAll("")
|
||||
+ "/stirling-pdf";
|
||||
assertEquals(expectedBase, normalize.apply(tfm.getBaseTmpDir()));
|
||||
Paths.get(java.lang.System.getProperty("java.io.tmpdir"), "stirling-pdf")
|
||||
.toString();
|
||||
assertEquals(expectedBase, tfm.getBaseTmpDir());
|
||||
|
||||
String expectedLibre = expectedBase + "/libreoffice";
|
||||
assertEquals(expectedLibre, normalize.apply(tfm.getLibreofficeDir()));
|
||||
String expectedLibre = Paths.get(expectedBase, "libreoffice").toString();
|
||||
assertEquals(expectedLibre, tfm.getLibreofficeDir());
|
||||
|
||||
tfm.setBaseTmpDir("/custom/base");
|
||||
assertEquals("/custom/base", normalize.apply(tfm.getBaseTmpDir()));
|
||||
|
||||
Reference in New Issue
Block a user