From afa2bb3922e20206d8bf45cf37f5999ccf774190 Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Wed, 15 Nov 2023 18:36:01 -0500 Subject: [PATCH] backport of UI: Allow token configuration tune (#24150) Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com> --- changelog/24147.txt | 3 +++ ui/app/components/auth-config-form/options.js | 2 +- ui/tests/acceptance/auth-list-test.js | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 changelog/24147.txt diff --git a/changelog/24147.txt b/changelog/24147.txt new file mode 100644 index 0000000000..960ae2250c --- /dev/null +++ b/changelog/24147.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix error when tuning token auth configuration within namespace +``` \ No newline at end of file diff --git a/ui/app/components/auth-config-form/options.js b/ui/app/components/auth-config-form/options.js index c0e7f98326..38b6da115a 100644 --- a/ui/app/components/auth-config-form/options.js +++ b/ui/app/components/auth-config-form/options.js @@ -32,7 +32,7 @@ export default AuthConfigComponent.extend({ data.description = this.model.description; // token_type should not be tuneable for the token auth method. - if (this.model.type === 'token') { + if (this.model.methodType === 'token') { delete data.token_type; } diff --git a/ui/tests/acceptance/auth-list-test.js b/ui/tests/acceptance/auth-list-test.js index 0ac6e53a8f..9aa51b8cde 100644 --- a/ui/tests/acceptance/auth-list-test.js +++ b/ui/tests/acceptance/auth-list-test.js @@ -151,4 +151,20 @@ module('Acceptance | auth backend list', function (hooks) { } } }); + + test('enterprise: token config within namespace', async function (assert) { + const ns = 'ns-wxyz'; + await runCmd(`write sys/namespaces/${ns} -f`); + await authPage.loginNs(ns); + // go directly to token configure route + await visit('/vault/settings/auth/configure/token/options'); + await fillIn('[data-test-input="description"]', 'My custom description'); + await click('[data-test-save-config="true"]'); + assert.strictEqual(currentURL(), '/vault/access', 'successfully saves and navigates away'); + await click('[data-test-auth-backend-link="token"]'); + assert + .dom('[data-test-row-value="Description"]') + .hasText('My custom description', 'description was saved'); + await runCmd(`delete sys/namespaces/${ns}`); + }); });