Skip to content

Commit

Permalink
Merge pull request #90 from ARGOeu/devel
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
fbasios authored Feb 3, 2023
2 parents 49cafe0 + 824ab56 commit f89f0a0
Show file tree
Hide file tree
Showing 54 changed files with 22,208 additions and 11,019 deletions.
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline {
}
agent {
docker {
image 'node:buster'
image 'node:16-buster'
}
}
steps {
Expand All @@ -51,7 +51,7 @@ pipeline {
cd $WORKSPACE/$PROJECT_DIR
cd website
npm install
npm audit fix
#npm audit fix
'''
sshagent (credentials: ['jenkins-master']) {
sh '''
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Signing, timestamping and validation of PDF documents.
mvn spotless:apply
```


## Funding
Co-financed by the European Union, the Innovation and Networks Executive Agency and CEF Telecom

Expand Down
17 changes: 9 additions & 8 deletions eseal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
</parent>
<groupId>gr.grnet</groupId>
<artifactId>eseal</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0</version>
<name>eseal</name>
<description>Eseal module for eThemisID responsible for signing, timestamping and validating PDF documents
</description>
<properties>
<java.version>1.8</java.version>
<dss.version>5.9</dss.version>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -56,7 +57,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
<!-- Hibernate validator - Bean validation API Implementation -->
Expand All @@ -82,7 +83,7 @@
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-service</artifactId>
<version>5.7</version>
<version>${dss.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
Expand All @@ -93,23 +94,23 @@
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-tsl-validation</artifactId>
<version>5.7</version>
<version>${dss.version}</version>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-crl-parser-stream</artifactId>
<version>5.7</version>
<version>${dss.version}</version>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-validation-rest</artifactId>
<version>5.7</version>
<version>${dss.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-pades-pdfbox</artifactId>
<version>5.7</version>
<version>${dss.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand All @@ -121,7 +122,7 @@
<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<artifactId>dss-utils-google-guava</artifactId>
<version>5.7</version>
<version>${dss.version}</version>
</dependency>
<!-- Dependency needed for Jaxb annotation mapper-->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public SignDocumentResponseDto signDocumentDetached(
.password(signDocumentDetachedRequestDto.getPassword())
.bytes(signDocumentDetachedRequestDto.getToSignDocument().getBytes())
.imageBytes(signDocumentDetachedRequestDto.getImageBytes())
.imageVisibility(signDocumentDetachedRequestDto.getImageVisibility())
.signingDate(new Date())
.signerInfo(
SignDocumentService.getSignerInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
public class RemoteHttpEsealClientBean {

private final RemoteProviderProperties remoteProviderProperties;
private static final int SOCKET_TIMEOUT = 30000;
private static final int CONNECTION_TIMEOUT = 30000;
private static final int CONNECTION_REQUEST_TIMEOUT = 30000;

@Autowired
public RemoteHttpEsealClientBean(RemoteProviderProperties remoteProviderProperties) {
Expand All @@ -43,12 +40,15 @@ public CloseableHttpClient httpClient()
throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, IOException,
CertificateException {
// socket config
SocketConfig socketCfg = SocketConfig.custom().setSoTimeout(SOCKET_TIMEOUT).build();
SocketConfig socketCfg =
SocketConfig.custom()
.setSoTimeout(this.remoteProviderProperties.getSocketConnectTimeout())
.build();

RequestConfig reqCfg =
RequestConfig.custom()
.setConnectTimeout(CONNECTION_TIMEOUT)
.setConnectionRequestTimeout(CONNECTION_REQUEST_TIMEOUT)
.setConnectTimeout(this.remoteProviderProperties.getConnectTimeout())
.setConnectionRequestTimeout(this.remoteProviderProperties.getRequestConnectTimeout())
.build();

// ssl context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@ public class RemoteProviderProperties {
@Value("${eseal.remote.provider.retry.interval}")
private int retryInterval;

/** Time in seconds for socket connect timeout */
@Value("${eseal.remote.provider.socket.connect.timeout}")
private int socketConnectTimeout;

/** Time in seconds for connect timeout */
@Value("${eseal.remote.provider.connect.timeout}")
private int connectTimeout;

/** Time in seconds for request connect timeout */
@Value("${eseal.remote.provider.connect.timeout}")
private int requestConnectTimeout;

/**
* Time in seconds that indicate for what time values should we wait for a new token to get
* generated rather than using the already created one which near expiration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public VisibleSignatureProperties visibleSignatureProperties() {
DSSDocument imageDocument =
new InMemoryDocument(
VisibleSignaturePropertiesBean.class.getResourceAsStream(
"/visible-signature/".concat("ste.jpg")));
imageDocument.setMimeType(MimeType.JPEG);
imageDocument.setName("ste.jpg");
"/visible-signature/".concat("osddydd.png")));
imageDocument.setMimeType(MimeType.PNG);
imageDocument.setName("osddydd.png");

visibleSignatureProperties.setImageDocument(imageDocument);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
public class SignDocumentDetachedRequestDto extends SignDocumentRequestDto {
private String imageBytes = "";

private Boolean imageVisibility = true;

@ValueOfEnum(
groups = ValueOfEnumRequestFieldCheckGroup.class,
enumClass = VisibleSignatureText.class,
message = "Possible values of property visibleSignatureText are [CN, OU, CN_OU, TEXT]")
private String visibleSignatureText = VisibleSignatureText.OU.name();
message =
"Possible values of property visibleSignatureText are [CN, OU, CN_OU, STATIC, TEXT]")
private String visibleSignatureText = VisibleSignatureText.STATIC.name();
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class SignDocumentDto {
private String bytes;
private String name;
private String imageBytes = "";
private Boolean imageVisibility;
private Date signingDate;
private String signerInfo;
List<CertificateToken> certificateList;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package gr.grnet.eseal.enums;

public enum VisibleSignaturePosition {
TOP_LEFT(0),
BOTTOM_LEFT(1),
TOP_RIGHT(2),
BOTTOM_RIGHT(3),
INVISIBLE(4);

private final int id;

VisibleSignaturePosition(int id) {
this.id = id;
}

public int getId() {
return id;
}

public static VisibleSignaturePosition getPosition(int pos) {
switch (pos) {
case 1:
return BOTTOM_LEFT;
case 2:
return TOP_RIGHT;
case 3:
return BOTTOM_RIGHT;
case 4:
return INVISIBLE;
default:
return TOP_LEFT;
}
}

public static boolean isLastPossiblePosition(int pos) {
return pos >= 4;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public enum VisibleSignatureText {
CN,
OU,
CN_OU,
STATIC,
TEXT;
}
Loading

0 comments on commit f89f0a0

Please sign in to comment.