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-12833 Update prompts for the rekey command #18892

Merged
merged 2 commits into from
Jan 30, 2023

Conversation

miagilepner
Copy link
Contributor

All the prompts for the rekey command currently assume that the -target flag is set to its default value of barrier. If the -target=recovery option is set, then the prompts should instead describe recovery keys. I updated the language and added some tests around recovery keys.

@miagilepner miagilepner force-pushed the miagilepner/VAULT-12833-rekey-recovery branch from 9ffd602 to 8565c00 Compare January 30, 2023 09:34
// the function returns a client, the recovery keys, and a closer function
func testVaultServerAutoUnseal(tb testing.TB) (*api.Client, []string, func()) {
testSeal := seal.NewTestSeal(nil)
autoSeal, err := vault.NewAutoSeal(testSeal)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if there's a better way to set up auto-unseal for testing

Copy link
Collaborator

Choose a reason for hiding this comment

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

Depends on what you're trying to do. I think you made the right choice here. If we were actually exercising seal related more directly, I might point you at something that doesn't use a NewTestSeal, which is kind of a fake.

Copy link
Collaborator

@ncabatoff ncabatoff 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. I've made some minor improvement suggestions, take 'em or leave 'em as you see fit.

command/command_test.go Outdated Show resolved Hide resolved
command/operator_rekey.go Outdated Show resolved Hide resolved
command/operator_rekey.go Outdated Show resolved Hide resolved
command/operator_rekey.go Outdated Show resolved Hide resolved
command/operator_rekey.go Outdated Show resolved Hide resolved
// the function returns a client, the recovery keys, and a closer function
func testVaultServerAutoUnseal(tb testing.TB) (*api.Client, []string, func()) {
testSeal := seal.NewTestSeal(nil)
autoSeal, err := vault.NewAutoSeal(testSeal)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Depends on what you're trying to do. I think you made the right choice here. If we were actually exercising seal related more directly, I might point you at something that doesn't use a NewTestSeal, which is kind of a fake.

@miagilepner miagilepner enabled auto-merge (squash) January 30, 2023 16:30
@miagilepner miagilepner merged commit 097bd04 into main Jan 30, 2023
@miagilepner miagilepner deleted the miagilepner/VAULT-12833-rekey-recovery branch April 25, 2023 09:29
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.

2 participants