Repository navigation
Add VirusTotal scan results to add-on details #18974
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
368f0ba
Add VirusTotal scan results to add-on details
seanbudd 2f35a28
Pre-commit auto-fix
pre-commit-ci[bot] 16e7ef8
update changes
seanbudd 4a599bb
Merge remote-tracking branch 'origin/addonStoreVirusScan' into addonS…
seanbudd 9373401
better track scans totals
seanbudd 461cfb0
Update user_docs/en/userGuide.md
seanbudd 270a23b
Pre-commit auto-fix
pre-commit-ci[bot] b02946c
fix trans comment
seanbudd 2e4bf2d
Update source/addonStore/models/scanResults.py
seanbudd 492ac4f
Update user_docs/en/changes.md
seanbudd 5b9d679
Apply suggestions from code review
seanbudd 2d81df6
Merge branch 'master' into addonStoreVirusScan
seanbudd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # A part of NonVisual Desktop Access (NVDA) | ||
| # Copyright (C) 2025 NV Access Limited | ||
| # This file may be used under the terms of the GNU General Public License, version 2 or later, as modified by the NVDA license. | ||
| # For full terms and any additional permissions, see the NVDA license file: https://github.com/nvaccess/nvda/blob/master/copying.txt | ||
|
|
||
| from dataclasses import dataclass | ||
| from typing import Any | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class VirusTotalScanResults: | ||
| scanUrl: str | ||
| malicious: int | ||
| undetected: int | ||
| harmless: int | ||
| suspicious: int | ||
| failure: int | ||
| timeout: int | ||
| confirmedTimeout: int | ||
| typeUnsupported: int | ||
|
|
||
| @classmethod | ||
| def fromDict(cls, addon: dict[str, Any]) -> "VirusTotalScanResults | None": | ||
| try: | ||
| analysisStats = addon["scanResults"]["virusTotal"][0]["last_analysis_stats"] | ||
| return cls( | ||
| scanUrl=addon["vtScanUrl"], | ||
| malicious=analysisStats["malicious"], | ||
| undetected=analysisStats["undetected"], | ||
| harmless=analysisStats["harmless"], | ||
| suspicious=analysisStats["suspicious"], | ||
| failure=analysisStats["failure"], | ||
| timeout=analysisStats["timeout"], | ||
| confirmedTimeout=analysisStats["confirmed-timeout"], | ||
| typeUnsupported=analysisStats["type-unsupported"], | ||
| ) | ||
| except KeyError: | ||
| return None | ||
|
|
||
| @property | ||
| def totalScans(self) -> int: | ||
| return self.malicious + self.undetected + self.harmless + self.suspicious | ||
|
|
||
| @property | ||
| def totalFlagged(self) -> int: | ||
| return self.malicious + self.suspicious | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.