Skip to content

Commit

Permalink
Merge branch 'main' into removes_unnecessary_casts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludy87 authored Feb 25, 2025
2 parents 7566e9f + 4c701b2 commit 5f72e1e
Show file tree
Hide file tree
Showing 85 changed files with 1,490 additions and 1,153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
@Service
@Slf4j
public class KeygenLicenseVerifier {
// todo: place in config files?
private static final String ACCOUNT_ID = "e5430f69-e834-4ae4-befd-b602aae5f372";
private static final String BASE_URL = "https://api.keygen.sh/v1/accounts";
private static final ObjectMapper objectMapper = new ObjectMapper();
Expand Down Expand Up @@ -68,7 +69,7 @@ public boolean verifyLicense(String licenseKey) {

return false;
} catch (Exception e) {
log.error("Error verifying license: " + e.getMessage());
log.error("Error verifying license: {}", e.getMessage());
return false;
}
}
Expand All @@ -95,10 +96,9 @@ private JsonNode validateLicense(String licenseKey, String machineFingerprint)
.build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
log.debug(" validateLicenseResponse body: " + response.body());
log.debug("ValidateLicenseResponse body: {}", response.body());
JsonNode jsonResponse = objectMapper.readTree(response.body());
if (response.statusCode() == 200) {

JsonNode metaNode = jsonResponse.path("meta");
boolean isValid = metaNode.path("valid").asBoolean();

Expand All @@ -120,7 +120,7 @@ private JsonNode validateLicense(String licenseKey, String machineFingerprint)
log.info(applicationProperties.toString());

} else {
log.error("Error validating license. Status code: " + response.statusCode());
log.error("Error validating license. Status code: {}", response.statusCode());
}
return jsonResponse;
}
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/stirling/software/SPDF/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public AppConfig(ApplicationProperties applicationProperties) {
}

@Bean
@ConditionalOnProperty(
name = "system.customHTMLFiles",
havingValue = "true",
matchIfMissing = false)
@ConditionalOnProperty(name = "system.customHTMLFiles", havingValue = "true")
public SpringTemplateEngine templateEngine(ResourceLoader resourceLoader) {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.addTemplateResolver(new FileFallbackTemplateResolver(resourceLoader));
Expand Down Expand Up @@ -129,8 +126,8 @@ public boolean isRunningInDockerWithConfig() {
}

@ConditionalOnMissingClass("stirling.software.SPDF.config.security.SecurityConfiguration")
@Bean(name = "activSecurity")
public boolean missingActivSecurity() {
@Bean(name = "activeSecurity")
public boolean missingActiveSecurity() {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CleanUrlInterceptor implements HandlerInterceptor {
"endpoints",
"logout",
"error",
"erroroauth",
"errorOAuth",
"file",
"messageType",
"infoMessage");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.sql.SQLException;
import java.util.List;

import stirling.software.SPDF.model.provider.UnsupportedProviderException;
import stirling.software.SPDF.model.exception.UnsupportedProviderException;
import stirling.software.SPDF.utils.FileInfo;

public interface DatabaseInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void onAuthenticationFailure(
}
if (exception instanceof BadCredentialsException
|| exception instanceof UsernameNotFoundException) {
getRedirectStrategy().sendRedirect(request, response, "/login?error=badcredentials");
getRedirectStrategy().sendRedirect(request, response, "/login?error=badCredentials");
return;
}
if (exception instanceof InternalAuthenticationServiceException
Expand Down
Loading

0 comments on commit 5f72e1e

Please sign in to comment.