diff --git a/README.md b/README.md index 4a21ec3..3a3b304 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame | Command Line Arguments | Value | Optional | | :------------------ | :----------------------- | :------- | - | --region or -r | The region you obtained your API key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-northeast-1`, `ap-southeast-2`, `ap-southeast-1`, etc. | Yes, either -r or -a + | --region or -r | The region you obtained your API key. Value provided must be one of the Vision One regions, e.g. `us-east-1`, `eu-central-1`, `ap-southeast-1`, `ap-southeast-2`, `ap-northeast-1` | Yes, either -r or -a | | --addr or -a | Trend Vision One File Security server, such as: antimalware.__REGION__.cloudone.trendmicro.com:443 | Yes, either -r or -a | | --api_key | Vision One API Key | No | | --filename or -f | File to be scanned | No | @@ -64,7 +64,7 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame Make sure to customize the example program by configuring it with the API key from your Vision One account, found in your Vision One Dashboard. Assign the value of your Vision One Region's `API_KEY` to the variable and set `FILENAME` to the desired target file. ```sh - python3 client.py -f FILENAME -r us-1 --api_key API_KEY + python3 client.py -f FILENAME -r us-east-1 --tls true --api_key API_KEY ``` or @@ -72,7 +72,7 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame using File Security server address `-a` instead of region `-r`: ```sh - python3 client.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --api_key API_KEY + python3 client.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --tls true --api_key API_KEY ``` or @@ -80,7 +80,7 @@ If you plan on using a Trend Vision One region, be sure to pass in region parame using asynchronous IO example program: ```sh - python3 client_aio.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --api_key API_KEY + python3 client_aio.py -f FILENAME -a antimalware._REGION_.cloudone.trendmicro.com:443 --tls true --api_key API_KEY ``` ### Code Examples diff --git a/amaas/_version.py b/amaas/_version.py index 5c4105c..7863915 100644 --- a/amaas/_version.py +++ b/amaas/_version.py @@ -1 +1 @@ -__version__ = "1.0.1" +__version__ = "1.0.2" diff --git a/amaas/grpc/util.py b/amaas/grpc/util.py index 59b1b33..9160712 100644 --- a/amaas/grpc/util.py +++ b/amaas/grpc/util.py @@ -32,7 +32,7 @@ C1Regions = [C1_AU_REGION, C1_CA_REGION, C1_DE_REGION, C1_GB_REGION, C1_IN_REGION, C1_JP_REGION, C1_SG_REGION, C1_US_REGION, C1_TREND_REGION] V1Regions = [AWS_AU_REGION, AWS_DE_REGION, AWS_IN_REGION, AWS_JP_REGION, AWS_SG_REGION, AWS_US_REGION] -SupportedV1Regions = V1Regions +SupportedV1Regions = [AWS_AU_REGION, AWS_DE_REGION, AWS_JP_REGION, AWS_SG_REGION, AWS_US_REGION] SupportedC1Regions = [C1_AU_REGION, C1_CA_REGION, C1_DE_REGION, C1_GB_REGION, C1_IN_REGION, C1_JP_REGION, C1_SG_REGION, C1_US_REGION] @@ -97,14 +97,13 @@ def _init_by_region_util(region, api_key, enable_tls=True, ca_cert=None, is_aio_ } # make sure it is valid V1 or C1 region - if region not in AllValidRegions: - raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, AllValidRegions) - - # map it to C1 region if it is V1 region - if region in SupportedV1Regions: + if region not in SupportedV1Regions: + raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, SupportedV1Regions) + else: + # map it to C1 region if it is V1 region c1_region = V1ToC1RegionMapping.get(region) if not c1_region: - raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, AllValidRegions) + raise AMaasException(AMaasErrorCode.MSG_ID_ERR_INVALID_REGION, region, SupportedV1Regions) region = c1_region host = mapping.get(region, None) diff --git a/setup.py b/setup.py index e6fa744..dd4864d 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,6 @@ 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', "License :: OSI Approved :: MIT License", ], python_requires='>=3.7', diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index 4eef093..0000000 --- a/tests/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# The inclusion of the tests module is not meant to offer best practices for -# testing in general. diff --git a/tests/test_simply.py b/tests/test_simply.py deleted file mode 100644 index 49f3eb1..0000000 --- a/tests/test_simply.py +++ /dev/null @@ -1,17 +0,0 @@ -# the inclusion of the tests module is not meant to offer best practices for -# testing in general, but rather to support the `find_packages` example in -# setup.py that excludes installing the "tests" package - -import unittest - -# from amaas.grpc import api - - -class TestAmaaS(unittest.TestCase): - - def test_amaas_api(self): - self.assertEqual(1, 1) - - -if __name__ == '__main__': - unittest.main() diff --git a/tox.ini b/tox.ini index 5604d1d..2628485 100644 --- a/tox.ini +++ b/tox.ini @@ -42,9 +42,9 @@ commands = flake8 . check-manifest --ignore 'tox.ini,tests/**,tools/**,examples/**,docs/**,*.md,Pipfile*,**/scan.proto' make -f {toxinidir}/tools/Makefile build - pytest tests {posargs} + # pytest tests {posargs} python -m twine check dist/* [flake8] exclude = .tox,*.egg,build,data -select = E,W,F \ No newline at end of file +select = E,W,F