Skip to content

Commit

Permalink
Remove env setting side effect.
Browse files Browse the repository at this point in the history
Env variables 'AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY' are no longer set if they are not present in env. Before credentials were passed explicitely, this was necessary for authentication since there was no other mechanism implemented than to set the env variables.
  • Loading branch information
ThomasMarwitzQC committed Apr 17, 2024
1 parent 230fd28 commit 4a65044
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions minimalkv/net/s3fsstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,11 @@ def _from_parsed_url(

if url_access_key_id is None:
url_secret_access_key = os.environ.get("AWS_ACCESS_KEY_ID")
else:
os.environ["AWS_ACCESS_KEY_ID"] = url_access_key_id
# TODO: Should we allow these attributes to be none-able?
# A potential use case might be a public bucket

if url_secret_access_key is None:
url_secret_access_key = os.environ.get("AWS_SECRET_ACCESS_KEY")
else:
os.environ["AWS_SECRET_ACCESS_KEY"] = url_secret_access_key

credentials = Credentials(
access_key_id=url_access_key_id,
Expand Down

0 comments on commit 4a65044

Please sign in to comment.