2021-06-04 19:10:07 +00:00
|
|
|
<form onsubmit={{@createOrUpdateKey}}>
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
2021-06-04 19:10:07 +00:00
|
|
|
<MessageError @model={{@key}} />
|
2018-08-16 17:48:24 +00:00
|
|
|
<NamespaceReminder @mode="edit" @noun="transit key" />
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="field">
|
|
|
|
<div class="b-checkbox">
|
|
|
|
<input
|
|
|
|
id="key-allows-delete"
|
|
|
|
type="checkbox"
|
2021-06-04 19:10:07 +00:00
|
|
|
checked={{@key.deletionAllowed}}
|
2018-04-03 14:16:57 +00:00
|
|
|
class="styled"
|
2021-06-04 19:10:07 +00:00
|
|
|
onchange={{@setValueOnKey}}
|
2018-04-03 14:16:57 +00:00
|
|
|
/>
|
|
|
|
<label for="key-allows-delete" class="is-label">
|
|
|
|
Allow deletion
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-02-09 16:56:49 +00:00
|
|
|
<div class="field">
|
|
|
|
<TtlPicker2
|
2022-02-17 20:17:59 +00:00
|
|
|
@initialValue={{or @key.autoRotatePeriod "1h"}}
|
|
|
|
@initialEnabled={{not (eq @key.autoRotatePeriod "0s")}}
|
|
|
|
@label="Auto-rotation period"
|
2022-02-09 16:56:49 +00:00
|
|
|
@helperTextDisabled="Key will never be automatically rotated"
|
|
|
|
@helperTextEnabled="Key will be automatically rotated every"
|
|
|
|
@onChange={{@handleAutoRotateChange}}
|
|
|
|
@errorMessage={{if @autoRotateInvalid "Duration must be longer than 1 hour"}}
|
|
|
|
/>
|
|
|
|
</div>
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="field">
|
2021-12-17 03:44:29 +00:00
|
|
|
<label for="key-min-decrypt-version" class="is-label">Minimum decryption version</label>
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="control is-expanded">
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
<select
|
2021-12-17 03:44:29 +00:00
|
|
|
name="key-min-decrypt-version"
|
|
|
|
id="key-min-decrypt-version"
|
2021-06-04 19:10:07 +00:00
|
|
|
onchange={{action (mut @key.minDecryptionVersion) value="target.value"}}
|
2018-04-03 14:16:57 +00:00
|
|
|
>
|
2021-06-04 19:10:07 +00:00
|
|
|
{{#each @key.keyVersions as |version|}}
|
|
|
|
<option selected={{eq @key.minDecryptionVersion version}} value={{version}}>
|
2018-04-03 14:16:57 +00:00
|
|
|
<code>{{version}}</code>
|
|
|
|
</option>
|
|
|
|
{{/each}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p class="help">
|
2021-12-17 03:44:29 +00:00
|
|
|
The minimum decryption version required to reverse transformations performed with the encryption key. Results from
|
|
|
|
lower key versions may be rewrapped with the new key version using the
|
|
|
|
<code>rewrap</code>
|
|
|
|
action.
|
2018-04-03 14:16:57 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-12-17 03:44:29 +00:00
|
|
|
<label for="key-min-encrypt-version" class="is-label">Minimum encryption version</label>
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="control is-expanded">
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
<select
|
2021-12-17 03:44:29 +00:00
|
|
|
name="key-min-encrypt-version"
|
|
|
|
id="key-min-encrypt-version"
|
2021-06-04 19:10:07 +00:00
|
|
|
onchange={{action (mut @key.minEncryptionVersion) value="target.value"}}
|
2018-04-03 14:16:57 +00:00
|
|
|
>
|
2021-12-17 03:44:29 +00:00
|
|
|
<option selected={{eq @key.minEncryptionVersion 0}} value={{0}}>
|
|
|
|
<code>Latest</code>
|
|
|
|
(currently
|
|
|
|
{{@key.latestVersion}})
|
2018-04-03 14:16:57 +00:00
|
|
|
</option>
|
2021-06-04 19:10:07 +00:00
|
|
|
{{#each @key.encryptionKeyVersions as |version|}}
|
|
|
|
<option selected={{eq @key.minEncryptionVersion version}} value={{version}}>
|
2018-04-03 14:16:57 +00:00
|
|
|
<code>{{version}}</code>
|
|
|
|
</option>
|
|
|
|
{{/each}}
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p class="help">
|
2021-12-17 03:44:29 +00:00
|
|
|
The minimum version of the key that can be used to encrypt plaintext, sign payloads, or generate HMACs. You will be
|
|
|
|
able to specify which version of the key to use for each of these actions. The value specified here must be greater
|
|
|
|
than or equal to that specified in the
|
|
|
|
<b>Minimum Decryption Version</b>
|
|
|
|
selection above.
|
2018-04-03 14:16:57 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-12-17 03:44:29 +00:00
|
|
|
<div class="field is-grouped is-grouped-split box is-fullwidth is-bottomless">
|
|
|
|
<div class="field is-grouped">
|
|
|
|
{{#if @capabilities.canUpdate}}
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="control">
|
2021-12-17 03:44:29 +00:00
|
|
|
<button type="submit" disabled={{@requestInFlight}} class="button is-primary {{if @requestInFlight "is-loading"}}">
|
|
|
|
Update transit key
|
|
|
|
</button>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<div class="control">
|
|
|
|
<SecretLink @mode="show" @secret={{@key.id}} @class="button">
|
|
|
|
Cancel
|
|
|
|
</SecretLink>
|
|
|
|
</div>
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (and @key.canDelete @capabilities.canDelete)}}
|
|
|
|
<ConfirmAction @buttonClasses="button" @onConfirmAction={{@deleteKey}}>
|
|
|
|
Delete transit key
|
|
|
|
</ConfirmAction>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|