Skip to content

Commit

Permalink
UI: Allow token configuration tune from namespace (#24147)
Browse files Browse the repository at this point in the history
* check methodType instead of type when checking to remove token_type from payload

* Add changelog
  • Loading branch information
hashishaw authored Nov 15, 2023
1 parent 7a8ced4 commit 87f09c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/24147.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
ui: Fix error when tuning token auth configuration within namespace
```
2 changes: 1 addition & 1 deletion ui/app/components/auth-config-form/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
16 changes: 16 additions & 0 deletions ui/tests/acceptance/auth-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
});
});

0 comments on commit 87f09c8

Please sign in to comment.