Skip to content

Commit

Permalink
Make an API key name of "-" not actually fetch a key
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Oct 23, 2024
1 parent b939bba commit 9340d35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/chap/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class NoKeyAvailable(Exception):

@functools.cache
def get_key(name: str, what: str = "api key") -> str:
if name == "-":
return "-"
key_path = f"{pass_prefix}{name}"
command = pass_command + [key_path]
return subprocess.check_output(command, encoding="utf-8").split("\n")[0]
Expand Down

0 comments on commit 9340d35

Please sign in to comment.