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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user