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
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion backend/openmlr/keys/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"""Manages SSH private keys stored in a dedicated directory."""

def __init__(self, keys_dir: str | Path = None):
self.keys_dir = Path(keys_dir) if keys_dir else Path(__file__).parent.parent.parent.parent.parent / ".keys"
self.keys_dir = Path(keys_dir) if keys_dir else Path(__file__).parent.parent.parent.parent / ".keys"
self._ensure_dir()

def _ensure_dir(self) -> None:
Expand Down Expand Up @@ -115,7 +115,7 @@

return key_path, pub_path

def validate_key(self, private_key_pem: str | bytes) -> dict:

Check notice on line 118 in backend/openmlr/keys/manager.py

View workflow job for this annotation

GitHub Actions / Qodana for Python

Method is not declared static

Method `validate_key` may be 'static'
"""Validate an SSH private key and return metadata."""
if isinstance(private_key_pem, str):
private_key_pem = private_key_pem.encode("utf-8")
Expand All @@ -123,7 +123,7 @@
# Try to load as OpenSSH format
try:
key = crypto_serialization.load_ssh_private_key(private_key_pem, password=None)
except Exception:

Check notice on line 126 in backend/openmlr/keys/manager.py

View workflow job for this annotation

GitHub Actions / Qodana for Python

Unclear exception clauses

Too broad exception clause
# Try PEM format
try:
key = crypto_serialization.load_pem_private_key(private_key_pem, password=None)
Expand Down
Loading