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

Backport of pki health-check fails to read in int config values into release/1.13.x #19268

Conversation

hc-github-team-secure-vault-core
Copy link
Collaborator

Backport

This PR is auto-generated from #19265 to be assessed for backporting due to the inclusion of the label backport/1.13.x.

The below text is copied from the body of the original PR.


Issue Description

While testing the vault pki health-check feature, providing it a configuration file with integer value of say 100 for root_issued_leaves.root_issued_leaves led to the following error.

Failed to build health check configuration: error saving merged config for root_issued_leaves: error parsing root_issued_leaves.certs_to_fetch: could not parse value from input

Fix

  • Go's default behavior when decoding numbers to an interface{} is to use a float64 type which parseutil.SafeParseIntRange does not handle. Switch to having the JSON decoder use json.Number which parseutil methods properly handle.
  • Tested configuration values as strings, integers work
  • Also tested we get proper error messages for out of bounds integers and float values

Overview of commits

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/stevendpclark/pki-healthcheck-config/endlessly-ethical-dinosaur branch 2 times, most recently from 2a8900d to ce46a92 Compare February 21, 2023 13:52
@stevendpclark stevendpclark enabled auto-merge (squash) February 21, 2023 13:53
@stevendpclark stevendpclark self-assigned this Feb 21, 2023
@stevendpclark stevendpclark added this to the 1.13.0 milestone Feb 21, 2023
@stevendpclark stevendpclark merged commit 8ffa334 into release/1.13.x Feb 21, 2023
@stevendpclark stevendpclark deleted the backport/stevendpclark/pki-healthcheck-config/endlessly-ethical-dinosaur branch February 21, 2023 14:18
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