Skip to content

Commit

Permalink
PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
drf7 committed Aug 9, 2024
1 parent 095360f commit 3ced4e9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nucliadb/src/nucliadb/writer/tus/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ async def initialize(

if self.json_credentials is not None and self.json_credentials.strip() != "":
self.json_credentials_file = os.path.join(tempfile.mkdtemp(), "gcs_credentials.json")
open(self.json_credentials_file, "w").write(
base64.b64decode(self.json_credentials).decode("utf-8")
)
with open(self.json_credentials_file, "w") as file:
file.write(
base64.b64decode(self.json_credentials).decode("utf-8")
)
self._credentials = ServiceAccountCredentials.from_json_keyfile_name(
self.json_credentials_file, SCOPES
)
Expand Down

0 comments on commit 3ced4e9

Please sign in to comment.