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 approle login IPBelongsToCIDRBlocksSlice err handling #14107

Merged
merged 2 commits into from Feb 16, 2022

Conversation

ccapurso
Copy link
Contributor

Check belongs and err return values from cidrutil.IPBelongsToCIDRBlocksSlice. In the case that err is nil, the current fmt.Errorf with error wrapping, %w results in printing %!w(<nil>) which is not ideal. The errors returned from cidrutil.IPBelongsToCIDRBlocksSlice actually denote invalid inputs (e.g. missing IP address, empty cidrs). This change introduces the separation of checking both return values together. If an error occurs, a Logical.ErrorResponse will still be returned with a logical.ErrInvalidRequest error.

Fixes #14096

@ccapurso ccapurso added agent bug Used to indicate a potential bug auth/approle and removed agent labels Feb 16, 2022
@vercel vercel bot temporarily deployed to Preview – vault February 16, 2022 20:49 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook February 16, 2022 20:49 Inactive
@ccapurso ccapurso merged commit c27825a into main Feb 16, 2022
@ccapurso ccapurso deleted the fix-approle-login-err-format branch February 16, 2022 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth/approle bug Used to indicate a potential bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad format string in AppRole error message
3 participants