File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
components/SubmissionManagement/Submission Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ workflows:
343
343
branches :
344
344
only :
345
345
- develop
346
- - fix/regsource
346
+ - fix/infected-submission
347
347
# This is alternate dev env for parallel testing
348
348
- " build-test " :
349
349
context : org-global
Original file line number Diff line number Diff line change 232
232
"webpack-pwa-manifest" : " ^3.7.1" ,
233
233
"webpack-stats-plugin" : " ^0.2.1" ,
234
234
"workbox-webpack-plugin" : " ^3.6.2"
235
+ },
236
+ "volta" : {
237
+ "node" : " 8.11.2"
235
238
}
236
239
}
Original file line number Diff line number Diff line change 14
14
import _ from 'lodash' ;
15
15
import moment from 'moment' ;
16
16
import React from 'react' ;
17
- import { COMPETITION_TRACKS , CHALLENGE_STATUS } from 'utils/tc' ;
17
+ import { COMPETITION_TRACKS , CHALLENGE_STATUS , safeForDownload } from 'utils/tc' ;
18
18
19
19
import PT from 'prop-types' ;
20
20
@@ -54,7 +54,7 @@ export default function Submission(props) {
54
54
{
55
55
track === COMPETITION_TRACKS . DES && (
56
56
< td styleName = "status-col" >
57
- { submissionObject . screening
57
+ { ! safeForDownload ( submissionObject . url ) ? 'Malware found in submission' : submissionObject . screening
58
58
&& (
59
59
< ScreeningStatus
60
60
screeningObject = { submissionObject . screening }
@@ -71,7 +71,7 @@ export default function Submission(props) {
71
71
onClick = { ( ) => onDownloadSubmission ( submissionObject . id ) }
72
72
type = "button"
73
73
>
74
- < DownloadIcon />
74
+ { safeForDownload ( submissionObject . url ) && < DownloadIcon /> }
75
75
</ button >
76
76
{ /*
77
77
TODO: At the moment we just fetch downloads from the legacy
@@ -127,6 +127,7 @@ Submission.propTypes = {
127
127
type : PT . string ,
128
128
created : PT . any ,
129
129
download : PT . any ,
130
+ url : PT . string ,
130
131
} ) ,
131
132
showScreeningDetails : PT . bool ,
132
133
track : PT . string . isRequired ,
Original file line number Diff line number Diff line change @@ -305,4 +305,13 @@ export function isValidEmail(email) {
305
305
return pattern . test ( email ) ;
306
306
}
307
307
308
+ /**
309
+ * Test if the file is safe for download. This patch currently checks the location of the submission
310
+ * to determine if the file is infected or not. This is an immedaite patch, and should be updated to
311
+ * check the review scan score for review type virus scan.
312
+ */
313
+ export function safeForDownload ( url ) {
314
+ return url != null && url . indexOf ( 'submissions-quarantine/' ) === - 1 ;
315
+ }
316
+
308
317
export default undefined ;
You can’t perform that action at this time.
0 commit comments