-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI: [VAULT-17461] add mount configuration as toggle for pki #23166
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
90e8537
Add mount configuration as toggle for pki
kiannaquach e45b97d
Remove tests
kiannaquach 8a01169
Merge branch 'main' into ui/VAULT-17461/pki-config
kiannaquach d835712
Add changelog
kiannaquach f4edaa4
Move toolbar out of configuration
kiannaquach 5dfd4c0
Remove mount config arg
kiannaquach 285c06b
Merge branch 'main' into ui/VAULT-17461/pki-config
kiannaquach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:improvement | ||
ui: Update pki mount configuration details to match the new mount configuration details pattern | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,26 +46,12 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
unifiedCrl: true, | ||
unifiedCrlOnExistingPaths: true, | ||
}); | ||
this.mountConfig = { | ||
id: 'pki-test', | ||
engineType: 'pki', | ||
path: '/pki-test', | ||
accessor: 'pki_33345b0d', | ||
local: false, | ||
sealWrap: true, | ||
config: this.store.createRecord('mount-config', { | ||
defaultLease: '12h', | ||
maxLeaseTtl: '400h', | ||
allowedManagedKeys: true, | ||
}), | ||
}; | ||
}); | ||
|
||
test('shows the correct information on cluster config', async function (assert) { | ||
await render(hbs`<Page::PkiConfigurationDetails @cluster={{this.cluster}} @hasConfig={{true}} />,`, { | ||
owner: this.engine, | ||
}); | ||
|
||
assert | ||
.dom(SELECTORS.rowValue("Mount's API path")) | ||
.hasText('https://pr-a.vault.example.com/v1/ns1/pki-root', 'mount API path row renders'); | ||
|
@@ -74,7 +60,7 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
|
||
test('shows the correct information on global urls section', async function (assert) { | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
|
||
|
@@ -86,7 +72,7 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
.hasText('example.com', 'issuing certificate value renders'); | ||
this.urls.issuingCertificates = null; | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
assert | ||
|
@@ -102,7 +88,7 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
|
||
test('shows the correct information on crl section', async function (assert) { | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
|
||
|
@@ -128,7 +114,7 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
this.crl.autoRebuild = false; | ||
this.crl.enableDelta = false; | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
assert.dom(SELECTORS.rowValue('Auto-rebuild')).hasText('Off', 'it renders falsy auto build'); | ||
|
@@ -148,7 +134,7 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
this.crl.disable = true; | ||
this.crl.ocspDisable = true; | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
assert.dom(SELECTORS.rowValue('CRL building')).hasText('Disabled', 'disabled renders'); | ||
|
@@ -167,7 +153,7 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
this.version = this.owner.lookup('service:version'); | ||
this.version.version = '1.13.1+ent'; | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
assert.dom(SELECTORS.rowValue('Cross-cluster revocation')).hasText('Yes'); | ||
|
@@ -182,74 +168,11 @@ module('Integration | Component | Page::PkiConfigurationDetails', function (hook | |
this.version = this.owner.lookup('service:version'); | ||
this.version.version = '1.13.1'; | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
assert.dom(SELECTORS.rowValue('Cross-cluster revocation')).doesNotExist(); | ||
assert.dom(SELECTORS.rowValue('Unified CRL')).doesNotExist(); | ||
assert.dom(SELECTORS.rowValue('Unified CRL on existing paths')).doesNotExist(); | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing these test since the mount config now lives in the route template. There are also component tests for the |
||
test('shows the correct information on mount configuration section', async function (assert) { | ||
await render( | ||
hbs`<Page::PkiConfigurationDetails @urls={{this.urls}} @crl={{this.crl}} @mountConfig={{this.mountConfig}} @hasConfig={{true}} />,`, | ||
{ owner: this.engine } | ||
); | ||
|
||
assert | ||
.dom(SELECTORS.rowLabel('Secret engine type')) | ||
.hasText('Secret engine type', 'engine type row label renders'); | ||
assert.dom(SELECTORS.rowValue('Secret engine type')).hasText('pki', 'engine type row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Path')).hasText('Path', 'path row label renders'); | ||
assert.dom(SELECTORS.rowValue('Path')).hasText('/pki-test', 'path row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Accessor')).hasText('Accessor', 'accessor row label renders'); | ||
assert.dom(SELECTORS.rowValue('Accessor')).hasText('pki_33345b0d', 'accessor row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Local')).hasText('Local', 'local row label renders'); | ||
assert.dom(SELECTORS.rowValue('Local')).hasText('No', 'local row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Seal wrap')).hasText('Seal wrap', 'seal wrap row label renders'); | ||
assert | ||
.dom(SELECTORS.rowValue('Seal wrap')) | ||
.hasText('Yes', 'seal wrap row value renders Yes if sealWrap is true'); | ||
assert.dom(SELECTORS.rowLabel('Max lease TTL')).hasText('Max lease TTL', 'max lease label renders'); | ||
assert.dom(SELECTORS.rowValue('Max lease TTL')).hasText('400h', 'max lease value renders'); | ||
assert | ||
.dom(SELECTORS.rowLabel('Allowed managed keys')) | ||
.hasText('Allowed managed keys', 'allowed managed keys label renders'); | ||
assert | ||
.dom(SELECTORS.rowValue('Allowed managed keys')) | ||
.hasText('Yes', 'allowed managed keys value renders'); | ||
}); | ||
|
||
test('shows mount configuration when hasConfig is false', async function (assert) { | ||
this.urls = 403; | ||
this.crl = 403; | ||
|
||
await render( | ||
hbs`<Page::PkiConfigurationDetails @mountConfig={{this.mountConfig}} @hasConfig={{false}} />,`, | ||
{ owner: this.engine } | ||
); | ||
|
||
assert | ||
.dom(SELECTORS.rowLabel('Secret engine type')) | ||
.hasText('Secret engine type', 'engine type row label renders'); | ||
assert.dom(SELECTORS.rowValue('Secret engine type')).hasText('pki', 'engine type row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Path')).hasText('Path', 'path row label renders'); | ||
assert.dom(SELECTORS.rowValue('Path')).hasText('/pki-test', 'path row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Accessor')).hasText('Accessor', 'accessor row label renders'); | ||
assert.dom(SELECTORS.rowValue('Accessor')).hasText('pki_33345b0d', 'accessor row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Local')).hasText('Local', 'local row label renders'); | ||
assert.dom(SELECTORS.rowValue('Local')).hasText('No', 'local row value renders'); | ||
assert.dom(SELECTORS.rowLabel('Seal wrap')).hasText('Seal wrap', 'seal wrap row label renders'); | ||
assert | ||
.dom(SELECTORS.rowValue('Seal wrap')) | ||
.hasText('Yes', 'seal wrap row value renders Yes if sealWrap is true'); | ||
assert.dom(SELECTORS.rowLabel('Max lease TTL')).hasText('Max lease TTL', 'max lease label renders'); | ||
assert.dom(SELECTORS.rowValue('Max lease TTL')).hasText('400h', 'max lease value renders'); | ||
assert | ||
.dom(SELECTORS.rowLabel('Allowed managed keys')) | ||
.hasText('Allowed managed keys', 'allowed managed keys label renders'); | ||
assert | ||
.dom(SELECTORS.rowValue('Allowed managed keys')) | ||
.hasText('Yes', 'allowed managed keys value renders'); | ||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove this arg?