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: Wire up new KV ember engine to main app #22559

Merged
merged 29 commits into from
Aug 25, 2023

Conversation

hellobontempo
Copy link
Contributor

@hellobontempo hellobontempo commented Aug 25, 2023

A new and improved KV V2 secret engine experience!

This PR switches the default KV view when version=2 to the work implemented in #22426.

Note: this change enforces URL updates for paths within a KV V2 secret engine. For example:

  • List view: /ui/vault/secrets/kv-test/list -> /ui/vault/secrets/kv-test/kv/list (this is automatically redirected)
  • List view with subdirectory: /ui/vault/secrets/kv-test/list/my/ -> /ui/vault/secrets/kv-test/kv/my%2F/directory
  • Details view: /ui/vault/secrets/kv-test/show/my/nested-secret -> /ui/vault/secrets/kv-test/kv/my%2Fnested-secret/details

📸 New UI
List view, nested with pagination
Secret details view
Secret metadata view
NEW: Paths tab
Version history

@hellobontempo hellobontempo added this to the 1.15 milestone Aug 25, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Aug 25, 2023
@@ -156,7 +157,9 @@ export default class MountBackendForm extends Component {
this.args.mountType === 'secret' ? 'secrets engine' : 'auth method'
} at ${path}.`
);
yield this.args.onMountSuccess(type, path, mountModel);
// Check whether to use the engine route, since KV version 1 does not
Copy link
Contributor Author

Choose a reason for hiding this comment

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

👏

.includesText(
'custom_metadata validation failed: length of key',
'shows API error that is not captured by validation'
module('mount and configure', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

To make clear which tests are for KV V1 vs V2 I separated into modules. The first module does not set up a secret engine on beforeEach

this.server.shutdown();
});

test('it creates a secret and redirects', async function (assert) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Removed -- tested be kv-v2 navigation workflow

@hashishaw hashishaw marked this pull request as ready for review August 25, 2023 20:54
{{#each this.sortedDisplayableBackends as |backend|}}
<LinkedBlock
@params={{array backend.backendLink backend.id}}
class="list-item-row linked-block-item is-no-underline"
data-test-secrets-backend-link={{backend.id}}
@disabled={{if backend.isSupportedBackend false true}}
@disabled={{not backend.isSupportedBackend}}
Copy link
Contributor

Choose a reason for hiding this comment

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

🙃

@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

@hashishaw hashishaw enabled auto-merge (squash) August 25, 2023 22:11
@hashishaw hashishaw merged commit f3b9323 into main Aug 25, 2023
96 checks passed
@hashishaw hashishaw deleted the ui/VAULT-19189/update-routing-new-kv-engine branch August 25, 2023 22:45
@hashishaw
Copy link
Contributor

Related follow-on PRs:
#22541
#22552
#22565
#22593
#22648

@marcportabellaclotet-mt

Does this new version remove the availability to view diffs between secret versions?
With 1.14.3 version I can the diff option, but when using 1.15.0-rcx , the option is no longer in the UI.
I like the new kv UI! great job!

@hellobontempo
Copy link
Contributor Author

We moved the diff to the create a new secret version view (screenshot below 📸 ). We thought comparing version diffs to be more useful when editing. However, if you were using diff comparison across versions, we'd love to know your use case and get feedback on this change. 😁
Screenshot 2023-09-18 at 2 17 33 PM

@marcportabellaclotet-mt

We are presently employing the 'diff' tool to contrast secret versions across different points in time. Occasionally, we encounter problematic deployments due to incorrect key-value (KV) settings, and it is important for us to pinpoint when this modification was initially introduced.

Displaying the 'diff' at the time of creation is beneficial. Therefore, having both options, one at the moment of creation and the ability to compare any version, would be highly appreciated.

Thank you.

@hellobontempo
Copy link
Contributor Author

hellobontempo commented Sep 20, 2023

Thank you @marcportabellaclotet-mt for your incredibly helpful feedback! PR #23200 returns this functionality to the UI and we plan to ship it in the 1.15 GA release. The view will be located in the toolbar of the Version history tab. Let me know if you have any further input!
diff

@marcportabellaclotet-mt

Incredible update! We greatly appreciate your attention to this feature.
Vault is outstanding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants