Commit 0331e7e8 authored by Siiri Tann's avatar Siiri Tann
Browse files

Merge branch 'develop' into 'master'

Release: merge 'develop' into 'master' created by Siiri Tann

See merge request teis/files-service!74
parents c7a85260 7a185d9a
# Changelog
## [1.23.0] - 2022-01-12
* TEIS-2787: updated virus-scan timeout; updated PollVirusScanResultTask and UploadFileVirusScanTask error handling
* TEIS-2726: added personId to FileReferenceEntity
## [1.22.0] - 2021-12-16
* TEIS-2599: security and metrics update
......
theGroup=ee.sm.ti.teis
theVersion=1.22.0
commonsVersion=1.28.0
commonApiGatewayVersion=1.28.0
pluginVersion=1.4.1
theVersion=1.23.0
commonsVersion=1.29.0
commonApiGatewayVersion=1.29.0
pluginVersion=1.4.4
schedulerVersion=1.17.0
......@@ -33,6 +33,7 @@ public class FileReferenceEntity extends RequestIdAuditedEntity {
@NotNull
private UUID objectId;
private UUID personId;
@NotNull
private String objectType;
private String contextType;
......
......@@ -28,4 +28,8 @@ alter table file_reference alter column context type jsonb USING context::jsonb;
GRANT DELETE ON file_reference TO ${db_app_username};
--changeset jyrgen:2020-06-08.add-file-reference-virus-scan-status
alter table file_reference add column scan_status varchar(255);
\ No newline at end of file
alter table file_reference add column scan_status varchar(255);
--changeset siiri:2021-12-21.TEIS-2726.update-file-reference
ALTER TABLE file_reference ADD COLUMN person_id uuid;
CREATE INDEX file_reference_person_id_idx ON file_reference (person_id);
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import ee.sm.ti.teis.bpm.BpmProcess;
import ee.sm.ti.teis.domain.filesvirusscan.PollVirusScanResult;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.exceptions.TeisSystemAlertException;
import ee.sm.ti.teis.file.FileEntity;
import ee.sm.ti.teis.file.service.FileDataService;
......@@ -46,6 +47,9 @@ public class PollVirusScanResultTask implements JavaDelegate {
.build();
filesVirusScanServiceClient.pollVirusScanResult(domain, requestMetaDto);
} catch (TeisResourceNotFoundException e) {
log.error("File with id [{}] not found, virus scan process will be cancelled..", fileId);
handleTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
} catch (Exception e) {
String logMessage = logTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
throw new TeisSystemAlertException(logMessage, e);
......
......@@ -3,6 +3,7 @@ package ee.sm.ti.teis.file.virusscan.bpm;
import com.fasterxml.jackson.databind.ObjectMapper;
import ee.sm.ti.teis.bpm.BpmProcess;
import ee.sm.ti.teis.domain.filesvirusscan.StartVirusScan;
import ee.sm.ti.teis.exceptions.TeisResourceNotFoundException;
import ee.sm.ti.teis.exceptions.TeisStorageException;
import ee.sm.ti.teis.exceptions.TeisSystemAlertException;
import ee.sm.ti.teis.file.FileEntity;
......@@ -54,6 +55,9 @@ public class UploadFileVirusScanTask implements JavaDelegate {
} catch (TeisStorageException e) {
log.error("File not found from S3 bucket, virus scan process will be cancelled..");
handleTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
} catch (TeisResourceNotFoundException e) {
log.error("File with id [{}] not found, virus scan process will be cancelled..", fileId);
handleTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
} catch (Exception e) {
String logMessage = logTaskException(e, this.getClass().getSimpleName(), businessKey, requestMetaJson);
throw new TeisSystemAlertException(logMessage, e);
......
......@@ -67,7 +67,7 @@ teis:
clean-check-magic-string: api-test
camunda:
virus-scan:
retry-timeout: ${CAMUNDA_VIRUS_SCAN_RETRY_TIMEOUT:PT60M}
retry-timeout: ${CAMUNDA_VIRUS_SCAN_RETRY_TIMEOUT:P14D}
upload-retry-time-delay: ${CAMUNDA_VIRUS_SCAN_UPLOAD_RETRY_TIME_DELAY:PT300S}
poll-scan-status-delay: ${CAMUNDA_VIRUS_SCAN_POLL_SCAN_STATUS_DELAY:PT10S}
poll-system-error-delay: ${CAMUNDA_VIRUS_SCAN_POLL_SYSTEM_ERROR_DELAY:PT300S}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment