Skip to content

Commit a579d19

Browse files
authored
📁 pre-commit
Signed-off-by: exadev[bot] <exadev[bot]@users.noreply.github.com>
1 parent 798fc25 commit a579d19

File tree

2 files changed

+27
-18
lines changed

2 files changed

+27
-18
lines changed

app/core/src/main/java/stirling/software/SPDF/controller/api/misc/ShowJavascript.java

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package stirling.software.SPDF.controller.api.misc;
22

3-
import io.github.pixee.security.Filenames;
4-
import io.swagger.v3.oas.annotations.Operation;
5-
import io.swagger.v3.oas.annotations.tags.Tag;
6-
import lombok.RequiredArgsConstructor;
3+
import java.nio.charset.StandardCharsets;
4+
import java.util.Map;
5+
76
import org.apache.pdfbox.pdmodel.PDDocument;
87
import org.apache.pdfbox.pdmodel.common.PDNameTreeNode;
98
import org.apache.pdfbox.pdmodel.interactive.action.PDActionJavaScript;
@@ -14,13 +13,17 @@
1413
import org.springframework.web.bind.annotation.RequestMapping;
1514
import org.springframework.web.bind.annotation.RestController;
1615
import org.springframework.web.multipart.MultipartFile;
16+
17+
import io.github.pixee.security.Filenames;
18+
import io.swagger.v3.oas.annotations.Operation;
19+
import io.swagger.v3.oas.annotations.tags.Tag;
20+
21+
import lombok.RequiredArgsConstructor;
22+
1723
import stirling.software.common.model.api.PDFFile;
1824
import stirling.software.common.service.CustomPDFDocumentFactory;
1925
import stirling.software.common.util.WebResponseUtils;
2026

21-
import java.nio.charset.StandardCharsets;
22-
import java.util.Map;
23-
2427
@RestController
2528
@RequestMapping("/api/v1/misc")
2629
@Tag(name = "Misc", description = "Miscellaneous APIs")
@@ -55,22 +58,25 @@ public ResponseEntity<byte[]> extractHeader(@ModelAttribute PDFFile file) throws
5558

5659
if (jsCodeStr != null && !jsCodeStr.trim().isEmpty()) {
5760
script.append("// File: ")
58-
.append(Filenames.toSimpleFileName(inputFile.getOriginalFilename()))
59-
.append(", Script: ")
60-
.append(name)
61-
.append("\n")
62-
.append(jsCodeStr)
63-
.append("\n");
61+
.append(
62+
Filenames.toSimpleFileName(
63+
inputFile.getOriginalFilename()))
64+
.append(", Script: ")
65+
.append(name)
66+
.append("\n")
67+
.append(jsCodeStr)
68+
.append("\n");
6469
foundScript = true;
6570
}
6671
}
6772
}
6873
}
6974

7075
if (!foundScript) {
71-
script = new StringBuilder("PDF '")
72-
.append(Filenames.toSimpleFileName(inputFile.getOriginalFilename()))
73-
.append("' does not contain Javascript");
76+
script =
77+
new StringBuilder("PDF '")
78+
.append(Filenames.toSimpleFileName(inputFile.getOriginalFilename()))
79+
.append("' does not contain Javascript");
7480
}
7581

7682
return WebResponseUtils.bytesToWebResponse(

app/proprietary/src/main/java/stirling/software/proprietary/security/service/CustomUserDetailsService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,11 @@ public UserDetails loadUserByUsername(String username) throws UsernameNotFoundEx
7575
*/
7676
private AuthenticationType determinePreferredSSOType() {
7777
// Check what SSO types are enabled and prefer in order: OAUTH2 > SAML2 > fallback to OAUTH2
78-
boolean oauth2Enabled = securityProperties.getOauth2() != null && securityProperties.getOauth2().getEnabled();
79-
boolean saml2Enabled = securityProperties.getSaml2() != null && securityProperties.getSaml2().getEnabled();
78+
boolean oauth2Enabled =
79+
securityProperties.getOauth2() != null
80+
&& securityProperties.getOauth2().getEnabled();
81+
boolean saml2Enabled =
82+
securityProperties.getSaml2() != null && securityProperties.getSaml2().getEnabled();
8083

8184
if (oauth2Enabled) {
8285
return AuthenticationType.OAUTH2;

0 commit comments

Comments
 (0)