Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: extract keystore's password in independent step #196

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions kurtosis_package/keys.star
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ def generate_keys(plan, egnkey_service_name, key_type, artifact_name):
output_dir = "/_output"

cmd = "set -e ; rm -rf {output} && \
egnkey generate --key-type {type} --num-keys 1 --output-dir {output} ; \
cat {output}/password.txt | tr -d '\n'".format(
egnkey generate --key-type {type} --num-keys 1 --output-dir {output}".format(
output=output_dir, type=key_type
)

Expand All @@ -73,7 +72,6 @@ def generate_keys(plan, egnkey_service_name, key_type, artifact_name):
recipe=ExecRecipe(command=["sh", "-c", cmd]),
description="Generating " + key_type + " key",
)
password = result["output"]

artifact_name = plan.store_service_files(
service_name=egnkey_service_name,
Expand All @@ -82,6 +80,16 @@ def generate_keys(plan, egnkey_service_name, key_type, artifact_name):
description="Storing " + key_type + " key",
)

# NOTE: we do this in another step to avoid egnkey's output from being stored
cmd = "set -e ; cat {}/password.txt | tr -d '\n'".format(output_dir)

result = plan.exec(
service_name=egnkey_service_name,
recipe=ExecRecipe(command=["sh", "-c", cmd]),
description="Extracting keystore password",
)
password = result["output"]

cmd = "set -e ; cat {}/private_key_hex.txt | tr -d '\n'".format(output_dir)

result = plan.exec(
Expand Down
Loading