Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #454

Merged
merged 72 commits into from
Sep 23, 2024
Merged

Test #454

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
691e26d
clean bower deps
dlemaignent Sep 4, 2024
d753dd5
update pdfjs
dlemaignent Sep 4, 2024
e0b28a9
Merge branch 'dev' into 'test'
dlemaignent Sep 4, 2024
c329367
fix fast sign test
dlemaignent Sep 4, 2024
c0c46b0
Merge branch 'dev' into 'test'
dlemaignent Sep 4, 2024
0f2881e
no sort on error
dlemaignent Sep 4, 2024
bc4d408
Merge branch 'dev' into 'test'
dlemaignent Sep 4, 2024
1e46789
no sort on error
dlemaignent Sep 4, 2024
3bf7ccf
Merge branch 'dev' into 'test'
dlemaignent Sep 4, 2024
8fc822e
remove wave effect
dlemaignent Sep 4, 2024
da69538
1.29.18-SNAPSHOT
dlemaignent Sep 4, 2024
37eacd9
fix no name on manage view
dlemaignent Sep 5, 2024
09254a5
Merge branch 'dev' into 'test'
dlemaignent Sep 5, 2024
1affcd1
fake sign spot generate from signature* link
dlemaignent Sep 6, 2024
a2dc4d4
Merge branch 'dev' into 'test'
dlemaignent Sep 6, 2024
0982e1f
scheduler clean endeds otps
dlemaignent Sep 6, 2024
a9ea95f
Merge branch 'dev' into 'test'
dlemaignent Sep 6, 2024
96542cd
fix link to sign space detection
dlemaignent Sep 9, 2024
64d0557
Merge branch 'dev' into 'test'
dlemaignent Sep 9, 2024
024ac34
fix link manager view
dlemaignent Sep 9, 2024
b969060
Merge branch 'dev' into 'test'
dlemaignent Sep 9, 2024
bd6ef18
enable scan by scanPdfMetadatas true
dlemaignent Sep 9, 2024
31769b4
Merge branch 'dev' into 'test'
dlemaignent Sep 9, 2024
3440dd2
fix error for no name users
dlemaignent Sep 10, 2024
075ab50
enable check sign position for admin workflows
dlemaignent Sep 10, 2024
4d4797d
Merge branch 'dev' into 'test'
dlemaignent Sep 10, 2024
e1965e7
disable allpagesign if currentStepMultiSign false
dlemaignent Sep 12, 2024
a2a8522
Merge branch 'dev' into 'test'
dlemaignent Sep 12, 2024
b882b3d
dss > 6.1 + 1.30.0-SNAPSHOT
dlemaignent Sep 12, 2024
8447716
Merge branch 'dev' into 'test'
dlemaignent Sep 12, 2024
31daf39
add signRequestParamsDetectionPattern feature
dlemaignent Sep 13, 2024
07ef46a
Merge branch 'dev' into 'test'
dlemaignent Sep 13, 2024
af8b530
fix wiz-workflow button
dlemaignent Sep 17, 2024
02d2b93
Merge branch 'dev' into 'test'
dlemaignent Sep 17, 2024
b1fec75
fix import from source
dlemaignent Sep 17, 2024
eb29db4
Merge branch 'dev' into 'test'
dlemaignent Sep 17, 2024
99238ef
Merge branch 'test' of gitlab.univ-rouen.fr:si/esup-signature into test
dlemaignent Sep 17, 2024
86911d8
add from by workflows
dlemaignent Sep 18, 2024
2744659
typo warningPDFA
dlemaignent Sep 18, 2024
5ff3ee4
use unicode font for sign + forms
dlemaignent Sep 18, 2024
f302919
typo help
dlemaignent Sep 18, 2024
1d28675
improve very much external sign experience
dlemaignent Sep 18, 2024
9aed58e
Merge branch 'dev' into 'test'
dlemaignent Sep 18, 2024
b9fa120
fix nav
dlemaignent Sep 18, 2024
70c146b
Merge branch 'dev' into 'test'
dlemaignent Sep 18, 2024
a1093e9
Merge branch 'test' of gitlab.univ-rouen.fr:si/esup-signature into test
dlemaignent Sep 18, 2024
d5ce61e
fix contruct role name
dlemaignent Sep 19, 2024
7bbc185
Merge branch 'dev' into 'test'
dlemaignent Sep 19, 2024
e2e5a43
rest target GET and POST + send refused, deleted, restored
dlemaignent Sep 19, 2024
40a8e6c
Merge branch 'dev' into 'test'
dlemaignent Sep 19, 2024
c0aa80a
clean rest send
dlemaignent Sep 19, 2024
d3d38a7
Merge branch 'dev' into 'test'
dlemaignent Sep 19, 2024
a731008
fix search on sympa
dlemaignent Sep 20, 2024
6f38b18
springboot 3.3.4
dlemaignent Sep 20, 2024
fbd0db9
Merge branch 'dev' into 'test'
dlemaignent Sep 20, 2024
53f4a71
fix filters in manage view
dlemaignent Sep 20, 2024
a640d0d
Merge branch 'dev' into 'test'
dlemaignent Sep 20, 2024
922da95
Merge branch 'test' of gitlab.univ-rouen.fr:si/esup-signature into test
dlemaignent Sep 20, 2024
71529b5
fix filters in manage view 2
dlemaignent Sep 20, 2024
5024147
Merge branch 'dev' into 'test'
dlemaignent Sep 20, 2024
3be6e19
fix filters in manage view 3
dlemaignent Sep 20, 2024
4225feb
Merge branch 'dev' into 'test'
dlemaignent Sep 20, 2024
d3d2e22
fix filters in manage view debug log
dlemaignent Sep 20, 2024
726f6bd
fix filters in manage view debug log1
dlemaignent Sep 20, 2024
72b26e8
fix filters in manage view debug
dlemaignent Sep 20, 2024
54f775f
fix filters in manage selects
dlemaignent Sep 20, 2024
16807a7
optimize manager view
dlemaignent Sep 23, 2024
1831a68
Merge branch 'dev' into 'test'
dlemaignent Sep 23, 2024
1552fc5
fix recipient filter
dlemaignent Sep 23, 2024
70179d5
Merge branch 'dev' into 'test'
dlemaignent Sep 23, 2024
77ba3b3
Merge branch 'test' of gitlab.univ-rouen.fr:si/esup-signature into test
dlemaignent Sep 23, 2024
111fbbb
Merge branch 'master' into test
dlemaignent Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 21 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.3.3</version>
<version>3.3.4</version>
<relativePath />
</parent>
<groupId>org.esupportail</groupId>
<artifactId>esup-signature</artifactId>
<version>1.29.17</version>
<version>1.30.0-SNAPSHOT</version>
<name>esup-signature</name>
<properties>
<startClass>org.esupportail.esupsignature.EsupSignatureApplication</startClass>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<dss.framework.version>6.0</dss.framework.version>
<dss.framework.version>6.1</dss.framework.version>
<dss.framework.safeVersion>5.4.3</dss.framework.safeVersion>
<skipDockerCompose>true</skipDockerCompose>
<skipSurefire>false</skipSurefire>
Expand Down Expand Up @@ -160,9 +160,9 @@
<version>0.59</version>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>google-code-prettify</artifactId>
<version>1.0.5</version>
<groupId>org.webjars</groupId>
<artifactId>prettify</artifactId>
<version>4-Mar-2013-1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand All @@ -183,7 +183,7 @@
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>pdfjs-dist</artifactId>
<version>4.4.168</version>
<version>4.6.82</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
Expand Down Expand Up @@ -236,9 +236,9 @@
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.webjars.bowergithub.ajaxorg</groupId>
<groupId>org.webjars.npm</groupId>
<artifactId>ace-builds</artifactId>
<version>1.4.13</version>
<version>1.35.3</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand Down Expand Up @@ -303,6 +303,11 @@
<artifactId>dss-model</artifactId>
<version>${dss.framework.version}</version>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-validation</artifactId>
<version>${dss.framework.version}</version>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-spi</artifactId>
Expand Down Expand Up @@ -438,6 +443,12 @@
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-pades-pdfbox</artifactId>
<version>${dss.framework.version}</version>
<exclusions>
<exclusion>
<artifactId>pdfbox</artifactId>
<groupId>org.apache.pdfbox</groupId>
</exclusion>
</exclusions>
</dependency>

<!-- SEDA dependencies -->
Expand Down Expand Up @@ -565,7 +576,7 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.31</version>
<version>2.0.32</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@
import eu.europa.esig.dss.service.ocsp.OnlineOCSPSource;
import eu.europa.esig.dss.service.tsp.OnlineTSPSource;
import eu.europa.esig.dss.service.x509.aia.JdbcCacheAIASource;
import eu.europa.esig.dss.spi.client.http.DSSCacheFileLoader;
import eu.europa.esig.dss.spi.client.http.DSSFileLoader;
import eu.europa.esig.dss.spi.client.http.IgnoreDataLoader;
import eu.europa.esig.dss.spi.client.jdbc.JdbcCacheConnector;
import eu.europa.esig.dss.spi.policy.SignaturePolicyProvider;
import eu.europa.esig.dss.spi.tsl.TrustedListsCertificateSource;
import eu.europa.esig.dss.spi.validation.CertificateVerifier;
import eu.europa.esig.dss.spi.validation.CommonCertificateVerifier;
import eu.europa.esig.dss.spi.validation.OCSPFirstRevocationDataLoadingStrategyFactory;
import eu.europa.esig.dss.spi.validation.RevocationDataVerifier;
import eu.europa.esig.dss.spi.x509.KeyStoreCertificateSource;
import eu.europa.esig.dss.spi.x509.aia.AIASource;
import eu.europa.esig.dss.spi.x509.aia.DefaultAIASource;
Expand All @@ -42,9 +48,6 @@
import eu.europa.esig.dss.tsl.function.OfficialJournalSchemeInformationURI;
import eu.europa.esig.dss.tsl.job.TLValidationJob;
import eu.europa.esig.dss.tsl.source.LOTLSource;
import eu.europa.esig.dss.validation.CertificateVerifier;
import eu.europa.esig.dss.validation.CommonCertificateVerifier;
import eu.europa.esig.dss.validation.SignaturePolicyProvider;
import eu.europa.esig.dss.xades.signature.XAdESService;
import eu.europa.esig.dss.xml.common.DocumentBuilderFactoryBuilder;
import eu.europa.esig.dss.xml.common.SchemaFactoryBuilder;
Expand Down Expand Up @@ -263,7 +266,7 @@ public CacheCleaner cacheCleaner(DSSFileLoader offlineLoader) {
CacheCleaner cacheCleaner = new CacheCleaner();
cacheCleaner.setCleanMemory(true);
cacheCleaner.setCleanFileSystem(true);
cacheCleaner.setDSSFileLoader(offlineLoader);
cacheCleaner.setDSSFileLoader((DSSCacheFileLoader) offlineLoader);

return cacheCleaner;
}
Expand All @@ -290,13 +293,20 @@ public LOTLSource europeanLOTL(KeyStoreCertificateSource ojContentKeyStore) {
}

@Bean
public CertificateVerifier certificateVerifier(JdbcCacheOCSPSource jdbcCacheOCSPSource, JdbcCacheCRLSource jdbcCacheCRLSource, JdbcCacheAIASource jdbcCacheAIASource, TrustedListsCertificateSource trustedListSource) {
public RevocationDataVerifier revocationDataVerifier() {
return RevocationDataVerifier.createDefaultRevocationDataVerifier();
}

@Bean
public CertificateVerifier certificateVerifier(JdbcCacheOCSPSource jdbcCacheOCSPSource, JdbcCacheCRLSource jdbcCacheCRLSource, JdbcCacheAIASource jdbcCacheAIASource, TrustedListsCertificateSource trustedListSource, RevocationDataVerifier revocationDataVerifier) {
CommonCertificateVerifier certificateVerifier = new CommonCertificateVerifier();
certificateVerifier.setCrlSource(jdbcCacheCRLSource);
certificateVerifier.setOcspSource(jdbcCacheOCSPSource);
certificateVerifier.setAIASource(jdbcCacheAIASource);
certificateVerifier.setTrustedCertSources(trustedListSource);
certificateVerifier.setRevocationDataVerifier(revocationDataVerifier);
certificateVerifier.setAlertOnMissingRevocationData(new ExceptionOnStatusAlert());
certificateVerifier.setRevocationDataLoadingStrategyFactory(new OCSPFirstRevocationDataLoadingStrategyFactory());
certificateVerifier.setCheckRevocationForUntrustedChains(dssProperties.getCheckRevocationForUntrustedChains());
return certificateVerifier;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.esupportail.esupsignature.dss.service;

import eu.europa.esig.dss.model.identifier.Identifier;
import eu.europa.esig.dss.spi.tsl.LOTLInfo;
import eu.europa.esig.dss.spi.tsl.ParsingInfoRecord;
import eu.europa.esig.dss.spi.tsl.TLInfo;
import eu.europa.esig.dss.spi.tsl.TLValidationJobSummary;
import eu.europa.esig.dss.model.tsl.LOTLInfo;
import eu.europa.esig.dss.model.tsl.ParsingInfoRecord;
import eu.europa.esig.dss.model.tsl.TLInfo;
import eu.europa.esig.dss.model.tsl.TLValidationJobSummary;
import eu.europa.esig.dss.spi.x509.CommonTrustedCertificateSource;
import eu.europa.esig.dss.spi.x509.KeyStoreCertificateSource;
import eu.europa.esig.dss.tsl.job.TLValidationJob;
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/org/esupportail/esupsignature/entity/Workflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class Workflow {
@Column(columnDefinition = "TEXT")
private String message;

private String mailFrom;

private Integer counter;

@Temporal(TemporalType.TIMESTAMP)
Expand Down Expand Up @@ -85,6 +87,8 @@ public class Workflow {

private Boolean sealAtEnd = false;

private String signRequestParamsDetectionPattern;

@Transient
private String messageToDisplay;

Expand Down Expand Up @@ -128,6 +132,14 @@ public void setMessage(String message) {
this.message = message;
}

public String getMailFrom() {
return mailFrom;
}

public void setMailFrom(String mailFrom) {
this.mailFrom = mailFrom;
}

public Integer getCounter() {
return counter;
}
Expand Down Expand Up @@ -333,4 +345,12 @@ public Boolean getForbidDownloadsBeforeEnd() {
public void setForbidDownloadsBeforeEnd(Boolean forbidDownloadsBeforeEnd) {
this.forbidDownloadsBeforeEnd = forbidDownloadsBeforeEnd;
}

public String getSignRequestParamsDetectionPattern() {
return signRequestParamsDetectionPattern;
}

public void setSignRequestParamsDetectionPattern(String signRequestParamsDetectionPattern) {
this.signRequestParamsDetectionPattern = signRequestParamsDetectionPattern;
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package org.esupportail.esupsignature.repository;

import org.esupportail.esupsignature.entity.Otp;
import org.esupportail.esupsignature.entity.enums.SignRequestStatus;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface OtpRepository extends CrudRepository<Otp, Long> {

Otp findByUrlId(String url);
List<Otp> findBySignBookStatus(SignRequestStatus status);

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,49 @@ and size(sb.signRequests) > 0
""")
Page<SignBook> findByRecipientAndCreateByEppnIndexed(User user, String workflowFilter, String docTitleFilter, User creatorFilter, Date startDateFilter, Date endDateFilter, Pageable pageable);

@Query("""
select distinct sb from SignBook sb
left join sb.team team
left join sb.signRequests sr
left join sr.recipientHasSigned rhs
left join sb.liveWorkflow lw
left join lw.liveWorkflowSteps lws
left join lws.recipients r
left join r.user u
where (:workflowFilter is null or sb.workflowName = :workflowFilter)
and (:docTitleFilter is null or sb.subject = :docTitleFilter)
and (:recipientUser is null or key(rhs).user = :recipientUser or :recipientUser in (u))
and (:creatorFilter is null or sb.createBy = :creatorFilter)
and size(sb.signRequests) > 0
and (sb.createDate between :startDateFilter and :endDateFilter)
""")
Page<SignBook> findByWorkflowName(User recipientUser, String workflowFilter, String docTitleFilter, User creatorFilter, Date startDateFilter, Date endDateFilter, Pageable pageable);

@Query("""
select distinct sb.subject from SignBook sb
where (:workflowFilter is null or sb.workflowName = :workflowFilter)
""")
List<String> findByWorkflowNameSubjects(String workflowFilter);

@Query("""
select distinct sb.createBy from SignBook sb
where (:workflowFilter is null or sb.workflowName = :workflowFilter)
""")
List<User> findByWorkflowNameCreators(String workflowFilter);

@Query("""
select distinct u from SignBook sb
left join sb.team team
left join sb.signRequests sr
left join sr.recipientHasSigned rhs
left join sb.liveWorkflow lw
left join lw.liveWorkflowSteps lws
left join lws.recipients r
left join r.user u
where (:workflowFilter is null or sb.workflowName = :workflowFilter) and u is not null
""")
List<User> findByWorkflowNameRecipientsUsers(String workflowFilter);

@Query("""
select distinct sb from SignBook sb
left join sb.team team
Expand Down Expand Up @@ -236,6 +279,5 @@ where sr.id in (select l.signRequestId from Log as l where l.eppn = :eppn and l.
Page<SignBook> findOnShareByEppn(String eppn, User recipientUser, String workflowFilter, String docTitleFilter, User creatorFilter, Date startDateFilter, Date endDateFilter, Pageable pageable);

List<SignBook> findByCreateByEppn(String userEppn);

}

Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public byte[] generateFile(Data data, InputStream inputStream) throws IOExceptio
if(inputStream != null && inputStream.available() > 0) {
return pdfService.fill(inputStream, data.getDatas(), false, true);
} else if(form.getDocument() != null) {
return pdfService.fill(pdfService.removeSignField(form.getDocument().getInputStream()), data.getDatas(), false, true);
return pdfService.fill(pdfService.removeSignField(form.getDocument().getInputStream(), data.getForm().getWorkflow()), data.getDatas(), false, true);
} else {
logger.error("no pdf model");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.pdfbox.cos.COSDictionary;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.COSObject;
import org.apache.pdfbox.cos.COSString;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.action.PDAction;
Expand Down Expand Up @@ -315,8 +317,10 @@ private List<Field> getFields(InputStream inputStream, Workflow workflow) throws
PDAnnotationAdditionalActions pdAnnotationAdditionalActions = pdAnnotationWidget.getActions();
if (pdAnnotationAdditionalActions != null && pdAnnotationAdditionalActions.getCOSObject().size() > 0) {
if (pdAnnotationAdditionalActions.getCOSObject().getCOSObject(COSName.K) != null) {
COSString cosString = (COSString) pdAnnotationAdditionalActions.getCOSObject().getCOSObject(COSName.K).getItem(COSName.JS);
type = cosString.toString();
COSObject cosObject = pdAnnotationAdditionalActions.getCOSObject().getCOSObject(COSName.K);
if(cosObject.getObject() instanceof COSDictionary cosDictionary) {
type = ((COSString) cosDictionary.getDictionaryObject(COSName.JS)).toString();
}
}
}
if (type == null || type.equals("text")) {
Expand Down Expand Up @@ -466,7 +470,7 @@ public Set<Form> getManagerForms(String userEppn) {
@Transactional
public void updateSignRequestParams(Long formId, InputStream inputStream) {
Form form = getById(formId);
List<SignRequestParams> findedSignRequestParams = signRequestParamsService.scanSignatureFields(inputStream, 0);
List<SignRequestParams> findedSignRequestParams = signRequestParamsService.scanSignatureFields(inputStream, 0, form.getWorkflow());
if(!findedSignRequestParams.isEmpty()) {
form.getSignRequestParams().clear();
int i = 0;
Expand Down
Loading
Loading