-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
KV automatic delete state issue in UI #13166
Conversation
… cached values for deleted prop
…version action when users cannot read metadata
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done 👏 Thanks for taking all the extra steps here too! Oh, don't forget the labels too. UI and not sure if this is getting backported or not. Sounds like something that should be backported to 1.9 which is where the KV work was done. If you backport farther than that you might hit a lot of changes that make this merge difficult.
* converts secret-v2-version model to native class -- fixes issues with cached values for deleted prop * adds changelog entry * adds disabled state to ToolbarLink component and disables create new version action when users cannot read metadata * updates secret-edit acceptance test
* converts secret-v2-version model to native class -- fixes issues with cached values for deleted prop * adds changelog entry * adds disabled state to ToolbarLink component and disables create new version action when users cannot read metadata * updates secret-edit acceptance test
When an automatic deletion time for a secret passes during a UI session the state was not properly updating to reflect the change. Instead of displaying the placeholder to indicate that the version has been deleted the secret is displayed with missing data.

The secret-edit route is fetching the version data but since the
deletionTime
does not change thedeleted
computed property on the secret-v2-version model was returning the cached value. After converting the model to a native class and using a getter the deleted value is calculated each time it is accessed which fixes the state issue.To test:
vault kv put secret/testversions key="value" && vault kv metadata put -delete-version-after="30s" secret/testversions
I started working on an acceptance test but since we are dealing with time elapsing I became concerned that it might end up flaky. If we think it's important to cover this case I'm happy to work on it more.