kin: KIN-BIZ-007 Post-MVP: шифрование credentials в project_environments через Fernet
This commit is contained in:
parent
c0d67e4c22
commit
8ebc6f1111
3 changed files with 342 additions and 6 deletions
|
|
@ -789,11 +789,14 @@ def create_environment(
|
|||
|
||||
|
||||
def get_environment(conn: sqlite3.Connection, env_id: int) -> dict | None:
|
||||
"""Get environment by id including raw obfuscated auth_value (for internal use)."""
|
||||
"""Get environment by id. auth_value is returned decrypted (for internal use)."""
|
||||
row = conn.execute(
|
||||
"SELECT * FROM project_environments WHERE id = ?", (env_id,)
|
||||
).fetchone()
|
||||
return _row_to_dict(row)
|
||||
result = _row_to_dict(row)
|
||||
if result and result.get("auth_value"):
|
||||
result["auth_value"] = _decrypt_auth(result["auth_value"], conn=conn, env_id=env_id)
|
||||
return result
|
||||
|
||||
|
||||
def list_environments(conn: sqlite3.Connection, project_id: str) -> list[dict]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue