added support for S3 signature version 4 authentication (#1882)

* added support for S3 signature version 4 authentication
This commit is contained in:
nopresearcher
2021-12-02 22:51:52 -05:00
committed by GitHub
parent 3550aaf4ea
commit d79f24b2e5

View File

@@ -5,6 +5,7 @@ from pathlib import PurePath
from shutil import copyfileobj, rmtree
import boto3
from botocore.client import Config
from flask import current_app, redirect, send_file
from flask.helpers import safe_join
from werkzeug.utils import secure_filename
@@ -86,6 +87,7 @@ class S3Uploader(BaseUploader):
endpoint = get_app_config("AWS_S3_ENDPOINT_URL")
client = boto3.client(
"s3",
config=Config(signature_version="v4"),
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
endpoint_url=endpoint,