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:
Dario Ghunney Ware
2025-09-30 12:02:11 +01:00
committed by GitHub
parent 7bd31a954e
commit dabc52ef73
15 changed files with 111 additions and 107 deletions

View File

@@ -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();
}
}

View File

@@ -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) {}
}