Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion job_executor/adapter/fs/private_keys_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ def create(self) -> bool:
return False

def save_private_key(self, microdata_private_key_pem: bytes) -> None:
with open(self._get_private_key_location(), "wb") as file:
"""
Write the new private key file so only the owner of the
file (this application) has read and write permissions.
Fails and raises an exception if the file exists.
"""
fd = os.open(
self._get_private_key_location(),
os.O_CREAT | os.O_WRONLY | os.O_EXCL,
0o600,
)
with os.fdopen(fd, "wb") as file:
file.write(microdata_private_key_pem)

def clean_up(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies = [
"requests>=2.32.4,<3",
"pandas>=2.2.1,<3",
"urllib3>=2.5.0,<3",
"microdata-tools==1.10.3",
"microdata-tools==1.10.4",
]

[dependency-groups]
Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.