Skip to content

Commit

Permalink
ensure private key is present when authorized key is set
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasochem committed Oct 23, 2023
1 parent 84eeb0a commit 913c0ec
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ def fill_in_missing_accounts():
baker_values["bake_using_account"] = None
baker_values["bake_using_accounts"] = accts

# add authorized_keys if any, so signing requests can be auth'd
accts = [ *accts, *baker_values.get["authorized_keys"] ]

for acct in accts:
if acct not in ACCOUNTS:
print(f"Creating account: {acct}")
Expand Down Expand Up @@ -343,6 +340,8 @@ def expose_secret_key(account_name):
if MY_POD_TYPE == "node":
if MY_POD_CONFIG.get("bake_using_account", "") == account_name:
return True
if account_name in MY_POD_CONFIG.get("authorized_keys", {}):
return True
return account_name in MY_POD_CONFIG.get("bake_using_accounts", {})

return False
Expand Down

0 comments on commit 913c0ec

Please sign in to comment.