open-vault/ui/app/templates/components/configure-aws-secret.hbs
Jordan Reimer 5c2a08de6d
Ember Upgrade to 3.24 (#13443)
* Update browserslist

* Add browserslistrc

* ember-cli-update --to 3.26, fix conflicts

* Run codemodes that start with ember-*

* More codemods - before cp*

* More codemods (curly data-test-*)

* WIP ember-basic-dropdown template errors

* updates ember-basic-dropdown and related deps to fix build issues

* updates basic dropdown instances to new version API

* updates more deps -- ember-template-lint is working again

* runs no-implicit-this codemod

* creates and runs no-quoteless-attributes codemod

* runs angle brackets codemod

* updates lint:hbs globs to only touch hbs files

* removes yield only templates

* creates and runs deprecated args transform

* supresses lint error for invokeAction on LinkTo component

* resolves remaining ambiguous path lint errors

* resolves simple-unless lint errors

* adds warnings for deprecated tagName arg on LinkTo components

* adds warnings for remaining curly component invocation

* updates global template lint rules

* resolves remaining template lint errors

* disables some ember specfic lint rules that target pre octane patterns

* js lint fix run

* resolves remaining js lint errors

* fixes test run

* adds npm-run-all dep

* fixes test attribute issues

* fixes console acceptance tests

* fixes tests

* adds yield only wizard/tutorial-active template

* fixes more tests

* attempts to fix more flaky tests

* removes commented out settled in transit test

* updates deprecations workflow and adds initializer to filter by version

* updates flaky policies acl old test

* updates to flaky transit test

* bumps ember deps down to LTS version

* runs linters after main merge

* fixes client count tests after bad merge conflict fixes

* fixes client count history test

* more updates to lint config

* another round of hbs lint fixes after extending stylistic rule

* updates lint-staged commands

* removes indent eslint rule since it seems to break things

* fixes bad attribute in transform-edit-form template

* test fixes

* fixes enterprise tests

* adds changelog

* removes deprecated ember-concurrency-test-waiters dep and adds @ember/test-waiters

* flaky test fix

Co-authored-by: hashishaw <cshaw@hashicorp.com>
2021-12-16 20:44:29 -07:00

155 lines
4.9 KiB
Handlebars

<div class="tabs-container box is-sideless is-fullwidth is-paddingless is-marginless">
<nav class="tabs">
<ul>
{{! template-lint-configure no-unknown-arguments-for-builtin-components "warn" }}
<LinkTo
@route="vault.cluster.settings.configure-secret-backend"
@model={{@model.id}}
@query={{hash tab=""}}
@tagName="li"
>
<LinkTo
@route="vault.cluster.settings.configure-secret-backend"
@model={{@model.id}}
@query={{hash tab=""}}
data-test-aws-link="root-creds"
>
Dynamic IAM root credentials
</LinkTo>
</LinkTo>
<LinkTo
@route="vault.cluster.settings.configure-secret-backend"
@model={{@model.id}}
@query={{hash tab="leases"}}
@tagName="li"
>
<LinkTo
@route="vault.cluster.settings.configure-secret-backend"
@model={{@model.id}}
@query={{hash tab="leases"}}
data-test-aws-link="leases"
>
Leases
</LinkTo>
</LinkTo>
{{! template-lint-configure no-unknown-arguments-for-builtin-components "on" }}
</ul>
</nav>
</div>
{{#if (eq @tab "leases")}}
<form onsubmit={{action "saveLease" (hash lease=@model.lease lease_max=@model.leaseMax)}} data-test-aws-leases-form="true">
<div class="box is-fullwidth is-shadowless is-marginless">
<NamespaceReminder @mode="saved" @noun="configuration" />
<MessageError @model={{@model}} />
<p class="has-text-grey-dark">
If you do not supply lease settings, we will use the default values in AWS.
</p>
</div>
<TtlPicker @labelText="Lease" @initialValue={{@model.lease}} @onChange={{action (mut @model.lease)}} />
<TtlPicker @labelText="Maximum Lease" @initialValue={{@model.leaseMax}} @onChange={{action (mut @model.leaseMax)}} />
<div class="box is-bottomless is-fullwidth">
<button data-test-aws-input="lease-save" type="submit" class="button is-primary">
Save
</button>
</div>
</form>
{{else}}
<form
onsubmit={{action
"saveRootCreds"
(hash access_key=@accessKey iam_endpoint=@iamEndpoint sts_endpoint=@stsEndpoint secret_key=@secretKey region=@region)
}}
data-test-aws-root-creds-form="true"
>
<div class="box is-fullwidth is-shadowless is-marginless">
<NamespaceReminder @mode="save" @noun="configuration" />
<p class="has-text-grey-dark">
Note: the client uses the official AWS SDK and will use the specified credentials, environment credentials, shared
file credentials, or IAM role/ECS task credentials in that order.
</p>
</div>
<div class="field">
<label for="access" class="is-label">
Access key
</label>
<div class="control">
<Input
@type="text"
id="access"
name="access"
class="input"
autocomplete="off"
spellcheck="false"
@value={{@accessKey}}
data-test-aws-input="accessKey"
/>
</div>
</div>
<div class="field">
<label for="secret" class="is-label">
Secret key
</label>
<div class="control">
<Input
@type="password"
id="secret"
name="secret"
class="input"
@value={{@secretKey}}
data-test-aws-input="secretKey"
/>
</div>
</div>
<ToggleButton @toggleAttr="showOptions" @toggleTarget={{this}} @openLabel="Hide options" @closedLabel="More options" />
{{#if this.showOptions}}
<div class="box is-marginless">
<div class="field">
<label for="region" class="is-label">
Region
</label>
<div class="control is-expanded">
<div class="select is-fullwidth">
<select
name="region"
id="region"
onchange={{action (mut @region) value="target.value"}}
data-test-input="region"
>
<option value=""></option>
{{#each (aws-regions) as |val|}}
<option>{{val}}</option>
{{/each}}
</select>
</div>
</div>
</div>
<div class="field">
<label for="iam" class="is-label">
IAM endpoint
</label>
<div class="control">
<Input @type="text" id="iam" name="iam" class="input" @value={{@iamEndpoint}} />
</div>
</div>
<div class="field">
<label for="sts" class="is-label">
STS endpoint
</label>
<div class="control">
<Input @type="text" id="sts" name="sts" class="input" @value={{@stsEndpoint}} />
</div>
</div>
</div>
{{/if}}
<div class="box is-bottomless is-fullwidth">
<button data-test-aws-input="root-save" type="submit" class="button is-primary">
Save
</button>
</div>
</form>
{{/if}}