Skip to content

Commit a102f07

Browse files
committed
Pull request #190: Hotfix/v1.25.2
Merge in ITB/gitb from hotfix/v1.25.2 to master * commit '8c929469c06fd54249343a03db230cbe1473e7e5': Preparation for release 1.25.2 [ITB-1779] Importing a community export archive does not delete undefined community resources [ITB-1789] Optimize virus scanning for uploaded files [ITB-1788] Input parameters ignored when launching test sessions via REST API
2 parents 7fa2fa2 + 8c92946 commit a102f07

13 files changed

Lines changed: 24 additions & 41 deletions

etc/k8s/helm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: itb
3-
version: 1.2.0
3+
version: 1.3.0
44
description: A Helm chart to install the Interoperability Test Bed (ITB) on Kubernetes
55
type: application
66
keywords:
@@ -17,4 +17,4 @@ maintainers:
1717
email: DIGIT-ITB@ec.europa.eu
1818
url: https://ec.europa.eu/info/departments/informatics_en
1919
icon: https://www.itb.ec.europa.eu/files/itb_logo.png
20-
appVersion: "1.25.1"
20+
appVersion: "1.25.2"

etc/k8s/helm/values.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#
1313
redis:
1414
# redis.image is the (full) image to use to create redis container(s).
15-
image: isaitb/gitb-redis:1.25.1
15+
image: isaitb/gitb-redis:1.25.2
1616
#
1717
# redis.name is the name to use for the redis deployment and (by default) service.
1818
name: itb-redis
@@ -45,7 +45,7 @@ redis:
4545
#
4646
mysql:
4747
# mysql.image is the (full) image to use to create mysql container(s).
48-
image: isaitb/gitb-mysql:1.25.1
48+
image: isaitb/gitb-mysql:1.25.2
4949
#
5050
# mysql.name is the name to use for the mysql deployment and (by default) service.
5151
name: itb-mysql
@@ -94,7 +94,7 @@ mysql:
9494
#
9595
srv:
9696
# srv.image is the (full) image to use to create srv container(s).
97-
image: isaitb/gitb-srv:1.25.1
97+
image: isaitb/gitb-srv:1.25.2
9898
#
9999
# srv.name is the name to use for the srv deployment and (by default) service.
100100
name: itb-srv
@@ -137,7 +137,7 @@ srv:
137137
#
138138
ui:
139139
# ui.image is the (full) image to use to create ui container(s).
140-
image: isaitb/gitb-ui:1.25.1
140+
image: isaitb/gitb-ui:1.25.2
141141
#
142142
# ui.name is the name to use for the ui deployment and (by default) service.
143143
name: itb-ui

etc/k8s/manifests/03-mysql-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
spec:
1717
automountServiceAccountToken: false
1818
containers:
19-
- image: "isaitb/gitb-mysql:1.25.1"
19+
- image: "isaitb/gitb-mysql:1.25.2"
2020
imagePullPolicy: "IfNotPresent"
2121
name: itb-mysql
2222
livenessProbe:

etc/k8s/manifests/05-redis-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
spec:
1515
automountServiceAccountToken: false
1616
containers:
17-
- image: "isaitb/gitb-redis:1.25.1"
17+
- image: "isaitb/gitb-redis:1.25.2"
1818
imagePullPolicy: "IfNotPresent"
1919
name: itb-redis
2020
ports:

etc/k8s/manifests/07-srv-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
spec:
1515
automountServiceAccountToken: false
1616
containers:
17-
- image: "isaitb/gitb-srv:1.25.1"
17+
- image: "isaitb/gitb-srv:1.25.2"
1818
imagePullPolicy: "IfNotPresent"
1919
name: itb-srv
2020
env:

etc/k8s/manifests/09-ui-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
spec:
1515
automountServiceAccountToken: false
1616
containers:
17-
- image: "isaitb/gitb-ui:1.25.1"
17+
- image: "isaitb/gitb-ui:1.25.2"
1818
imagePullPolicy: "IfNotPresent"
1919
name: itb-ui
2020
env:

gitb-ui/app/actors/SessionLaunchActor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,12 @@ class SessionLaunchActor @Inject() (reportManager: ReportManager, testbedBackend
121121
try {
122122
val sessionIdToAssign = latestState.assignPredefinedSessionId(testCaseId)
123123
testSessionId = Some(testbedBackendClient.initiate(testCaseId, sessionIdToAssign))
124+
val testCaseInputs = latestState.testCaseInputs(testCaseId)
124125
latestState = replace(latestState.newForConfiguredTestSession(testCaseId, testSessionId.get))
125126
if (LOGGER.isDebugEnabled()) LOGGER.debug("Configuring test session [{}] for test case [{}]. {}", testSessionId.get, testCaseDefinitionLoad._1.getId, latestState.statusText())
126127
webSocketActor.registerActiveTestSession(testSessionId.get)
127128
// Send the configure request. The response will be returned asynchronously.
128-
testbedBackendClient.configure(testSessionId.get, latestState.data.get.statementParameters, latestState.data.get.domainParameters, latestState.data.get.organisationParameters, latestState.data.get.systemParameters, latestState.testCaseInputs(testCaseId))
129+
testbedBackendClient.configure(testSessionId.get, latestState.data.get.statementParameters, latestState.data.get.domainParameters, latestState.data.get.organisationParameters, latestState.data.get.systemParameters, testCaseInputs)
129130
} catch {
130131
case e: Exception =>
131132
if (testSessionId.isEmpty) {

gitb-ui/app/controllers/AccountService.scala

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import org.apache.commons.lang3.StringUtils
1111
import org.apache.tika.Tika
1212
import org.slf4j.{Logger, LoggerFactory}
1313
import play.api.mvc._
14-
import utils.{ClamAVClient, CryptoUtil, HtmlUtil, JsonUtil}
14+
import utils.{CryptoUtil, HtmlUtil, JsonUtil}
1515

1616
import java.nio.file.Files
1717
import javax.inject.Inject
@@ -199,20 +199,10 @@ class AccountService @Inject() (authorizedAction: AuthorizedAction, cc: Controll
199199
// Size.
200200
response = ResponseConstructor.constructErrorResponse(ErrorCodes.EMAIL_ATTACHMENT_COUNT_EXCEEDED, s"The total size of attachments cannot exceed ${Configurations.EMAIL_ATTACHMENTS_MAX_SIZE} MBs.", Some("files"))
201201
} else {
202-
var virusScanner: Option[ClamAVClient] = None
203-
if (Configurations.ANTIVIRUS_SERVER_ENABLED) {
204-
virusScanner = Some(new ClamAVClient(Configurations.ANTIVIRUS_SERVER_HOST, Configurations.ANTIVIRUS_SERVER_PORT, Configurations.ANTIVIRUS_SERVER_TIMEOUT))
205-
}
206202
if (response == null) {
207203
// Check for viruses.
208-
attachments.foreach { attachment =>
209-
if (virusScanner.isDefined && response != null) {
210-
val scanResult = virusScanner.get.scan(attachment._2.getContent)
211-
if (!ClamAVClient.isCleanReply(scanResult)) {
212-
logger.warn("Attachment [" + attachment._2.getName + "] found to contain virus.")
213-
response = ResponseConstructor.constructBadRequestResponse(ErrorCodes.VIRUS_FOUND, "Attachments failed virus scan.")
214-
}
215-
}
204+
if (Configurations.ANTIVIRUS_SERVER_ENABLED && ParameterExtractor.virusPresentInFiles(attachments.map(_._2.getContent))) {
205+
response = ResponseConstructor.constructBadRequestResponse(ErrorCodes.VIRUS_FOUND, "Attachments failed virus scan.")
216206
}
217207
// Check (and set) mime types.
218208
if (response == null) {

gitb-ui/app/controllers/TestService.scala

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ package controllers
22

33
import actors.events.TestSessionStartedEvent
44
import actors.events.sessions.TerminateAllSessionsEvent
5-
import org.apache.pekko.actor.ActorSystem
65
import com.gitb.tbs._
76
import config.Configurations
87
import controllers.util._
98
import exceptions.ErrorCodes
109
import managers._
1110
import org.apache.commons.io.FileUtils
11+
import org.apache.pekko.actor.ActorSystem
1212
import play.api.mvc._
1313
import utils._
1414

@@ -73,17 +73,9 @@ class TestService @Inject() (authorizedAction: AuthorizedAction, cc: ControllerC
7373
val paramMap = ParameterExtractor.paramMap(request)
7474
val files = ParameterExtractor.extractFiles(request)
7575
var response: Result = null
76-
if (Configurations.ANTIVIRUS_SERVER_ENABLED) {
77-
// Check for viruses in the uploaded file(s)
78-
val scanner = new ClamAVClient(Configurations.ANTIVIRUS_SERVER_HOST, Configurations.ANTIVIRUS_SERVER_PORT, Configurations.ANTIVIRUS_SERVER_TIMEOUT)
79-
files.foreach { file =>
80-
if (response == null) {
81-
val scanResult = scanner.scan(file._2.file)
82-
if (!ClamAVClient.isCleanReply(scanResult)) {
83-
response = ResponseConstructor.constructBadRequestResponse(ErrorCodes.VIRUS_FOUND, "Provided file failed virus scan.")
84-
}
85-
}
86-
}
76+
// Check for viruses in the uploaded file(s)
77+
if (Configurations.ANTIVIRUS_SERVER_ENABLED && ParameterExtractor.virusPresentInFiles(files.map(_._2.file))) {
78+
response = ResponseConstructor.constructBadRequestResponse(ErrorCodes.VIRUS_FOUND, "Provided file failed virus scan.")
8779
}
8880
if (response == null) {
8981
val inputs = ParameterExtractor.requiredBodyParameter(paramMap, Parameters.INPUTS)

gitb-ui/app/managers/export/ImportCompleteManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,7 @@ class ImportCompleteManager @Inject()(systemConfigurationManager: SystemConfigur
23652365
toDBIO(dbActions)
23662366
}
23672367
_ <- {
2368-
processRemaining(ImportItemType.Trigger, ctx,
2368+
processRemaining(ImportItemType.CommunityResource, ctx,
23692369
(targetKey: String, item: ImportItem) => {
23702370
communityResourceManager.deleteCommunityResourceInternal(Some(item.parentItem.get.targetKey.get.toLong), targetKey.toLong, ctx.onSuccessCalls)
23712371
}

0 commit comments

Comments
 (0)