no-mistakes(review): Guard infisical-token fallback read against OSError crashes
This commit is contained in:
@@ -61,8 +61,11 @@ INFISICAL_API_URL = os.environ.get("INFISICAL_API_URL", "https://vault.sysloggh.
|
||||
if not INFISICAL_TOKEN:
|
||||
_token_path = os.path.expanduser("~/.infisical-token")
|
||||
if os.path.isfile(_token_path):
|
||||
with open(_token_path) as _f:
|
||||
INFISICAL_TOKEN = _f.read().strip()
|
||||
try:
|
||||
with open(_token_path) as _f:
|
||||
INFISICAL_TOKEN = _f.read().strip()
|
||||
except (OSError, UnicodeDecodeError):
|
||||
pass
|
||||
|
||||
# ── Helpers ──────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user