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

vault operator init -output-curl-string bug #17514

Merged
merged 4 commits into from
Oct 13, 2022
Merged

vault operator init -output-curl-string bug #17514

merged 4 commits into from
Oct 13, 2022

Conversation

akshya96
Copy link
Contributor

Slack: https://hashicorp.slack.com/archives/CMRSLF924/p1665566769095959
Bug:
vault operator init -key-shares=1 -key-threshold=1 -output-curl-string
curl -H "X-Vault-Request: true" -H "X-Vault-Token: $(vault print token)" http://127.0.0.1:8200/v1/sys/seal-status

Fix:
vault operator init -format=json -key-shares 1 -key-threshold 1 -output-curl-string
curl -X PUT -H "X-Vault-Request: true" -H "X-Vault-Token: $(vault print token)" -d '''{"secret_shares":1,"secret_threshold":1,"stored_shares":0,"pgp_keys":null,"recovery_shares":0,"recovery_threshold":0,"recovery_pgp_keys":null,"root_token_pgp_key":""}''' http://127.0.0.1:8200/v1/sys/init

@akshya96 akshya96 requested review from mpalmi and raskchanky October 12, 2022 18:55
Copy link
Contributor

@mpalmi mpalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@akshya96 akshya96 marked this pull request as ready for review October 12, 2022 19:06
@mpalmi
Copy link
Contributor

mpalmi commented Oct 12, 2022

Just realized that some other places that are handling this also do SetOutputPolicy and SetWrappingLookupFunction. Do we need to account for these as well?

@akshya96
Copy link
Contributor Author

Just realized that some other places that are handling this also do SetOutputPolicy and SetWrappingLookupFunction. Do we need to account for these as well?

Yes, I ran a test with -output-policy i.e; vault operator init -format=json -key-shares 1 -key-threshold 1 -output-policy and it gives the output for sys/seal-status. I will add a fix for that. I am not sure if we need to worry about SetWrappingLookupFunction.

@akshya96 akshya96 merged commit 35493cf into main Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants