Merge pull request 'fix: handle OSError when age keys are too long to be file paths' (#5523) from clan-secrets into main

Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/5523
This commit is contained in:
Mic92
2025-10-14 14:35:05 +00:00

View File

@@ -22,7 +22,13 @@ def secret_name_type(arg_value: str) -> str:
def public_or_private_age_key_type(arg_value: str) -> str: def public_or_private_age_key_type(arg_value: str) -> str:
if Path(arg_value).is_file(): try:
is_file = Path(arg_value).is_file()
except OSError:
# Handle "File name too long" errors when age keys are passed directly
is_file = False
if is_file:
arg_value = Path(arg_value).read_text().strip() arg_value = Path(arg_value).read_text().strip()
elif arg_value.startswith("AGE-PLUGIN-"): elif arg_value.startswith("AGE-PLUGIN-"):
msg = ( msg = (