-
Notifications
You must be signed in to change notification settings - Fork 210
PM-3087 virus scan fix #7175
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
PM-3087 virus scan fix #7175
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,7 @@ workflows: | |
| branches: | ||
| only: | ||
| - develop | ||
| - PM-3087_virus-scan-fix | ||
|
|
||
| - "build-prod": | ||
| context: org-global | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -192,7 +192,7 @@ class SubmissionManagementPageContainer extends React.Component { | |
| const { needReload } = this.state; | ||
|
|
||
| if (needReload === false && mySubmissions) { | ||
| if (mySubmissions.find(item => safeForDownload(item.url) !== true)) { | ||
| if (mySubmissions.find(item => safeForDownload(item) !== true)) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| this.setState({ needReload: true }); | ||
| setTimeout(() => { | ||
| loadMySubmissions(authTokens, challengeId); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -376,21 +376,20 @@ export function isValidEmail(email) { | |
| } | ||
|
|
||
| /** | ||
| * Test if the file is safe for download. This patch currently checks the location of the submission | ||
| * to determine if the file is infected or not. This is an immedaite patch, and should be updated to | ||
| * check the review scan score for review type virus scan. | ||
| * Test if the file is safe for download. This function can accept the full submission object. | ||
| * | ||
| * @returns {String|Boolean} true if submission is safe for download, | ||
| * otherwise string describing reason for not being safe for download | ||
| */ | ||
| export function safeForDownload(url) { | ||
| if (url == null) return 'Download link unavailable'; | ||
| export function safeForDownload(submission) { | ||
| if (submission == null || !submission.url) return 'Download link unavailable'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
|
|
||
| if (url.toLowerCase().indexOf('submissions-quarantine/') !== -1) { | ||
| const { url } = submission; | ||
| if (url.toLowerCase().indexOf('submissions-quarantine/') !== -1 || submission.virusScan === false) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| return 'Malware found in submission'; | ||
| } | ||
|
|
||
| if (url.toLowerCase().indexOf('submissions-dmz/') !== -1) { | ||
| if (url.toLowerCase().indexOf('submissions-dmz/') !== -1 || !submission.virusScan) { | ||
| return 'AV Scan in progress'; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗
correctness]The
safeForDownloadfunction now receives the entiresubmissionObjectinstead of just theurl. Ensure thatsafeForDownloadis designed to handle the full object and that it uses the necessary properties correctly. This change could potentially introduce issues ifsafeForDownloadis not updated accordingly.