refactor(vault): centralize _KEYS_FILE constant in vault/__init__.py

reader.py and writer.py each independently computed the same path via
pyra_home(). Single definition in __init__.py; both modules import it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
curo1305
2026-05-17 18:09:41 +02:00
parent 7bdb2c3faf
commit 18b2b94194
3 changed files with 7 additions and 8 deletions
+3
View File
@@ -0,0 +1,3 @@
from pyra.utils.paths import pyra_home
_KEYS_FILE = pyra_home() / "vault" / "secrets" / "api_keys.json"
+2 -4
View File
@@ -1,9 +1,7 @@
import json
from pathlib import Path
from pyra.utils.paths import pyra_home, safe_chmod
_KEYS_FILE = pyra_home() / "vault" / "secrets" / "api_keys.json"
from pyra.vault import _KEYS_FILE
from pyra.utils.paths import safe_chmod
def get_key(provider_id: str) -> str | None:
+2 -4
View File
@@ -1,9 +1,7 @@
import json
from pathlib import Path
from pyra.utils.paths import ensure_dir, pyra_home, safe_chmod
_KEYS_FILE = pyra_home() / "vault" / "secrets" / "api_keys.json"
from pyra.vault import _KEYS_FILE
from pyra.utils.paths import ensure_dir, safe_chmod
def set_key(provider_id: str, api_key: str) -> None: