boto3-assist 0.9.3__tar.gz → 0.9.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/PKG-INFO +1 -1
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/pyproject.toml +1 -1
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/errors/custom_exceptions.py +12 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/s3/s3_object.py +23 -10
- boto3_assist-0.9.4/src/boto3_assist/version.py +1 -0
- boto3_assist-0.9.3/src/boto3_assist/version.py +0 -1
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.env.docker +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.env.docker.001 +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.env.docker.nosql.workbench +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.env.unittest +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.gitignore +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.vscode/launch.json +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.vscode/settings.json +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/.vscode/tasks.json +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/LICENSE-EXPLAINED.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/LICENSE.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/README.md +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/aws_regions_with_status.csv +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/aws_regions_with_status.json +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/devops/build.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/devops/readme.md +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/cloudwatch/log_report.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/models/order_item_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/models/order_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/models/product_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/models/user_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/models/user_post_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/order_example/main.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/order_example/products.json +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/order_item_service.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/order_service.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/product_service.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/table_service.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/user_post_service.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/user_service.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/user_service_client_example.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/user_service_resource_example.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/user_post_example/main.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/ec2/regions_report.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/module-headers.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/mypy.ini +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/requirements-dev.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/requirements.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/run-checks.sh +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/run_unit_tests.sh +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/aws_lambda/event_info.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/aws_lambda/mock_context.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/boto3session.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_connection_tracker.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_log_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_logs.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_query.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cognito/cognito_authorizer.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cognito/cognito_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cognito/cognito_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cognito/jwks_cache.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cognito/user.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/connection_tracker.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_helpers.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_importer.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_index.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_iservice.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_key.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_model_base.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_model_base_interfaces.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_reindexer.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/readme.md +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/troubleshooting.md +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/ec2/ec2_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/environment_services/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/environment_services/environment_loader.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/environment_services/environment_variables.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/http_status_codes.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/models/serializable_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/s3/s3.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/s3/s3_bucket.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/s3/s3_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/s3/s3_event_data.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/securityhub/securityhub.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/securityhub/securityhub_connection.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/datetime_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/dictionaroy_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/file_operations.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/http_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/logging_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/numbers_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/serialization_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/string_utility.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/__top/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/cms/base.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/cms/content_block.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/cms/page.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/cms/template.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/simple_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/user_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/user_required_fields_model.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dynamodb_model_base_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dynamodb_model_projections_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dynamodb_model_serializtion_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dynamodb_moto_sorting_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dynamodb_reindex_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/examples_test/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/examples_test/user_service_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/lambda/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/lambda/event_info_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/models/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/models/serializable_model_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/models/serializable_model_wide_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/s3/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/s3/files/test.txt +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/s3/s3_event_data_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/s3/s3_file_delete_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/s3/s3_file_upload_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/utilities/__init__.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/utilities/serialization_utility_test.py +0 -0
- {boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/utilities/string_utility_test.py +0 -0
|
@@ -32,3 +32,15 @@ class InvalidRoutePath(Exception):
|
|
|
32
32
|
"message": message,
|
|
33
33
|
}
|
|
34
34
|
super().__init__(self.message)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class FileNotFound(Exception):
|
|
38
|
+
"""File Not Found Error"""
|
|
39
|
+
|
|
40
|
+
def __init__(self, message="File Not Found"):
|
|
41
|
+
"""Invalid Route"""
|
|
42
|
+
self.message = {
|
|
43
|
+
"status_code": 404,
|
|
44
|
+
"message": message,
|
|
45
|
+
}
|
|
46
|
+
super().__init__(self.message)
|
|
@@ -18,7 +18,7 @@ from boto3_assist.s3.s3_connection import S3Connection
|
|
|
18
18
|
from boto3_assist.utilities.datetime_utility import DatetimeUtility
|
|
19
19
|
from boto3_assist.utilities.file_operations import FileOperations
|
|
20
20
|
from boto3_assist.utilities.http_utility import HttpUtility
|
|
21
|
-
|
|
21
|
+
from boto3_assist.errors.custom_exceptions import FileNotFound
|
|
22
22
|
|
|
23
23
|
logger = Logger(child=True)
|
|
24
24
|
|
|
@@ -462,15 +462,28 @@ class S3Object:
|
|
|
462
462
|
|
|
463
463
|
except Exception as e: # pylint: disable=W0718
|
|
464
464
|
error = str(e)
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
465
|
+
error_info = {
|
|
466
|
+
"metric_filter": "s3_download_error",
|
|
467
|
+
"error": str(e),
|
|
468
|
+
"bucket": bucket_name,
|
|
469
|
+
"key": key,
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
logger.error(error_info)
|
|
473
|
+
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3/client/get_object.html
|
|
474
|
+
error = str(e)
|
|
475
|
+
if "An error occurred (AccessDenied)" in error:
|
|
476
|
+
if (
|
|
477
|
+
"is not authorized to perform: s3:ListBucket on resource" in error
|
|
478
|
+
and "because no identity-based policy allows the s3:ListBucket action"
|
|
479
|
+
in error
|
|
480
|
+
):
|
|
481
|
+
# the file is not found but you're getting a access error since you don't
|
|
482
|
+
# have s3:ListBucket. To make life easier, we're just going to return a 404 error
|
|
483
|
+
raise FileNotFound("File Not Found") from e
|
|
484
|
+
|
|
485
|
+
# last ditch
|
|
486
|
+
raise RuntimeError(error_info) from e
|
|
474
487
|
|
|
475
488
|
finally:
|
|
476
489
|
logger.debug(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.9.4'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.9.3'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/examples/dynamodb/services/user_service_client_example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/cloudwatch/cloudwatch_log_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_reserved_words.py
RENAMED
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/dynamodb/dynamodb_reserved_words.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/securityhub/securityhub_connection.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/src/boto3_assist/utilities/serialization_utility.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dbmodels/user_required_fields_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{boto3_assist-0.9.3 → boto3_assist-0.9.4}/tests/dynamodb/dynamodb_model_serializtion_test.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|