diff --git a/.vscode/settings.json b/.vscode/settings.json index e45bc4dd9..f759730f2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -50,8 +50,10 @@ ".vscode/", "bin/", "common/bin/", + "proprietary/bin/", "build/", "common/build/", + "proprietary/build/", "configs/", "customFiles/", "docs/", @@ -66,6 +68,7 @@ ".gitattributes", ".gitignore", "common/.gitignore", + "proprietary/.gitignore", ".pre-commit-config.yaml", ], // Enables signature help in Java. diff --git a/build.gradle b/build.gradle index 832a0f4a5..87c603617 100644 --- a/build.gradle +++ b/build.gradle @@ -354,6 +354,7 @@ spotless { java { target sourceSets.main.allJava target project(':common').sourceSets.main.allJava + target project(':proprietary').sourceSets.main.allJava googleJavaFormat("1.27.0").aosp().reorderImports(false) diff --git a/common/src/main/java/stirling/software/common/configuration/AppConfig.java b/common/src/main/java/stirling/software/common/configuration/AppConfig.java index 732a3b174..f6b8b2d45 100644 --- a/common/src/main/java/stirling/software/common/configuration/AppConfig.java +++ b/common/src/main/java/stirling/software/common/configuration/AppConfig.java @@ -10,6 +10,7 @@ import java.util.Properties; import java.util.function.Predicate; import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.context.annotation.Bean; @@ -146,8 +147,16 @@ public class AppConfig { } } - @ConditionalOnMissingClass("stirling.software.SPDF.config.security.SecurityConfiguration") @Bean(name = "activeSecurity") + @ConditionalOnClass( + name = "stirling.software.proprietary.security.configuration.SecurityConfiguration") + public boolean activeSecurity() { + return true; + } + + @Bean(name = "missingActiveSecurity") + @ConditionalOnMissingClass( + "stirling.software.proprietary.security.configuration.SecurityConfiguration") public boolean missingActiveSecurity() { return false; } diff --git a/proprietary/LICENSE-proprietary b/proprietary/LICENSE-proprietary index df9b7b974..d26855680 100644 --- a/proprietary/LICENSE-proprietary +++ b/proprietary/LICENSE-proprietary @@ -14,11 +14,8 @@ covering the appropriate number of licensed users. Trial and Minimal Use -You may use the Software without a paid subscription for the sole purposes of internal trial, evaluation, or minimal use, -provided that: - -* Use is limited to no more than five (5) named users or sessions; -* Use is strictly non-production, for internal testing or evaluation only; +You may use the Software without a paid subscription for the sole purposes of internal trial, evaluation, or minimal use, provided that: +* Use is limited to the capabilities and restrictions defined by the Software itself; * You do not copy, distribute, sublicense, reverse-engineer, or use the Software in client-facing or commercial contexts. Continued use beyond this scope requires a valid Stirling PDF User License. diff --git a/proprietary/build.gradle b/proprietary/build.gradle index 5c91d21ba..331476f57 100644 --- a/proprietary/build.gradle +++ b/proprietary/build.gradle @@ -26,17 +26,17 @@ dependencyManagement { dependencies { implementation project(':common') - implementation 'org.springframework:spring-jdbc' - implementation 'org.springframework:spring-webmvc' - implementation 'org.springframework.session:spring-session-core' - implementation "org.springframework.security:spring-security-core:$springSecuritySamlVersion" - implementation "org.springframework.security:spring-security-saml2-service-provider:$springSecuritySamlVersion" - implementation 'org.springframework.boot:spring-boot-starter-jetty' - implementation 'org.springframework.boot:spring-boot-starter-security' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.springframework.boot:spring-boot-starter-oauth2-client' - implementation 'org.springframework.boot:spring-boot-starter-mail' - implementation 'io.swagger.core.v3:swagger-core-jakarta:2.2.30' + api 'org.springframework:spring-jdbc' + api 'org.springframework:spring-webmvc' + api 'org.springframework.session:spring-session-core' + api "org.springframework.security:spring-security-core:$springSecuritySamlVersion" + api "org.springframework.security:spring-security-saml2-service-provider:$springSecuritySamlVersion" + api 'org.springframework.boot:spring-boot-starter-jetty' + api 'org.springframework.boot:spring-boot-starter-security' + api 'org.springframework.boot:spring-boot-starter-data-jpa' + api 'org.springframework.boot:spring-boot-starter-oauth2-client' + api 'org.springframework.boot:spring-boot-starter-mail' + api 'io.swagger.core.v3:swagger-core-jakarta:2.2.30' implementation 'com.bucket4j:bucket4j_jdk17-core:8.14.0' // https://mvnrepository.com/artifact/com.bucket4j/bucket4j_jdk17 @@ -44,7 +44,7 @@ dependencies { implementation 'io.github.pixee:java-security-toolkit:1.2.1' implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5:3.1.3.RELEASE' - implementation 'io.micrometer:micrometer-registry-prometheus' + api 'io.micrometer:micrometer-registry-prometheus' implementation 'com.unboundid.product.scim2:scim2-sdk-client:2.3.5' runtimeOnly 'com.h2database:h2:2.3.232' // Don't upgrade h2database runtimeOnly 'org.postgresql:postgresql:42.7.5' diff --git a/src/main/java/stirling/software/SPDF/EE/KeygenLicenseVerifier.java b/src/main/java/stirling/software/SPDF/EE/KeygenLicenseVerifier.java index c760a83c9..e92e048e9 100644 --- a/src/main/java/stirling/software/SPDF/EE/KeygenLicenseVerifier.java +++ b/src/main/java/stirling/software/SPDF/EE/KeygenLicenseVerifier.java @@ -520,7 +520,7 @@ public class KeygenLicenseVerifier { HttpResponse response = httpClient.send(request, HttpResponse.BodyHandlers.ofString()); - log.info("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"); @@ -529,9 +529,9 @@ public class KeygenLicenseVerifier { String detail = metaNode.path("detail").asText(); String code = metaNode.path("code").asText(); - log.info("License validity: " + isValid); - log.info("Validation detail: " + detail); - log.info("Validation code: " + code); + log.info("License validity: {}", isValid); + log.info("Validation detail: {}", detail); + log.info("Validation code: {}", code); // Check if the license itself has floating attribute JsonNode licenseAttrs = jsonResponse.path("data").path("attributes"); @@ -595,7 +595,7 @@ public class KeygenLicenseVerifier { .path("isEnterprise") .asBoolean(false); - log.info(applicationProperties.toString()); + log.debug(applicationProperties.toString()); } else { log.error("Error validating license. Status code: {}", response.statusCode());