open-vault/ui/app/templates/components/secret-list/item.hbs
Jordan Reimer 3172e74d7e
Key Management Secrets Engine Phase 1 (#15036)
* KMSE: Key Model / Adapter / Serializer setup (#13638)

* First pass model

* KMS key adapter (create/update), serializer, model

* Add last rotated and provider to key

* KeyEdit secret-edit component, and more key model stuff

* add formatDate param support to infotablerow

* Add keymgmt key to routes and options-for-backend

* Rename keymgmt-key to keymgmt/key

* Add test, cleanup

* Add mirage handler for kms

* Address PR comments

* KMS Providers (#13797)

* adds pagination-controls component

* adds kms provider model, adapter and serializer

* adds kms provider-edit component

* updates secrets routes to handle itemType query param for kms

* updates kms key adapter to query by provider

* adds tests for provider-edit component

* refactors kms provider adapter to account for dynamic path

* adds model-validations-helper util

* removes keymgmt from supported-secret-backends

* fixes issue generating url for fetching keys for a provider

* updates modelType method on secret-edit route to accept options object as arg rather than transition

* adds additional checks to ensure queryParams are defined in options object for modelType method

* UI/keymgmt distribute key (#13840)

* Add distribution details on key page, and empty states if no permissions

* Allow search-select component to return object so parent can tell when new item was created

* Add stringarray transform

* Distribute component first pass

* Refactor distribute component for use with internal object rather than ember-data model

* Specific permission denied errors on key edit

* Allow inline errors on search-select component

* Style updates for form errors

* Styling and error messages on distribute component

* Allow block template on inline alert so we can add doc links

* Add distribute action, flash messages, cleanup

* Cleanup & Add tests

* More cleanup

* Address PR comments

* Move disable operations logic to commponent class

* KMSE Enable/Config (#14835)

* adds keymgmt secrets engine as supported backend

* adds comment to check on keymgmt as member of adp module

* updates kms provider to use model-validations decorator

* fixes lint errors and tests

Co-authored-by: Chelsea Shaw <82459713+hashishaw@users.noreply.github.com>
2022-04-20 12:40:27 -06:00

83 lines
3.4 KiB
Handlebars

<LinkedBlock
@params={{array
(concat "vault.cluster.secrets.backend." (if @item.isFolder "list" "show") (unless @item.id "-root"))
@item.id
}}
class="list-item-row"
data-test-secret-link={{@item.id}}
@encode={{true}}
@queryParams={{secret-query-params @backendModel.type @item.type}}
>
<div class="columns is-mobile">
<div class="column is-10">
<SecretLink
@mode={{if @item.isFolder "list" "show"}}
@secret={{@item.id}}
@queryParams={{secret-query-params @backendModel.type @item.type asQueryParams=true}}
class="has-text-black has-text-weight-semibold"
>
{{#if (eq @backendModel.type "transit")}}
<Icon @name="key" class="has-text-grey-light" />
{{else}}
<Icon @name={{if @item.isFolder "folder" (or @item.icon "file")}} class="has-text-grey-light" />
{{/if}}
{{if (eq @item.id " ") "(self)" (or @item.keyWithoutParent @item.id)}}
</SecretLink>
</div>
<div class="column has-text-right">
<PopupMenu name="secret-menu">
<Confirm as |c|>
<nav class="menu">
<ul class="menu-list">
{{#if @item.isFolder}}
<SecretLink @mode="list" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Contents
</SecretLink>
{{else}}
{{#if (or @item.versionPath.isLoading @item.secretPath.isLoading)}}
<li class="action">
<button disabled type="button" class="link button is-loading is-transparent">
loading
</button>
</li>
{{else}}
{{#if (or @item.canReadSecretData @item.canRead)}}
<li class="action">
<SecretLink @mode="show" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
Details
</SecretLink>
</li>
{{#if @backendModel.isV2KV}}
<li class="action">
<SecretLink @mode="versions" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
View version history
</SecretLink>
</li>
{{/if}}
{{/if}}
{{#if (or @item.canEditSecretData @item.canEdit)}}
<li class="action">
<SecretLink @mode="edit" @secret={{@item.id}} class="has-text-black has-text-weight-semibold">
{{if @backendModel.isV2KV "Create new version" "Edit"}}
</SecretLink>
</li>
{{/if}}
{{#if (or @item.canDeleteSecretData @item.canDelete)}}
<li class="action">
<c.Message
@id={{@item.id}}
@triggerText={{if @backendModel.isV2KV "Permanently delete" "Delete"}}
@message="This will permanently delete this secret and all its versions."
@onConfirm={{@delete}}
/>
</li>
{{/if}}
{{/if}}
{{/if}}
</ul>
</nav>
</Confirm>
</PopupMenu>
</div>
</div>
</LinkedBlock>