From b14c00949cf773e2ab308fe1db4dca913066b0f0 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 27 Aug 2019 13:26:47 -0700 Subject: [PATCH 01/39] add placeholder for Key actions tab --- ui/app/templates/partials/transit-form-show.hbs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 1cfda3481958..916705bbf473 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -1,6 +1,18 @@
- - - {{#if (eq tab 'versions')}} - - {{/if}} - {{#if (eq mode "show") }} - {{#if (or capabilities.canUpdate capabilities.canDelete)}} +{{#unless (eq tab 'actions')}} + + + {{#if (eq tab 'versions')}} + + {{/if}} + {{#if (eq mode "show") }} + {{#if (or capabilities.canUpdate capabilities.canDelete)}} + + Edit encryption key + + {{/if}} - Edit encryption key + Key actions {{/if}} - - Key actions - - {{/if}} - - + + +{{/unless}} + -{{#if (eq tab 'versions')}} +{{#if (eq tab 'actions')}} +

Encrypt

+{{else if (eq tab 'versions')}} {{#if (or (eq key.type "aes256-gcm96") (eq key.type "chacha20-poly1305") From 912db0e489babcd5de697e6cf304f6b4e95603f0 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Wed, 28 Aug 2019 15:48:45 -0700 Subject: [PATCH 04/39] remove extra whitespace from component blueprint --- ui/blueprints/component/files/__root__/__path__/__name__.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/blueprints/component/files/__root__/__path__/__name__.js b/ui/blueprints/component/files/__root__/__path__/__name__.js index e20052a088e3..1b4078e3178d 100644 --- a/ui/blueprints/component/files/__root__/__path__/__name__.js +++ b/ui/blueprints/component/files/__root__/__path__/__name__.js @@ -11,7 +11,7 @@ * @param {string} [param1=defaultValue] - param1 is... */ - import Component from '@ember/component'; +import Component from '@ember/component'; <%= importTemplate %> export default Component.extend({<%= contents %> }); From e60c6ed28d3e6124904bb4c953bc40879f14a1a1 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Wed, 4 Sep 2019 10:09:13 -0700 Subject: [PATCH 05/39] add SelectableCard --- ui/app/templates/components/selectable-card.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/app/templates/components/selectable-card.hbs b/ui/app/templates/components/selectable-card.hbs index bb69888640a0..6c55fe02857c 100644 --- a/ui/app/templates/components/selectable-card.hbs +++ b/ui/app/templates/components/selectable-card.hbs @@ -1,7 +1,7 @@ {{!-- conditional to check if SelectableCard is apart of a CSS Grid, if yes return grid item class --}} {{#if gridContainer}}
-
+

{{format-number total}}

{{formattedCardTitle}}

{{subText}}

@@ -10,7 +10,7 @@
{{else}}
-
+

{{format-number total}}

{{formattedCardTitle}}

{{subText}}

From 0171cadb9ebbd0693fe0772b97bf03cb54650f76 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Wed, 4 Sep 2019 10:42:14 -0700 Subject: [PATCH 06/39] move key actions from side nav to top nav --- .../backend/transit-actions-layout.hbs | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs index c33bd2fd3048..788ac1a98e32 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs @@ -1,20 +1,5 @@
- {{#menu-sidebar title="Transit Actions" class="is-2"}} - {{#each model.supportedActions as |supportedAction|}} -
  • - {{#secret-link - mode="actions" - secret=model.id - class=(if (eq supportedAction selectedAction) "is-active") - queryParams=(query-params action=supportedAction) - data-test-transit-action-link=supportedAction - }} - {{capitalize supportedAction}} - {{/secret-link}} -
  • - {{/each}} - {{/menu-sidebar}} -
    +
    {{key-value-header @@ -32,6 +17,26 @@ +
    + +
    + Date: Wed, 4 Sep 2019 10:50:05 -0700 Subject: [PATCH 07/39] make tabs active --- .../secrets/backend/transit-actions-layout.hbs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs index 788ac1a98e32..2272b90d16b4 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs @@ -21,14 +21,13 @@
    - - - - Details - - - - Date: Wed, 29 Jan 2020 11:22:33 -0600 Subject: [PATCH 09/39] add divs to link to each key action on key actions page --- ui/app/templates/partials/transit-form-show.hbs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 710eb5cef4cd..ea6ec181f649 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -75,7 +75,19 @@ {{#if (eq tab 'actions')}} -

    Encrypt

    + {{#each model.supportedActions as |supportedAction|}} +
    + {{#secret-link + mode="actions" + secret=model.id + class=(if (eq supportedAction selectedAction) "is-active") + queryParams=(query-params action=supportedAction) + data-test-transit-action-link=supportedAction + }} + {{capitalize supportedAction}} + {{/secret-link}} +
    + {{/each}} {{else if (eq tab 'versions')}} {{#if (or (eq key.type "aes256-gcm96") From 3bdc745eaa5d491d0cad4c131b7961c14bca73e9 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Wed, 5 Feb 2020 15:05:38 -0600 Subject: [PATCH 10/39] move preview-head to gitignore --- ui/.gitignore | 1 + ui/.storybook/preview-head.html | 27 --------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 ui/.storybook/preview-head.html diff --git a/ui/.gitignore b/ui/.gitignore index 6680946d4573..944ab0c5121f 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -17,6 +17,7 @@ /npm-debug.log* /testem.log /yarn-error.log +/.storybook/preview-head.html # ember-try /.node_modules.ember-try/ diff --git a/ui/.storybook/preview-head.html b/ui/.storybook/preview-head.html deleted file mode 100644 index d35e63834d9b..000000000000 --- a/ui/.storybook/preview-head.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - From 2e5293c4748092adf843d47e6c266706bbdeee1b Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Wed, 5 Feb 2020 15:08:12 -0600 Subject: [PATCH 11/39] use selectable card css --- ui/app/models/transit-key.js | 27 ++++++++++--------- .../templates/partials/transit-form-show.hbs | 11 ++++---- .../backend/transit-actions-layout.hbs | 8 +++--- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 3f2e029a3dc7..21c08a323d81 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -7,14 +7,14 @@ import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; const { attr } = DS; const ACTION_VALUES = { - encrypt: 'supportsEncryption', - decrypt: 'supportsDecryption', - datakey: 'supportsEncryption', - rewrap: 'supportsEncryption', - sign: 'supportsSigning', - hmac: true, - verify: true, - export: 'exportable', + encrypt: ['supportsEncryption', 'Looks up wrapping properties for the given token'], + decrypt: ['supportsDecryption', 'Decrypts the provided ciphertext using this key'], + datakey: ['supportsEncryption', 'Generates a new key and value encrypted with this key'], + rewrap: ['supportsEncryption', 'Rewraps the ciphertext using the latest version of the named key'], + sign: ['supportsSigning'], + hmac: [true, 'Generate a data digest using a hash algorithm'], + verify: [true, 'Validate the provided signature for the given data'], + export: ['exportable'], }; export default DS.Model.extend({ @@ -56,13 +56,14 @@ export default DS.Model.extend({ }, supportedActions: computed('type', function() { - return Object.keys(ACTION_VALUES).filter(name => { - const isSupported = ACTION_VALUES[name]; - if (typeof isSupported === 'boolean') { - return isSupported; + let actions = []; + Object.keys(ACTION_VALUES).filter(name => { + const isSupported = ACTION_VALUES[name][0]; + if (typeof isSupported === 'boolean' || get(this, isSupported)) { + return actions.push({ name, description: ACTION_VALUES[name][1] }); } - return get(this, isSupported); }); + return actions; }), canDelete: computed('deletionAllowed', 'lastLoadTS', function() { diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index ea6ec181f649..04907d77df02 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -76,16 +76,17 @@ {{#if (eq tab 'actions')}} {{#each model.supportedActions as |supportedAction|}} -
    +
    {{#secret-link mode="actions" secret=model.id - class=(if (eq supportedAction selectedAction) "is-active") - queryParams=(query-params action=supportedAction) - data-test-transit-action-link=supportedAction + class=(if (eq supportedAction.name selectedAction) "is-active") + queryParams=(query-params action=supportedAction.name) + data-test-transit-action-link=supportedAction.name }} - {{capitalize supportedAction}} + {{capitalize supportedAction.name}} {{/secret-link}} +

    {{supportedAction.description}}

    {{/each}} {{else if (eq tab 'versions')}} diff --git a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs index 2d6aa515b534..837b251c96e3 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs @@ -21,14 +21,14 @@
    - {{#secret-link +

    {{#secret-link mode="actions" secret=model.id class=(if (eq supportedAction.name selectedAction) "is-active") @@ -84,7 +84,8 @@ }} {{capitalize supportedAction.name}} {{/secret-link}} -

    {{supportedAction.description}}

    +

    +

    {{supportedAction.description}}

    {{/each}} From 4660bf4fa814faf3c2ecdd4a36af3beebe323b39 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Thu, 6 Feb 2020 10:00:36 -0600 Subject: [PATCH 15/39] update Key Actions page header --- .../secrets/backend/transit-actions-layout.hbs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs index 837b251c96e3..e21adeb06510 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs @@ -12,7 +12,17 @@

    - {{model.id}} + {{#secret-link + class="is-inline has-text-info" + secret=model.id + mode="show" + replace=true + queryParams=(query-params tab='actions') + data-test-transit-link="actions" + }} + + {{/secret-link}} + Key Actions

    From 92500440e87ce6eb987cd828494e4efc7d68ab85 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Fri, 7 Feb 2020 11:37:21 -0600 Subject: [PATCH 16/39] make cards clickable --- .../templates/partials/transit-form-show.hbs | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 8ae8520e9e9c..1acbcd7f82fc 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -70,24 +70,22 @@ {{#if (eq tab 'actions')}}
    {{#each model.supportedActions as |supportedAction|}} -
    + {{#linked-block + "vault.cluster.secrets.backend.actions" + model.id + queryParams=(hash action=supportedAction.name) + class="selectable-card" + }}
    -

    {{#secret-link - mode="actions" - secret=model.id - class=(if (eq supportedAction.name selectedAction) "is-active") - queryParams=(query-params action=supportedAction.name) - data-test-transit-action-link=supportedAction.name - }} +

    {{capitalize supportedAction.name}} - {{/secret-link}} -

    +

    {{supportedAction.description}}

    -
    + {{/linked-block}} {{/each}}
    {{else if (eq tab 'versions')}} From 6a681a3265712d42df95619a77f89481e0b74fe8 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Fri, 7 Feb 2020 13:26:46 -0600 Subject: [PATCH 17/39] refactor supportedActions to include glyph --- ui/app/models/transit-key.js | 42 ++++++++++++++----- .../templates/partials/transit-form-show.hbs | 2 +- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 21c08a323d81..6cd26fae9337 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -7,14 +7,31 @@ import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; const { attr } = DS; const ACTION_VALUES = { - encrypt: ['supportsEncryption', 'Looks up wrapping properties for the given token'], - decrypt: ['supportsDecryption', 'Decrypts the provided ciphertext using this key'], - datakey: ['supportsEncryption', 'Generates a new key and value encrypted with this key'], - rewrap: ['supportsEncryption', 'Rewraps the ciphertext using the latest version of the named key'], - sign: ['supportsSigning'], - hmac: [true, 'Generate a data digest using a hash algorithm'], - verify: [true, 'Validate the provided signature for the given data'], - export: ['exportable'], + encrypt: { + isSupported: 'supportsEncryption', + description: 'Looks up wrapping properties for the given token', + glyph: 'lock-closed', + }, + decrypt: { + isSupported: 'supportsDecryption', + description: 'Decrypts the provided ciphertext using this key', + }, + datakey: { + isSupported: 'supportsEncryption', + description: 'Generates a new key and value encrypted with this key', + }, + rewrap: { + isSupported: 'supportsEncryption', + description: 'Rewraps the ciphertext using the latest version of the named key', + }, + sign: { isSupported: 'supportsSigning' }, + hmac: { isSupported: true, description: 'Generate a data digest using a hash algorithm' }, + verify: { + isSupported: true, + description: 'Validate the provided signature for the given data', + glyph: 'check-circle-outline', + }, + export: { isSupported: 'exportable' }, }; export default DS.Model.extend({ @@ -58,9 +75,14 @@ export default DS.Model.extend({ supportedActions: computed('type', function() { let actions = []; Object.keys(ACTION_VALUES).filter(name => { - const isSupported = ACTION_VALUES[name][0]; + const keyAction = ACTION_VALUES[name]; + const isSupported = keyAction.isSupported; if (typeof isSupported === 'boolean' || get(this, isSupported)) { - return actions.push({ name, description: ACTION_VALUES[name][1] }); + return actions.push({ + name, + description: keyAction.description, + glyph: keyAction.glyph, + }); } }); return actions; diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 1acbcd7f82fc..a2fda15d29a1 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -77,7 +77,7 @@ class="selectable-card" }}
    - +

    From 8a1f993576c363fe1a5d3f5399e3eaa128ab7deb Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 10:22:49 -0600 Subject: [PATCH 18/39] make header black on hover --- ui/app/templates/partials/transit-form-show.hbs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index a2fda15d29a1..0f0dedc9ee10 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -77,7 +77,11 @@ class="selectable-card" }}
    - +

    From a789def8c2c005f40d07a75b511b6ce84cc2bdf6 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 12:01:23 -0600 Subject: [PATCH 19/39] rename selectable-card transit card and update styling --- ui/app/styles/components/transit-card.scss | 41 +++++++++++++++++++ ui/app/styles/core.scss | 1 + .../templates/partials/transit-form-show.hbs | 8 ++-- 3 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 ui/app/styles/components/transit-card.scss diff --git a/ui/app/styles/components/transit-card.scss b/ui/app/styles/components/transit-card.scss new file mode 100644 index 000000000000..1fb0cec046e9 --- /dev/null +++ b/ui/app/styles/components/transit-card.scss @@ -0,0 +1,41 @@ +.transit-card-container { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 0.2fr)); + grid-template-rows: 1fr; + align-content: start; + grid-gap: 2rem; + margin-top: $spacing-l; +} + +.transit-card { + border-radius: $radius; + box-shadow: 0 0 0 1px rgba($grey-dark, 0.3), $box-shadow-middle; + display: grid; + grid-template-columns: 0.45fr 2fr; + padding: $spacing-m; + + .transit-icon { + justify-self: center; + } + + .transit-action-description { + font-family: $family-sans; + font-size: $size-8; + color: $grey; + } + + .title { + color: $grey; + font-size: $size-7; + margin-bottom: $spacing-xxs; + } + + &:hover { + box-shadow: 0 0 0 1px $blue-500, $box-shadow-middle; + background: $blue-010; + + .title { + color: initial; + } + } +} diff --git a/ui/app/styles/core.scss b/ui/app/styles/core.scss index 15bafbc0c55b..9ae37b8119fb 100644 --- a/ui/app/styles/core.scss +++ b/ui/app/styles/core.scss @@ -88,6 +88,7 @@ @import './components/token-expire-warning'; @import './components/toolbar'; @import './components/tool-tip'; +@import './components/transit-card'; @import './components/unseal-warning'; @import './components/ui-wizard'; @import './components/vault-loading'; diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 0f0dedc9ee10..734c4ef479cf 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -68,22 +68,22 @@ {{#if (eq tab 'actions')}} -
    +
    {{#each model.supportedActions as |supportedAction|}} {{#linked-block "vault.cluster.secrets.backend.actions" model.id queryParams=(hash action=supportedAction.name) - class="selectable-card" + class="transit-card" }} -
    +
    -
    +

    {{capitalize supportedAction.name}}

    From 782f6452cdca5f07434ef6bc09e5e5457b9a1f79 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 15:45:38 -0600 Subject: [PATCH 20/39] add description and glyph for other key types --- ui/app/models/transit-key.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 6cd26fae9337..71e74e974707 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -24,14 +24,18 @@ const ACTION_VALUES = { isSupported: 'supportsEncryption', description: 'Rewraps the ciphertext using the latest version of the named key', }, - sign: { isSupported: 'supportsSigning' }, + sign: { + isSupported: 'supportsSigning', + description: 'Get the cryptographic signature of the given data', + glyph: 'edit', + }, hmac: { isSupported: true, description: 'Generate a data digest using a hash algorithm' }, verify: { isSupported: true, description: 'Validate the provided signature for the given data', glyph: 'check-circle-outline', }, - export: { isSupported: 'exportable' }, + export: { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, }; export default DS.Model.extend({ From 934a731242546bf18aed5106a26a0bfd95aa31e6 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 16:00:54 -0600 Subject: [PATCH 21/39] use human readable titles for key action names --- ui/app/models/transit-key.js | 4 ++-- .../transit-key-action/{datakey.hbs => data-key.hbs} | 0 .../transit-key-action/{export.hbs => export-key.hbs} | 0 ui/app/templates/partials/transit-form-show.hbs | 4 +++- .../vault/cluster/secrets/backend/transit-actions-layout.hbs | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) rename ui/app/templates/components/transit-key-action/{datakey.hbs => data-key.hbs} (100%) rename ui/app/templates/components/transit-key-action/{export.hbs => export-key.hbs} (100%) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 71e74e974707..0bb68b040095 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -16,7 +16,7 @@ const ACTION_VALUES = { isSupported: 'supportsDecryption', description: 'Decrypts the provided ciphertext using this key', }, - datakey: { + 'data-key': { isSupported: 'supportsEncryption', description: 'Generates a new key and value encrypted with this key', }, @@ -35,7 +35,7 @@ const ACTION_VALUES = { description: 'Validate the provided signature for the given data', glyph: 'check-circle-outline', }, - export: { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, + 'export-key': { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, }; export default DS.Model.extend({ diff --git a/ui/app/templates/components/transit-key-action/datakey.hbs b/ui/app/templates/components/transit-key-action/data-key.hbs similarity index 100% rename from ui/app/templates/components/transit-key-action/datakey.hbs rename to ui/app/templates/components/transit-key-action/data-key.hbs diff --git a/ui/app/templates/components/transit-key-action/export.hbs b/ui/app/templates/components/transit-key-action/export-key.hbs similarity index 100% rename from ui/app/templates/components/transit-key-action/export.hbs rename to ui/app/templates/components/transit-key-action/export-key.hbs diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 734c4ef479cf..785b8791fd90 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -8,6 +8,7 @@ replace=true queryParams=(query-params tab='actions') data-test-transit-link="actions" + data-test-transit-key-actions-link=true }} Key Actions {{/secret-link}} @@ -75,6 +76,7 @@ model.id queryParams=(hash action=supportedAction.name) class="transit-card" + data-test-transit-card=supportedAction.name }}

    - {{capitalize supportedAction.name}} + {{humanize supportedAction.name}}

    {{supportedAction.description}}

    diff --git a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs index e21adeb06510..6d351a8c16eb 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs @@ -38,7 +38,7 @@ queryParams=(query-params action=supportedAction.name) data-test-transit-action-link=supportedAction.name }} - {{capitalize supportedAction.name}} + {{humanize supportedAction.name}} {{/secret-link}} {{/each}} From f41bbeb2e77a46d5bcbac7346876fdb328669d03 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 16:06:41 -0600 Subject: [PATCH 22/39] update tests; still need to fix failing ones --- ui/tests/acceptance/transit-test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/tests/acceptance/transit-test.js b/ui/tests/acceptance/transit-test.js index 774d51318edd..82b8b5a1bac3 100644 --- a/ui/tests/acceptance/transit-test.js +++ b/ui/tests/acceptance/transit-test.js @@ -1,4 +1,4 @@ -import { click, fillIn, find, currentURL, settled, visit } from '@ember/test-helpers'; +import { click, fillIn, find, currentURL, settled, visit, pauseTest } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { encodeString } from 'vault/utils/b64'; @@ -264,9 +264,12 @@ module('Acceptance | transit', function(hooks) { await click('[data-test-transit-key-actions-link]'); await settled(); assert.ok( - currentURL().startsWith(`/vault/secrets/${path}/actions/${name}`), - `${name}: navigates to tranist actions` + currentURL().startsWith(`/vault/secrets/${path}/show/${name}?tab=actions`), + `${name}: navigates to transit actions` ); + await pauseTest(); + await click(`[data-test-transit-card="encrypt"]`); + await settled(); assert.ok( find('[data-test-transit-key-version-select]'), `${name}: the rotated key allows you to select versions` From 98fe2fa2d1caa234205279e210045dddcd3ea4e5 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 16:32:50 -0600 Subject: [PATCH 23/39] use datakey instead of data-key --- ui/app/models/transit-key.js | 2 +- .../components/transit-key-action/{data-key.hbs => datakey.hbs} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename ui/app/templates/components/transit-key-action/{data-key.hbs => datakey.hbs} (100%) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 0bb68b040095..048d93bdbe32 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -16,7 +16,7 @@ const ACTION_VALUES = { isSupported: 'supportsDecryption', description: 'Decrypts the provided ciphertext using this key', }, - 'data-key': { + datakey: { isSupported: 'supportsEncryption', description: 'Generates a new key and value encrypted with this key', }, diff --git a/ui/app/templates/components/transit-key-action/data-key.hbs b/ui/app/templates/components/transit-key-action/datakey.hbs similarity index 100% rename from ui/app/templates/components/transit-key-action/data-key.hbs rename to ui/app/templates/components/transit-key-action/datakey.hbs From 83e92f37937e91a099079684fa50f71f71589801 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 16:50:10 -0600 Subject: [PATCH 24/39] fix some failing tests --- ui/tests/acceptance/transit-test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/tests/acceptance/transit-test.js b/ui/tests/acceptance/transit-test.js index 82b8b5a1bac3..ca091b99b516 100644 --- a/ui/tests/acceptance/transit-test.js +++ b/ui/tests/acceptance/transit-test.js @@ -267,8 +267,8 @@ module('Acceptance | transit', function(hooks) { currentURL().startsWith(`/vault/secrets/${path}/show/${name}?tab=actions`), `${name}: navigates to transit actions` ); - await pauseTest(); - await click(`[data-test-transit-card="encrypt"]`); + const keyAction = key.supportsEncryption ? 'encrypt' : 'sign'; + await click(`[data-test-transit-card=${keyAction}]`); await settled(); assert.ok( find('[data-test-transit-key-version-select]'), @@ -276,12 +276,12 @@ module('Acceptance | transit', function(hooks) { ); if (key.exportable) { assert.ok( - find('[data-test-transit-action-link="export"]'), + find('[data-test-transit-action-link="export-key"]'), `${name}: exportable key has a link to export action` ); } else { assert - .dom('[data-test-transit-action-link="export"]') + .dom('[data-test-transit-action-link="export-key"]') .doesNotExist(`${name}: non-exportable key does not link to export action`); } if (key.convergent && key.supportsEncryption) { From 2a27da4f544923fc46dbe6992ceade631bb6f05f Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 10 Feb 2020 17:05:42 -0600 Subject: [PATCH 25/39] fix more tests --- ui/tests/unit/models/transit-key-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/tests/unit/models/transit-key-test.js b/ui/tests/unit/models/transit-key-test.js index 3917bb8ee498..a7559ca7fe1c 100644 --- a/ui/tests/unit/models/transit-key-test.js +++ b/ui/tests/unit/models/transit-key-test.js @@ -19,7 +19,7 @@ module('Unit | Model | transit key', function(hooks) { }) ); - let supportedActions = model.get('supportedActions'); + let supportedActions = model.get('supportedActions').map(k => k.name); assert.deepEqual(['encrypt', 'decrypt', 'datakey', 'rewrap', 'hmac', 'verify'], supportedActions); }); From 82b041ff3951a0dbff11b620f8077312920e5250 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 11 Feb 2020 10:47:07 -0600 Subject: [PATCH 26/39] remove extra chevron from rotate button --- ui/app/templates/components/transit-key-actions.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/templates/components/transit-key-actions.hbs b/ui/app/templates/components/transit-key-actions.hbs index 3ab25a7221a8..c9833edcc950 100644 --- a/ui/app/templates/components/transit-key-actions.hbs +++ b/ui/app/templates/components/transit-key-actions.hbs @@ -9,7 +9,6 @@ data-test-transit-key-rotate="true" > Rotate encryption key - {{/if}} {{else}} From b0d903fe7e8bdbee12a34e4850927e356fb17a37 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 11 Feb 2020 11:03:48 -0600 Subject: [PATCH 27/39] remove whitespace --- ui/app/templates/components/transit-edit.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/app/templates/components/transit-edit.hbs b/ui/app/templates/components/transit-edit.hbs index f4457a3cabbf..43d46153b456 100644 --- a/ui/app/templates/components/transit-edit.hbs +++ b/ui/app/templates/components/transit-edit.hbs @@ -20,5 +20,4 @@

    - {{partial (concat 'partials/transit-form-' mode)}} From 0ae873c9c350648006a3995b4cde72786c1ba5dd Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 11 Feb 2020 11:06:15 -0600 Subject: [PATCH 28/39] remove pauseTest --- ui/tests/acceptance/transit-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/tests/acceptance/transit-test.js b/ui/tests/acceptance/transit-test.js index ca091b99b516..785228288e77 100644 --- a/ui/tests/acceptance/transit-test.js +++ b/ui/tests/acceptance/transit-test.js @@ -1,4 +1,4 @@ -import { click, fillIn, find, currentURL, settled, visit, pauseTest } from '@ember/test-helpers'; +import { click, fillIn, find, currentURL, settled, visit } from '@ember/test-helpers'; import { module, test } from 'qunit'; import { setupApplicationTest } from 'ember-qunit'; import { encodeString } from 'vault/utils/b64'; From 2a45547232805808d134f30fec2c72d5be7bdc06 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 11 Feb 2020 11:14:36 -0600 Subject: [PATCH 29/39] use rename export to export key in the template instead of the model --- ui/app/models/transit-key.js | 2 +- .../transit-key-action/{export-key.hbs => export.hbs} | 0 ui/app/templates/partials/transit-form-show.hbs | 2 +- .../vault/cluster/secrets/backend/transit-actions-layout.hbs | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename ui/app/templates/components/transit-key-action/{export-key.hbs => export.hbs} (100%) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 048d93bdbe32..71e74e974707 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -35,7 +35,7 @@ const ACTION_VALUES = { description: 'Validate the provided signature for the given data', glyph: 'check-circle-outline', }, - 'export-key': { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, + export: { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, }; export default DS.Model.extend({ diff --git a/ui/app/templates/components/transit-key-action/export-key.hbs b/ui/app/templates/components/transit-key-action/export.hbs similarity index 100% rename from ui/app/templates/components/transit-key-action/export-key.hbs rename to ui/app/templates/components/transit-key-action/export.hbs diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 785b8791fd90..231b1fe12a34 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -87,7 +87,7 @@

    - {{humanize supportedAction.name}} + {{if (eq supportedAction.name 'export') 'Export Key' (humanize supportedAction.name)}}

    {{supportedAction.description}}

    diff --git a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs index 6d351a8c16eb..8cb8afa0a103 100644 --- a/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs +++ b/ui/app/templates/vault/cluster/secrets/backend/transit-actions-layout.hbs @@ -38,7 +38,7 @@ queryParams=(query-params action=supportedAction.name) data-test-transit-action-link=supportedAction.name }} - {{humanize supportedAction.name}} + {{if (eq supportedAction.name 'export') 'Export Key' (humanize supportedAction.name)}} {{/secret-link}} {{/each}} From db039ce058072070a98463ec5e17d49a8ea79cc3 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 11 Feb 2020 11:20:54 -0600 Subject: [PATCH 30/39] fix last few failing tests --- ui/app/templates/partials/transit-form-show.hbs | 1 - ui/tests/acceptance/transit-test.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 231b1fe12a34..2a79ac09052e 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -7,7 +7,6 @@ mode="show" replace=true queryParams=(query-params tab='actions') - data-test-transit-link="actions" data-test-transit-key-actions-link=true }} Key Actions diff --git a/ui/tests/acceptance/transit-test.js b/ui/tests/acceptance/transit-test.js index 785228288e77..3e2a7214d439 100644 --- a/ui/tests/acceptance/transit-test.js +++ b/ui/tests/acceptance/transit-test.js @@ -276,12 +276,12 @@ module('Acceptance | transit', function(hooks) { ); if (key.exportable) { assert.ok( - find('[data-test-transit-action-link="export-key"]'), + find('[data-test-transit-action-link="export"]'), `${name}: exportable key has a link to export action` ); } else { assert - .dom('[data-test-transit-action-link="export-key"]') + .dom('[data-test-transit-action-link="export"]') .doesNotExist(`${name}: non-exportable key does not link to export action`); } if (key.convergent && key.supportsEncryption) { From a217aededa7464340a9fc59680dd2741b13504bf Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Tue, 11 Feb 2020 17:18:00 -0600 Subject: [PATCH 31/39] WIP --- ui/app/macros/lazy-capabilities.js | 2 +- ui/app/models/transit-key.js | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/app/macros/lazy-capabilities.js b/ui/app/macros/lazy-capabilities.js index 2169d61ef2c8..a20fb88ea1e5 100644 --- a/ui/app/macros/lazy-capabilities.js +++ b/ui/app/macros/lazy-capabilities.js @@ -4,7 +4,7 @@ // // export default DS.Model.extend({ // //pass the template string as the first arg, and be sure to use '' around the -// //paramerters that get interpolated in the string - that's how the template function +// //parameters that get interpolated in the string - that's how the template function // //knows where to put each value // zeroAddressPath: lazyCapabilities(apiPath`${'id'}/config/zeroaddress`, 'id'), // diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 71e74e974707..46d6ae536475 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -3,6 +3,7 @@ import { set, get, computed } from '@ember/object'; import DS from 'ember-data'; import clamp from 'vault/utils/clamp'; import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; +import attachCapabilities from 'vault/lib/attach-capabilities'; const { attr } = DS; @@ -38,7 +39,7 @@ const ACTION_VALUES = { export: { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, }; -export default DS.Model.extend({ +let Model = DS.Model.extend({ type: attr('string', { defaultValue: 'aes256-gcm96', }), @@ -143,9 +144,7 @@ export default DS.Model.extend({ return types; }), - backend: attr('string', { - readOnly: true, - }), + backend: attr('string'), rotatePath: lazyCapabilities(apiPath`${'backend'}/keys/${'id'}/rotate`, 'backend', 'id'), canRotate: alias('rotatePath.canUpdate'), From d80dd48fca2ed9d50d6c7a27bae209419973c747 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Wed, 12 Feb 2020 17:01:16 -0600 Subject: [PATCH 32/39] link to key actions page by default --- ui/app/templates/partials/secret-list/item.hbs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/app/templates/partials/secret-list/item.hbs b/ui/app/templates/partials/secret-list/item.hbs index d34033c0b441..42fb002d1e4a 100644 --- a/ui/app/templates/partials/secret-list/item.hbs +++ b/ui/app/templates/partials/secret-list/item.hbs @@ -8,12 +8,14 @@ class="list-item-row" data-test-secret-link=item.id encode=true + queryParams=(hash tab='actions') }}
    {{if (eq item.id ' ') '(self)' (or item.keyWithoutParent item.id)}} From 940fa0955e90f0b8997c5b4333d70c14c43b03cc Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Thu, 13 Feb 2020 12:25:53 -0600 Subject: [PATCH 33/39] test for transit action title --- ui/app/templates/partials/transit-form-show.hbs | 2 +- ui/tests/acceptance/transit-test.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/app/templates/partials/transit-form-show.hbs b/ui/app/templates/partials/transit-form-show.hbs index 2a79ac09052e..70f5e535bdbc 100644 --- a/ui/app/templates/partials/transit-form-show.hbs +++ b/ui/app/templates/partials/transit-form-show.hbs @@ -85,7 +85,7 @@ aria-label={{concat backend.path " options"}} />
    -

    +

    {{if (eq supportedAction.name 'export') 'Export Key' (humanize supportedAction.name)}}

    {{supportedAction.description}}

    diff --git a/ui/tests/acceptance/transit-test.js b/ui/tests/acceptance/transit-test.js index 3e2a7214d439..5e53d6aa265e 100644 --- a/ui/tests/acceptance/transit-test.js +++ b/ui/tests/acceptance/transit-test.js @@ -267,7 +267,16 @@ module('Acceptance | transit', function(hooks) { currentURL().startsWith(`/vault/secrets/${path}/show/${name}?tab=actions`), `${name}: navigates to transit actions` ); + const keyAction = key.supportsEncryption ? 'encrypt' : 'sign'; + const actionTitle = find(`[data-test-transit-action-title=${keyAction}]`).innerText.toLowerCase(); + + assert.equal( + actionTitle.includes(keyAction), + true, + `shows a card with title that links to the ${name} transit action` + ); + await click(`[data-test-transit-card=${keyAction}]`); await settled(); assert.ok( From c51eb2278befb75639f966dd281339d68fc25499 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Thu, 13 Feb 2020 13:33:48 -0600 Subject: [PATCH 34/39] only add query params when viewing a transit secret --- ui/app/helpers/secret-query-params.js | 10 ++++++++++ ui/app/templates/partials/secret-list/item.hbs | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ui/app/helpers/secret-query-params.js diff --git a/ui/app/helpers/secret-query-params.js b/ui/app/helpers/secret-query-params.js new file mode 100644 index 000000000000..483700274bd3 --- /dev/null +++ b/ui/app/helpers/secret-query-params.js @@ -0,0 +1,10 @@ +import { helper } from '@ember/component/helper'; + +export function secretQueryParams([backendType]) { + if (backendType === 'transit') { + return { tab: 'actions' }; + } + return; +} + +export default helper(secretQueryParams); diff --git a/ui/app/templates/partials/secret-list/item.hbs b/ui/app/templates/partials/secret-list/item.hbs index 42fb002d1e4a..149986d9d254 100644 --- a/ui/app/templates/partials/secret-list/item.hbs +++ b/ui/app/templates/partials/secret-list/item.hbs @@ -1,3 +1,5 @@ + + {{#linked-block (concat "vault.cluster.secrets.backend." @@ -8,7 +10,7 @@ class="list-item-row" data-test-secret-link=item.id encode=true - queryParams=(hash tab='actions') + queryParams=(hash (secret-query-params backendModel.type)) }}
    From d4df3432aefad21ee2fc907c5231122d71385be6 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Thu, 13 Feb 2020 13:54:46 -0600 Subject: [PATCH 35/39] update structure icons --- ui/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/yarn.lock b/ui/yarn.lock index 270f88908116..674caed8d1fa 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -1082,9 +1082,9 @@ "@glimmer/util" "^0.41.4" "@hashicorp/structure-icons@^1.3.0": - version "1.3.0" - resolved "https://registry.yarnpkg.com/@hashicorp/structure-icons/-/structure-icons-1.3.0.tgz#1c7c1cb43a1c1aa92b073a7aa7956495ae14c3e0" - integrity sha512-wTKpdaAPphEY2kg5QbQTSUlhqLTpBBR1+1dXp4LYTN0PtMSpetyDDDhcSyvKE8i4h2nwPJBRRfeFlE1snaHd7w== + version "1.8.1" + resolved "https://registry.yarnpkg.com/@hashicorp/structure-icons/-/structure-icons-1.8.1.tgz#d29945df2b41dcb317b141e51a26bd4be796a164" + integrity sha512-XFYdCIshmaR3Igc8eWpOZ2Gr3IR/0TogXZ4PQ9bz1E9cLzF3njBcs3tCpJUOwRwe/wMI5YTlL/sOGvcZ77AB/Q== "@icons/material@^0.2.4": version "0.2.4" From 4e145b95314c66cd6af0161916538f7dab1bb3d7 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Thu, 13 Feb 2020 14:07:13 -0600 Subject: [PATCH 36/39] add missing structure icons --- ui/app/models/transit-key.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 46d6ae536475..add62cff1d7a 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -16,21 +16,24 @@ const ACTION_VALUES = { decrypt: { isSupported: 'supportsDecryption', description: 'Decrypts the provided ciphertext using this key', + glyph: 'envelope-unsealed--outline', }, datakey: { isSupported: 'supportsEncryption', description: 'Generates a new key and value encrypted with this key', + glyph: 'key', }, rewrap: { isSupported: 'supportsEncryption', description: 'Rewraps the ciphertext using the latest version of the named key', + glyph: 'refresh-default', }, sign: { isSupported: 'supportsSigning', description: 'Get the cryptographic signature of the given data', glyph: 'edit', }, - hmac: { isSupported: true, description: 'Generate a data digest using a hash algorithm' }, + hmac: { isSupported: true, description: 'Generate a data digest using a hash algorithm', glyph: 'remix' }, verify: { isSupported: true, description: 'Validate the provided signature for the given data', From 25978cbc8532d37551f6296a038bc80e08c21d2c Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Thu, 13 Feb 2020 14:34:05 -0600 Subject: [PATCH 37/39] resolve merge conflicts from rebase --- ui/app/models/transit-key.js | 3 +-- ui/app/templates/partials/secret-list/item.hbs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index add62cff1d7a..38ff5eb0188b 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -3,7 +3,6 @@ import { set, get, computed } from '@ember/object'; import DS from 'ember-data'; import clamp from 'vault/utils/clamp'; import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities'; -import attachCapabilities from 'vault/lib/attach-capabilities'; const { attr } = DS; @@ -42,7 +41,7 @@ const ACTION_VALUES = { export: { isSupported: 'exportable', description: 'Get the named key', glyph: 'exit' }, }; -let Model = DS.Model.extend({ +export default DS.Model.extend({ type: attr('string', { defaultValue: 'aes256-gcm96', }), diff --git a/ui/app/templates/partials/secret-list/item.hbs b/ui/app/templates/partials/secret-list/item.hbs index 149986d9d254..732069215a6c 100644 --- a/ui/app/templates/partials/secret-list/item.hbs +++ b/ui/app/templates/partials/secret-list/item.hbs @@ -10,7 +10,7 @@ class="list-item-row" data-test-secret-link=item.id encode=true - queryParams=(hash (secret-query-params backendModel.type)) + queryParams=(secret-query-params backendModel.type) }}
    From af5287abb955b3d8e7a8cb332a69dc18e23fd102 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Fri, 14 Feb 2020 10:25:13 -0600 Subject: [PATCH 38/39] use filter and map for supported actions --- ui/app/models/transit-key.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/ui/app/models/transit-key.js b/ui/app/models/transit-key.js index 38ff5eb0188b..c3797b5932ee 100644 --- a/ui/app/models/transit-key.js +++ b/ui/app/models/transit-key.js @@ -80,19 +80,15 @@ export default DS.Model.extend({ }, supportedActions: computed('type', function() { - let actions = []; - Object.keys(ACTION_VALUES).filter(name => { - const keyAction = ACTION_VALUES[name]; - const isSupported = keyAction.isSupported; - if (typeof isSupported === 'boolean' || get(this, isSupported)) { - return actions.push({ - name, - description: keyAction.description, - glyph: keyAction.glyph, - }); - } - }); - return actions; + return Object.keys(ACTION_VALUES) + .filter(name => { + const { isSupported } = ACTION_VALUES[name]; + return typeof isSupported === 'boolean' || get(this, isSupported); + }) + .map(name => { + const { description, glyph } = ACTION_VALUES[name]; + return { name, description, glyph }; + }); }), canDelete: computed('deletionAllowed', 'lastLoadTS', function() { From 06555d00b8c55bf3f48be7a33b21dc2fe56552f4 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Fri, 14 Feb 2020 10:32:39 -0600 Subject: [PATCH 39/39] only add query params for transit secrets --- ui/app/templates/partials/secret-list/item.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/app/templates/partials/secret-list/item.hbs b/ui/app/templates/partials/secret-list/item.hbs index 732069215a6c..dd423a242a75 100644 --- a/ui/app/templates/partials/secret-list/item.hbs +++ b/ui/app/templates/partials/secret-list/item.hbs @@ -17,7 +17,7 @@ {{if (eq item.id ' ') '(self)' (or item.keyWithoutParent item.id)}}