diff --git a/changelog/10596.txt b/changelog/10596.txt new file mode 100644 index 000000000..492f972bb --- /dev/null +++ b/changelog/10596.txt @@ -0,0 +1,4 @@ +```release-note:bug +ui: Fix bug that double encodes secret route when there are spaces in the path and makes you unable to view the version history. +``` + diff --git a/ui/app/routes/vault/cluster/secrets/backend/versions.js b/ui/app/routes/vault/cluster/secrets/backend/versions.js index da1d44097..7604ea952 100644 --- a/ui/app/routes/vault/cluster/secrets/backend/versions.js +++ b/ui/app/routes/vault/cluster/secrets/backend/versions.js @@ -1,6 +1,7 @@ import Route from '@ember/routing/route'; import utils from 'vault/lib/key-utils'; import UnloadModelRoute from 'vault/mixins/unload-model-route'; +import { normalizePath } from 'vault/utils/path-encoding-helpers'; export default Route.extend(UnloadModelRoute, { templateName: 'vault/cluster/secrets/backend/versions', @@ -22,6 +23,7 @@ export default Route.extend(UnloadModelRoute, { model(params) { let { secret } = params; const { backend } = this.paramsFor('vault.cluster.secrets.backend'); - return this.store.queryRecord('secret-v2', { id: secret, backend }); + let id = normalizePath(secret); + return this.store.queryRecord('secret-v2', { id, backend }); }, }); diff --git a/ui/app/templates/components/secret-edit.hbs b/ui/app/templates/components/secret-edit.hbs index 9de3ec4d8..cefe55f43 100644 --- a/ui/app/templates/components/secret-edit.hbs +++ b/ui/app/templates/components/secret-edit.hbs @@ -45,7 +45,7 @@ as |D| > @@ -56,6 +56,7 @@