mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2026-04-22 23:08:53 +02:00
fileshare (#5414)
Co-authored-by: ConnorYoh <40631091+ConnorYoh@users.noreply.github.com> Co-authored-by: Connor Yoh <con.yoh13@gmail.com> Co-authored-by: EthanHealy01 <80844253+EthanHealy01@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
@@ -58,6 +58,7 @@ public class ApplicationProperties {
|
||||
private Legal legal = new Legal();
|
||||
private Security security = new Security();
|
||||
private System system = new System();
|
||||
private Storage storage = new Storage();
|
||||
private Ui ui = new Ui();
|
||||
private Endpoints endpoints = new Endpoints();
|
||||
private Metrics metrics = new Metrics();
|
||||
@@ -634,6 +635,41 @@ public class ApplicationProperties {
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Storage {
|
||||
private boolean enabled = false;
|
||||
private String provider = "local";
|
||||
private Local local = new Local();
|
||||
private Quotas quotas = new Quotas();
|
||||
private Sharing sharing = new Sharing();
|
||||
private Signing signing = new Signing();
|
||||
|
||||
@Data
|
||||
public static class Local {
|
||||
private String basePath = InstallationPathConfig.getPath() + "storage";
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Sharing {
|
||||
private boolean enabled = false;
|
||||
private boolean linkEnabled = false;
|
||||
private boolean emailEnabled = false;
|
||||
private int linkExpirationDays = 3;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Quotas {
|
||||
private long maxStorageMbPerUser = -1;
|
||||
private long maxStorageMbTotal = -1;
|
||||
private long maxFileMb = -1;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Signing {
|
||||
private boolean enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DatabaseBackup {
|
||||
private String cron = "0 0 0 * * ?"; // daily at midnight
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package stirling.software.common.model.api.security;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UserSummaryDTO {
|
||||
private Long userId;
|
||||
private String username;
|
||||
private String displayName;
|
||||
private String teamName;
|
||||
private boolean enabled;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package stirling.software.common.service;
|
||||
|
||||
import java.security.KeyStore;
|
||||
|
||||
/**
|
||||
* Abstraction for PDF digital signature operations. Defined in common so that proprietary services
|
||||
* can use it without creating a circular dependency on core.
|
||||
*/
|
||||
public interface PdfSigningService {
|
||||
|
||||
/**
|
||||
* Signs a PDF document using the provided KeyStore.
|
||||
*
|
||||
* @param pdfBytes raw PDF bytes to sign
|
||||
* @param keystore the KeyStore containing the signing key and certificate chain
|
||||
* @param password keystore password
|
||||
* @param showSignature whether to render a visible signature block
|
||||
* @param pageNumber 0-indexed page on which to render the visible signature (may be null)
|
||||
* @param name signer name embedded in the signature
|
||||
* @param location location string embedded in the signature
|
||||
* @param reason reason string embedded in the signature
|
||||
* @param showLogo whether to include the Stirling-PDF logo in the visible signature
|
||||
* @return signed PDF bytes
|
||||
* @throws Exception on any signing failure
|
||||
*/
|
||||
byte[] signWithKeystore(
|
||||
byte[] pdfBytes,
|
||||
KeyStore keystore,
|
||||
char[] password,
|
||||
boolean showSignature,
|
||||
Integer pageNumber,
|
||||
String name,
|
||||
String location,
|
||||
String reason,
|
||||
boolean showLogo)
|
||||
throws Exception;
|
||||
}
|
||||
Reference in New Issue
Block a user