Skip to content

Commit

Permalink
Merge pull request #1228 from MetPX/s3cloudsender_unquote
Browse files Browse the repository at this point in the history
Unquote secret_access_key in s3CloudSender plugin
  • Loading branch information
petersilva authored Sep 23, 2024
2 parents 5844f42 + 21cf2d8 commit 830009f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sarracenia/flowcb/send/s3CloudSender.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
from sarracenia.flowcb import FlowCB
import boto3
from botocore.exceptions import ClientError
from urllib.parse import unquote

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -167,6 +168,9 @@ def __init__(self, options):
self.s3_url = "https://"+netloc[1] if not (type(netloc[1]) == str and netloc[1] == "None") else None
self.access_key_id = usr_pwd[0] if not (type(usr_pwd[0]) == str and usr_pwd[0] == "None") else None
self.secret_access_key = usr_pwd[1] if not (type(usr_pwd[1]) == str and usr_pwd[1] == "None") else None
if self.secret_access_key:
# sometimes the key will have a slash in it, in that case, the slash should be changed to %2F in credentials.conf
self.secret_access_key = unquote(self.secret_access_key)

logger.info(f"Successfully loaded credentials for sendTo URL {self.o.sendTo}")

Expand Down

0 comments on commit 830009f

Please sign in to comment.