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

Validate Keystores Validator Client RPC Endpoint #9799

Merged
merged 9 commits into from
Oct 20, 2021

Conversation

rauljordan
Copy link
Contributor

As part of the web UI onboarding, it is important to validate if a user's password can decrypt the keystores they provided during the wizard steps. Otherwise, we complete the entire onboarding process only for a user to be met with an "Incorrect keystore password" error that could have been avoided.

@@ -26,14 +26,15 @@ service Wallet {
get: "/v2/validator/wallet"
};
}
rpc GenerateMnemonic(google.protobuf.Empty) returns (GenerateMnemonicResponse) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is unused and no plans to ever bring it back

Mnemonic: mnemonic,
}, nil
// Needs to unmarshal the keystores from the requests.
if req.Keystores == nil || len(req.Keystores) < 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

In such cases I always wonder if we should be even more restrictive and:

  1. check if at least one value in the array is not empty (or has whitespace only)
  2. in the loop that follows, skip empty/whitespace values

This might be too defensive though.

@rauljordan rauljordan merged commit f7c34b0 into develop Oct 20, 2021
@delete-merged-branch delete-merged-branch bot deleted the validate-keystores branch October 20, 2021 14:24
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