We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The Boto3 Client attempts to use AWS Session Credentials by default. Apparently something like this in "pywis-pubsub-config.yml" is insufficient:
storage: type: S3 options: url: http://minio:minio123@localhost:9000 bucket: wis2box-cache
pywis-pubsub]$ git diff pywis_pubsub/storage.py diff --git a/pywis_pubsub/storage.py b/pywis_pubsub/storage.py index 3411516..e073432 100644 --- a/pywis_pubsub/storage.py +++ b/pywis_pubsub/storage.py @@ -94,13 +94,15 @@ class S3(Storage): s3_url = self.options['url'] self.s3_bucket = self.options['bucket'] - s3_client = boto3.client('s3', endpoint_url=s3_url) + s3_client = boto3.client('s3', endpoint_url=s3_url, + aws_access_key_id=self.options['username'], + aws_secret_access_key=self.options['password']) return s3_client def save(self, data: bytes, filename: Path) -> bool: - s3_client = self._get_client() + s3_client = self._get_client(self) try: s3_client.put_object(Body=data, Bucket=self.s3_bucket, @@ -115,7 +117,7 @@ class S3(Storage): def delete(self, filename: Path) -> bool: - s3_client = self._get_client() + s3_client = self._get_client(self) LOGGER.debug(f'Deleting object {filename}')
pywis-pubsub]$ git diff pywis_pubsub/storage.py
diff --git a/pywis_pubsub/storage.py b/pywis_pubsub/storage.py
index 3411516..e073432 100644
--- a/pywis_pubsub/storage.py
+++ b/pywis_pubsub/storage.py
@@ -94,13 +94,15 @@ class S3(Storage):
s3_url = self.options['url']
self.s3_bucket = self.options['bucket']
- s3_client = boto3.client('s3', endpoint_url=s3_url)
+ s3_client = boto3.client('s3', endpoint_url=s3_url,
+ aws_access_key_id=self.options['username'],
+ aws_secret_access_key=self.options['password'])
return s3_client
def save(self, data: bytes, filename: Path) -> bool:
- s3_client = self._get_client()
+ s3_client = self._get_client(self)
try:
s3_client.put_object(Body=data, Bucket=self.s3_bucket,
@@ -115,7 +117,7 @@ class S3(Storage):
def delete(self, filename: Path) -> bool:
LOGGER.debug(f'Deleting object {filename}')
The text was updated successfully, but these errors were encountered:
No branches or pull requests
S3 Storage Using Minio
The Boto3 Client attempts to use AWS Session Credentials by default. Apparently something like this in "pywis-pubsub-config.yml" is insufficient:
pywis-pubsub]$ git diff pywis_pubsub/storage.py
diff --git a/pywis_pubsub/storage.py b/pywis_pubsub/storage.py
index 3411516..e073432 100644
--- a/pywis_pubsub/storage.py
+++ b/pywis_pubsub/storage.py
@@ -94,13 +94,15 @@ class S3(Storage):
s3_url = self.options['url']
self.s3_bucket = self.options['bucket']
- s3_client = boto3.client('s3', endpoint_url=s3_url)
+ s3_client = boto3.client('s3', endpoint_url=s3_url,
+ aws_access_key_id=self.options['username'],
+ aws_secret_access_key=self.options['password'])
return s3_client
def save(self, data: bytes, filename: Path) -> bool:
- s3_client = self._get_client()
+ s3_client = self._get_client(self)
try:
s3_client.put_object(Body=data, Bucket=self.s3_bucket,
@@ -115,7 +117,7 @@ class S3(Storage):
def delete(self, filename: Path) -> bool:
- s3_client = self._get_client()
+ s3_client = self._get_client(self)
LOGGER.debug(f'Deleting object {filename}')
The text was updated successfully, but these errors were encountered: