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

Release 1.14.2 #15

Merged
merged 6 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

## 1.14.2 (18-07-2024)

### Bugfix: 1
- [#32813](https://parermine.regione.emilia-romagna.it/issues/32813) Correzione gestione "log level error" nei casi di errori "non previsti" da "gestiti in verifica firma digitale"

## 1.14.1 (11-06-2024)

### Bugfix: 1
Expand Down
6 changes: 3 additions & 3 deletions CONTAINER-SCAN-REPORT.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Container scan evidence CVE
<strong>Image name:</strong> registry.ente.regione.emr.it/parer/okd/crypto:sast
<br/><strong>Run date:</strong> Tue Jun 11 16:00:27 CEST 2024
<br/><strong>Produced by:</strong> <a href="https://gitlab.ente.regione.emr.it/parer/okd/crypto/-/jobs/262645">Job</a>
<strong>Image name:</strong>
<br/><strong>Run date:</strong> Thu Jul 18 10:04:24 CEST 2024
<br/><strong>Produced by:</strong> <a href="https://gitlab.ente.regione.emr.it/parer/okd/crypto/-/jobs/298859">Job</a>
<br/><strong>CVE founded:</strong> 8
| CVE | Description | Severity | Solution |
|:---:|:---|:---:|:---|
Expand Down
4 changes: 2 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 1.14.1 (11-06-2024)
## 1.14.2 (18-07-2024)

### Bugfix: 1
- [#32696](https://parermine.regione.emilia-romagna.it/issues/32696) Correzione gestione configurazioni http client (diverse dal default)
- [#32813](https://parermine.regione.emilia-romagna.it/issues/32813) Correzione gestione "log level error" nei casi di errori "non previsti" da "gestiti in verifica firma digitale"
Binary file modified pdfdocs/CHANGELOG.pdf
Binary file not shown.
Binary file modified pdfdocs/RELEASE-NOTES.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>old-cryptolibrary</artifactId>
<version>1.14.2-SNAPSHOT</version>
<version>1.14.3-SNAPSHOT</version>
<packaging>${packaging.type}</packaging>
<name>Sacer Cryptolibrary</name>
<description>Cryptolibrary contenuta in Sacer</description>
Expand Down Expand Up @@ -42,7 +42,7 @@
<org-json.version>20240303</org-json.version>
<!-- custom libs -->
<eng-cryptolibrary.version>1.12.7</eng-cryptolibrary.version>
<verificafirma-crypto-beans.version>1.4.0</verificafirma-crypto-beans.version>
<verificafirma-crypto-beans.version>1.4.1</verificafirma-crypto-beans.version>
<!-- -->
<start-class>it.eng.parer.crypto.web.CryptoApplication</start-class>
</properties>
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/it/eng/parer/crypto/service/DocService.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,9 @@ private String decodificaTipologia(ParerError.ExceptionType tipologia) {

final String decodifica;
switch (tipologia) {
case PARAMETER_VALIDATION:
decodifica = "parametro errato";
break;
case GENERIC:
decodifica = "generico";
break;
case NOT_FOUND:
decodifica = "risorsa non trovata";
break;
case CA:
decodifica = "certification authority";
break;
case CERTIFICATE:
decodifica = "certificato digitale";
break;
Expand All @@ -175,12 +166,6 @@ private String decodificaTipologia(ParerError.ExceptionType tipologia) {
case TIME:
decodifica = "emissione marca temporale";
break;
case SIGNATURE_VERIFICATION:
decodifica = "processo di verifica firma/formati";
break;
case SIGNATURE_EXTRACTION:
decodifica = "processo di estrazione file originale da file firmato";
break;
default:
decodifica = "non gestito";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private Constants() {

/* default error message on advice handler */
public static final String STD_MSG_APP_ERROR = "Errore applicativo";
public static final String STD_MSG_APP_WARN = "Avviso errore";
public static final String STD_MSG_GENERIC_ERROR = "Errore generico";
public static final String STD_MSG_VALIDATION_ERROR = "Chiamata non valida";

Expand Down
20 changes: 12 additions & 8 deletions src/main/java/it/eng/parer/crypto/web/config/AdviceHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package it.eng.parer.crypto.web.config;

import static it.eng.parer.crypto.model.exceptions.ParerError.ExceptionType.GENERIC;
import static it.eng.parer.crypto.service.util.Constants.STD_MSG_APP_ERROR;
import static it.eng.parer.crypto.service.util.Constants.STD_MSG_APP_WARN;
import static it.eng.parer.crypto.service.util.Constants.STD_MSG_GENERIC_ERROR;
import static it.eng.parer.crypto.service.util.Constants.STD_MSG_VALIDATION_ERROR;

Expand All @@ -40,7 +42,6 @@
import org.springframework.web.multipart.support.MissingServletRequestPartException;

import it.eng.parer.crypto.model.exceptions.CryptoParerException;
import it.eng.parer.crypto.model.exceptions.ParerError;
import it.eng.parer.crypto.web.bean.RestExceptionResponse;
import it.eng.parer.crypto.web.util.RestUtil;

Expand All @@ -63,16 +64,19 @@ public class AdviceHandler {
@ExceptionHandler(CryptoParerException.class)
public final ResponseEntity<RestExceptionResponse> handleCryptoParerException(CryptoParerException ex,
WebRequest request) {
// log error
log.atError().log(STD_MSG_APP_ERROR, ex);
HttpStatus status = HttpStatus.INTERNAL_SERVER_ERROR;
if (ex.getCode().exceptionType().equals(ParerError.ExceptionType.NOT_FOUND)) {
status = HttpStatus.NOT_FOUND;
//
if (ex.getCode().exceptionType().equals(GENERIC)) {
// log error
log.atError().log(STD_MSG_APP_ERROR, ex);
} else {
// log warn
log.atWarn().log(STD_MSG_APP_WARN, ex);
}

//
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
return new ResponseEntity<>(RestUtil.buildParerResponseEntity(ex, request), headers, status);
return new ResponseEntity<>(RestUtil.buildParerResponseEntity(ex, request), headers,
HttpStatus.INTERNAL_SERVER_ERROR);
}

@ExceptionHandler(MethodArgumentNotValidException.class)
Expand Down
Loading