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

UI: Add version 1 if KV engine has no version data #23585

Merged
merged 10 commits into from
Oct 11, 2023

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Oct 10, 2023

Fixes #23463

When a user enables KV in the UI we default to version 2 by passing the version in the options object.

A kv v1 engine is mounted if no version flag is used when enabling kv using the CLI. This is unclear on the READ request because there is no version information in the options key (see below). This PR updates the UI logic so that if no version information exists, the UI assumes it is version 1.

$ vault secrets enable  kv

$ curl   
    --header "X-Vault-Token: root" \
    http://127.0.0.1:8200/v1/sys/mounts | jq
⇒
  "request_id": "fdf6549f-c136-c288-81e5-5e02993ad6c3",
  "lease_id": "",
  "renewable": false,
  "lease_duration": 0,
  "data": {
    "kv-test/": {
      "accessor": "kv_4396c4ae",
      "config": {
        "default_lease_ttl": 0,
        "force_no_cache": false,
        "max_lease_ttl": 0
      },
      "deprecation_status": "supported",
      "description": "",
      "external_entropy_access": false,
      "local": false,
      "options": null, //  <= no version information
      "plugin_version": "",
      "running_plugin_version": "v0.16.1+builtin",
      "running_sha256": "",
      "seal_wrap": false,
      "type": "kv",
      "uuid": "b0306a4d-01da-23dc-c734-925d6e72a579"
    }
 }

@hellobontempo hellobontempo added ui bug Used to indicate a potential bug labels Oct 10, 2023
@hellobontempo hellobontempo added this to the 1.15.1 milestone Oct 10, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Oct 10, 2023
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

Copy link
Contributor

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Nice! an elegant solution ✨

@github-actions
Copy link

github-actions bot commented Oct 10, 2023

CI Results:
All Go tests succeeded! ✅

@hellobontempo hellobontempo enabled auto-merge (squash) October 10, 2023 18:36
@hellobontempo hellobontempo merged commit feeda22 into main Oct 11, 2023
68 checks passed
@hellobontempo hellobontempo deleted the ui/VAULT-20811/assume-kv-v1-if-no-version-data branch October 11, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1.15.0] kv secrets not showing in the UI
3 participants