Skip to content
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

chore: Test Python 3.10+ and bump version #189

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
30 changes: 15 additions & 15 deletions examples/file_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@

async def get_provenance_info(apikey, file_hash):
async with vt.Client(apikey) as client:
file_obj = await client.get_object_async(f"/files/{file_hash}")
file_obj = await client.get_object_async(f'/files/{file_hash}')

return (
getattr(file_obj, "monitor_info", None),
getattr(file_obj, "nsrl_info", None),
getattr(file_obj, "signature_info", None),
getattr(file_obj, "tags", []),
getattr(file_obj, "trusted_verdict", None),
getattr(file_obj, 'monitor_info', None),
getattr(file_obj, 'nsrl_info', None),
getattr(file_obj, 'signature_info', None),
getattr(file_obj, 'tags', []),
getattr(file_obj, 'trusted_verdict', None),
)


async def main():
parser = argparse.ArgumentParser(
description="Get provenance info for a given file."
description='Get provenance info for a given file.'
)

parser.add_argument("--apikey", required=True, help="your VirusTotal API key")
parser.add_argument('--apikey', required=True, help='your VirusTotal API key')
parser.add_argument(
"--path",
'--path',
required=True,
type=argparse.FileType("rb"),
help="path to the file check.",
type=argparse.FileType('rb'),
help='path to the file check.',
)
args = parser.parse_args()

Expand All @@ -59,28 +59,28 @@
args.apikey, file_hash
)
except vt.error.APIError as e:
print(f"ERROR: {e}")
print(f'ERROR: {e}')
sys.exit(1)

if monitor:
print(
"Present in monitor collections "
f"of {', '.join(monitor['organizations'])}"
'Present in monitor collections '
f'of {", ".join(monitor["organizations"])}'
)

if nslr:
print(f'Present in these products: {", ".join(nslr["products"])}')

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.

if signature:
print(f'{"Inv" if "invalid-signature" in tags else "V"}alid signature.')
print(f'Product: {signature["product"]}.')

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
print(f'Signers: {signature["signers"]}')

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.

if trusted:
print(f'Trusted file by {trusted["organization"]}')

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.


if __name__ == "__main__":
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
2 changes: 1 addition & 1 deletion vt/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Defines VT release version."""

__version__ = "0.18.1"
__version__ = "0.18.2"
Loading