feat(FN-007): implement credential storage with Fernet encryption

- Add DatabaseCredentialStorage with async CRUD operations
- Create Credential SQLAlchemy model with encrypted values
- Update GitCredential and AccessTokenCredential to support async
- Fix SSH key encryption to use Fernet instead of base64 placeholder
This commit is contained in:
2026-05-16 13:41:07 +02:00
parent 8b4784f5ed
commit 25db3f81b0
4 changed files with 60 additions and 8 deletions
+2 -5
View File
@@ -6,7 +6,6 @@ Security rules:
- The ``encrypted_private_key`` field uses ``repr=False``.
"""
import base64
import uuid
from datetime import UTC, datetime
@@ -16,11 +15,9 @@ from app.git.types import SshKeyStatus
def encrypt_private_key(raw: bytes) -> str:
"""Placeholder encryption helper.
from app.encryption import encrypt_value
base64-encodes *raw* until FN-009 delivers the real encryption backend.
"""
return base64.b64encode(raw).decode("ascii")
return encrypt_value(raw.decode("utf-8"))
class SshKeyPair(BaseModel):