UI: add redirect for legacy secrets path (#10227) (#10230)

* add redirect for legacy secrets path

* adding changelog

Co-authored-by: Dan Rivera <dan.rivera@hashicorp.com>
This commit is contained in:
Vault Automation 2025-10-22 11:41:31 -04:00 committed by GitHub
parent 3457992a63
commit da1203b3b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 31 additions and 2 deletions

3
changelog/_10227.txt Normal file
View file

@ -0,0 +1,3 @@
```release-note:change
ui/secrets: Secrets engines url paths renamed from '/secrets' to '/secrets-engines'
```

View file

@ -62,7 +62,7 @@ export default class SecretEngineList extends Component<Args> {
{
key: 'accessor',
label: 'Accessor',
width: '150px',
width: '175px',
},
{
key: 'description',

View file

@ -167,6 +167,7 @@ Router.map(function () {
});
});
});
this.route('secrets-redirect', { path: '/secrets' }); // legacy redirect
this.route('secrets', { path: '/secrets-engines' }, function () {
this.route('enable', function () {
// TODO: Revisit path on create once components are separated - should we specify selected type or just keep it generic as /create?

View file

@ -0,0 +1,16 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Route from '@ember/routing/route';
import { service } from '@ember/service';
export default class SecretsRedirectRoute extends Route {
@service router;
beforeModel() {
// Redirect to secrets page under /secrets-engines
// if the user navigates to the legacy path /secrets
this.router.replaceWith('vault.cluster.secrets');
}
}

View file

@ -3,7 +3,7 @@
* SPDX-License-Identifier: BUSL-1.1
*/
import { settled, click, visit } from '@ember/test-helpers';
import { settled, click, visit, currentURL } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import { v4 as uuidv4 } from 'uuid';
@ -107,4 +107,13 @@ module('Acceptance | cluster', function (hooks) {
.dom('[data-test-resultant-acl-banner]')
.includesText(expectedText, 'Resultant ACL banner shows appropriate message for OSS/Enterprise');
});
test('redirects to secret-engines from legacy /secrets path', async function (assert) {
await visit('/vault/secrets');
assert.strictEqual(
currentURL(),
'/vault/secrets-engines',
'Navigating to /secrets redirects to /secrets-engines'
);
});
});