Skip to content

Commit

Permalink
update to latest version: v1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
su-amaas committed Dec 21, 2023
1 parent c8c4ae1 commit 1835ec8
Show file tree
Hide file tree
Showing 11 changed files with 417 additions and 381 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on:
push:
branches: [main]

permissions:
contents: read
Expand Down
699 changes: 380 additions & 319 deletions Pipfile.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Install the File Security SDK package with pip:

## Obtain an API Key

The File Security SDK requires a valid API Key provided as parameter to the SDK client object. It can accept Trend Vision One API keys.
The File Security SDK requires a valid API Key provided as parameter to the SDK client object. It can accept Trend Vision One API keys.

When obtaining the API Key, ensure that the API Key is associated with the region that you plan to use. It is important to note that Trend Vision One API Keys are associated with different regions, please refer to the region flag below to obtain a better understanding of the valid regions associated with the respective API Key.

Expand All @@ -29,9 +29,9 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame
1. Login to the Trend Vision One.
2. Create a new Trend Vision One API key:

* Navigate to the Trend Vision One User Roles page.
* Verify that there is a role with the "Run file scan via SDK" permissions enabled. If not, create a role by clicking on "Add Role" and "Save" once finished.
* Directly configure a new key on the Trend Vision One API Keys page, using the role which contains the "Run file scan via SDK" permission. It is advised to set an expiry time for the API key and make a record of it for future reference.
- Navigate to the Trend Vision One User Roles page.
- Verify that there is a role with the "Run file scan via SDK" permissions enabled. If not, create a role by clicking on "Add Role" and "Save" once finished.
- Directly configure a new key on the Trend Vision One API Keys page, using the role which contains the "Run file scan via SDK" permission. It is advised to set an expiry time for the API key and make a record of it for future reference.

## Run SDK

Expand Down
2 changes: 1 addition & 1 deletion amaas/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.2"
__version__ = "1.0.4"
2 changes: 1 addition & 1 deletion amaas/grpc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _generate_messages(pipeline: _Pipeline, data_reader: BinaryIO, stats: dict)
stage=scan_pb2.STAGE_RUN,
file_name=None,
rs_size=0,
offset=data_reader.tell(),
offset=message.offset,
chunk=chunk)

stats["total_upload"] = stats.get(
Expand Down
2 changes: 1 addition & 1 deletion amaas/grpc/aio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def _scan_data(channel: grpc.Channel, data_reader: BinaryIO, size: int, id
stage=scan_pb2.STAGE_RUN,
file_name=None,
rs_size=0,
offset=data_reader.tell(),
offset=response.offset,
chunk=chunk)

stats["total_upload"] = stats.get(
Expand Down
12 changes: 6 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ After completing a scan, [File Security displays scan results](https://docs.tren
## Procedure

- If File Security indicates a file contains malware, you can take the following actions:
- Quarantine the file. See a [AWS quarantine example](https://github.com/trendmicro/tm-v1-fs-python-sdk/blob/main/examples/aws_quarantine.py).
- Send notification messages using:
- Slack
- Email
- Microsoft Teams
- If File Security does not find malware in a file, you can promote the file.
- Quarantine the file. See a [AWS quarantine example](https://github.com/trendmicro/tm-v1-fs-python-sdk/blob/main/examples/aws_quarantine.py).
- Send notification messages using:
- Slack
- Email
- Microsoft Teams
- If File Security does not find malware in a file, you can promote the file.
File renamed without changes.
44 changes: 22 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@
r"__version__\s+=\s+[\"\']([^\"\']+)[\"\']", f.read()
).group(1)

setup(install_requires=['grpcio==1.51.3', 'protobuf==4.22.0'],
name="visionone-filesecurity",
version=package_version,
author="Trend Micro VisionOne File Security Team",
description="Trend Micro VisionOne File Security SDK for python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/trendmicro/tm-v1-fs-python-sdk",
packages=find_namespace_packages(exclude=['tests*', 'examples']),
package_data={'amaas': ['grpc/protos/*']},
include_package_data=True,
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
"License :: OSI Approved :: MIT License",
],
python_requires='>=3.7',
setup(
name="visionone-filesecurity",
version=package_version,
author="Trend Micro VisionOne File Security Team",
description="Trend Micro VisionOne File Security SDK for python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/trendmicro/tm-v1-fs-python-sdk",
packages=find_namespace_packages(exclude=["tests*", "examples"]),
package_data={"amaas": ["grpc/protos/*"]},
include_package_data=True,
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
],
python_requires=">=3.7",
)
6 changes: 1 addition & 5 deletions tools/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# ROOT_DIR := $(abspath ../../)
# include $(ROOT_DIR)/build-scripts/variables.mk

PIPY_URL ?= https://upload.pypi.org/legacy/
TOKEN ?=

Expand All @@ -15,8 +12,7 @@ build: clean
pipenv run python setup.py sdist bdist_wheel

upload:
#pipenv run twine upload ./dist/*.whl
pipenv run twine upload --repository-url $(PIPY_URL) -u __token__ -p $(TOKEN) ./dist/*.whl --skip-existing

clean:
@rm -rf dist build amaas/*.egg-info amaas/grpc/protos/
@rm -rf dist build *.egg-info amaas/grpc/protos/
22 changes: 0 additions & 22 deletions tools/Makefile.dev

This file was deleted.

0 comments on commit 1835ec8

Please sign in to comment.