mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
UI: MFA methods now display namespace_path instead of namespace_id (#29588)
* update mfa methods to use namespace_path instead of namespace_id * add test for empty namespace path and add namespace path to factories * add changelog entry * fix name * hide namespace label when path is empty and test updates
This commit is contained in:
3
changelog/29588.txt
Normal file
3
changelog/29588.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
ui: MFA methods now display the namespace path instead of the namespace id.
|
||||||
|
```
|
||||||
@@ -58,7 +58,7 @@ export default class MfaMethod extends Model {
|
|||||||
@attr('string', {
|
@attr('string', {
|
||||||
label: 'Namespace',
|
label: 'Namespace',
|
||||||
})
|
})
|
||||||
namespace_id;
|
namespace_path;
|
||||||
@attr('string') mount_accessor;
|
@attr('string') mount_accessor;
|
||||||
|
|
||||||
// PING ID
|
// PING ID
|
||||||
|
|||||||
@@ -17,12 +17,14 @@
|
|||||||
{{@model.name}}
|
{{@model.name}}
|
||||||
</span>
|
</span>
|
||||||
<Hds::Badge @text={{@model.id}} class="has-left-margin-xs" />
|
<Hds::Badge @text={{@model.id}} class="has-left-margin-xs" />
|
||||||
|
{{#if @model.namespace_path}}
|
||||||
<div class="has-top-margin-xs">
|
<div class="has-top-margin-xs">
|
||||||
<code class="is-size-9">
|
<code class="is-size-9">
|
||||||
Namespace:
|
Namespace:
|
||||||
{{@model.namespace_id}}
|
{{@model.namespace_path}}
|
||||||
</code>
|
</code>
|
||||||
</div>
|
</div>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default Factory.extend({
|
|||||||
api_hostname: 'api-foobar.duosecurity.com',
|
api_hostname: 'api-foobar.duosecurity.com',
|
||||||
mount_accessor: '',
|
mount_accessor: '',
|
||||||
name: '', // returned but cannot be set at this time
|
name: '', // returned but cannot be set at this time
|
||||||
namespace_id: 'root',
|
namespace_path: '', // the root namespace returns an empty string for the path
|
||||||
pushinfo: '',
|
pushinfo: '',
|
||||||
type: 'duo',
|
type: 'duo',
|
||||||
use_passcode: false,
|
use_passcode: false,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default Factory.extend({
|
|||||||
base_url: 'okta.com',
|
base_url: 'okta.com',
|
||||||
mount_accessor: '',
|
mount_accessor: '',
|
||||||
name: '', // returned but cannot be set at this time
|
name: '', // returned but cannot be set at this time
|
||||||
namespace_id: 'root',
|
namespace_path: 'admin/',
|
||||||
org_name: 'dev-foobar',
|
org_name: 'dev-foobar',
|
||||||
type: 'okta',
|
type: 'okta',
|
||||||
username_template: '', // returned but cannot be set at this time
|
username_template: '', // returned but cannot be set at this time
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ export default Factory.extend({
|
|||||||
org_alias: 'foobarbaz',
|
org_alias: 'foobarbaz',
|
||||||
type: 'pingid',
|
type: 'pingid',
|
||||||
username_template: '',
|
username_template: '',
|
||||||
namespace_id: 'root',
|
namespace_path: 'admin/',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default Factory.extend({
|
|||||||
key_size: 20,
|
key_size: 20,
|
||||||
max_validation_attempts: 5,
|
max_validation_attempts: 5,
|
||||||
name: '', // returned but cannot be set at this time
|
name: '', // returned but cannot be set at this time
|
||||||
namespace_id: 'root',
|
namespace_path: 'admin/',
|
||||||
period: 30,
|
period: 30,
|
||||||
qr_size: 200,
|
qr_size: 200,
|
||||||
skew: 1,
|
skew: 1,
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ module('Acceptance | mfa-login-enforcement', function (hooks) {
|
|||||||
assert
|
assert
|
||||||
.dom(`[data-test-mfa-method-list-item="${method.id}"]`)
|
.dom(`[data-test-mfa-method-list-item="${method.id}"]`)
|
||||||
.includesText(
|
.includesText(
|
||||||
`${method.name} ${method.id} Namespace: ${method.namespace_id}`,
|
`${method.name} ${method.id} Namespace: ${method.namespace_path}`,
|
||||||
'Method list item renders'
|
'Method list item renders'
|
||||||
);
|
);
|
||||||
await click('[data-test-popup-menu-trigger]');
|
await click('[data-test-popup-menu-trigger]');
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ module('Acceptance | mfa-method', function (hooks) {
|
|||||||
assert
|
assert
|
||||||
.dom(`[data-test-mfa-method-list-item="${model.id}"]`)
|
.dom(`[data-test-mfa-method-list-item="${model.id}"]`)
|
||||||
.includesText(
|
.includesText(
|
||||||
`${model.name} ${model.id} Namespace: ${model.namespace_id}`,
|
`${model.name} ${model.id} Namespace: ${model.namespace_path}`,
|
||||||
'Copy renders for list item'
|
'Copy renders for list item'
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -87,6 +87,17 @@ module('Acceptance | mfa-method', function (hooks) {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('it should not display for the root namespace', async function (assert) {
|
||||||
|
await visit('/vault/access/mfa');
|
||||||
|
const methods = this.getMethods();
|
||||||
|
const duoModel = this.store.peekRecord('mfa-method', methods[1].id);
|
||||||
|
assert.strictEqual(duoModel.namespace_path, '', 'Namespace path is unset');
|
||||||
|
assert
|
||||||
|
.dom(`[data-test-mfa-method-list-item="${duoModel.id}"]`)
|
||||||
|
.includesText(`${duoModel.name} ${duoModel.id}`, 'Copy renders for list item without namespace path')
|
||||||
|
.doesNotContainText('Namespace:', 'Does not include the namespace label');
|
||||||
|
});
|
||||||
|
|
||||||
test('it should display method details', async function (assert) {
|
test('it should display method details', async function (assert) {
|
||||||
// ensure methods are tied to an enforcement
|
// ensure methods are tied to an enforcement
|
||||||
this.server.get('/identity/mfa/login-enforcement', () => {
|
this.server.get('/identity/mfa/login-enforcement', () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user