2018-08-16 17:48:24 +00:00
|
|
|
<div class="auth-form">
|
|
|
|
{{#if showLoading}}
|
|
|
|
<div class="vault-loader">
|
|
|
|
{{partial 'svg/vault-loading'}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2019-02-14 15:39:19 +00:00
|
|
|
{{#if hasMethodsWithPath}}
|
2019-05-09 16:07:13 +00:00
|
|
|
<nav class="tabs is-marginless">
|
|
|
|
<ul>
|
|
|
|
{{#each methodsToShow as |method|}}
|
|
|
|
{{#with (or method.path method.type) as |methodKey|}}
|
|
|
|
<li class="{{if (and selectedAuthIsPath (eq (or selectedAuthBackend.path selectedAuthBackend.type) methodKey)) 'is-active' ''}}" data-test-auth-method>
|
|
|
|
{{#link-to 'vault.cluster.auth' cluster.name (query-params with=methodKey) data-test-auth-method-link=method.type}}
|
|
|
|
{{or method.id (capitalize method.type)}}
|
|
|
|
{{/link-to}}
|
|
|
|
</li>
|
|
|
|
{{/with}}
|
|
|
|
{{/each}}
|
|
|
|
{{#if hasMethodsWithPath}}
|
|
|
|
<li class="{{if (not selectedAuthIsPath) 'is-active' ''}}" data-test-auth-method>
|
|
|
|
{{#link-to 'vault.cluster.auth' cluster.name (query-params with='token') data-test-auth-method-link="other"}}
|
|
|
|
Other
|
|
|
|
{{/link-to}}
|
|
|
|
</li>
|
|
|
|
{{/if}}
|
|
|
|
</ul>
|
|
|
|
</nav>
|
2019-02-14 15:39:19 +00:00
|
|
|
{{/if}}
|
|
|
|
<div class="box is-marginless is-shadowless">
|
|
|
|
<MessageError
|
|
|
|
@errorMessage={{if (and cluster.standby hasCSPError) cspErrorText error}}
|
|
|
|
data-test-auth-error
|
|
|
|
/>
|
|
|
|
{{#if (or (not hasMethodsWithPath) (not selectedAuthIsPath))}}
|
|
|
|
<div class="field">
|
|
|
|
<label for="selectedMethod" class="is-label">
|
|
|
|
Method
|
|
|
|
</label>
|
|
|
|
<div class="control is-expanded" >
|
|
|
|
<div class="select is-fullwidth">
|
|
|
|
<select
|
|
|
|
name="selectedMethod"
|
|
|
|
id="selectedMethod"
|
|
|
|
onchange={{action (mut selectedAuth) value="target.value"}}
|
|
|
|
data-test-method-select
|
|
|
|
>
|
|
|
|
{{#each (supported-auth-backends) as |method|}}
|
|
|
|
<option selected={{eq selectedAuthBackend.type method.type}} value={{method.type}}>
|
|
|
|
{{method.typeDisplay}}
|
|
|
|
</option>
|
|
|
|
{{/each}}
|
|
|
|
</select>
|
2018-08-16 17:48:24 +00:00
|
|
|
</div>
|
2018-04-17 22:04:34 +00:00
|
|
|
</div>
|
2019-02-14 15:39:19 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{#if (or (eq this.selectedAuthBackend.type "jwt") (eq this.selectedAuthBackend.type "oidc"))}}
|
|
|
|
<AuthJwt
|
2019-04-09 17:42:51 +00:00
|
|
|
@onError={{action "handleError"}}
|
2019-02-14 15:39:19 +00:00
|
|
|
@onLoading={{action (mut this.isLoading)}}
|
|
|
|
@onToken={{action (mut this.token)}}
|
|
|
|
@namespace={{this.namespace}}
|
|
|
|
@onNamespace={{action (mut this.namespace)}}
|
|
|
|
@onSelectedAuth={{action (mut this.selectedAuth)}}
|
|
|
|
@onSubmit={{action "doSubmit"}}
|
|
|
|
@onRoleName={{action (mut this.roleName)}}
|
|
|
|
@roleName={{this.roleName}}
|
2019-03-05 16:03:54 +00:00
|
|
|
@selectedAuthType={{this.selectedAuthBackend.type}}
|
2019-02-14 15:39:19 +00:00
|
|
|
@selectedAuthPath={{or this.customPath this.selectedAuthBackend.id}}
|
|
|
|
@disabled={{authenticate.isRunning}}
|
|
|
|
>
|
|
|
|
<AuthFormOptions
|
|
|
|
@customPath={{this.customPath}}
|
|
|
|
@onPathChange={{action (mut this.customPath)}}
|
|
|
|
@selectedAuthIsPath={{this.selectedAuthIsPath}}
|
|
|
|
/>
|
|
|
|
</AuthJwt>
|
|
|
|
{{else}}
|
|
|
|
<form
|
|
|
|
id="auth-form"
|
|
|
|
onsubmit={{action "doSubmit"}}
|
|
|
|
>
|
|
|
|
{{partial providerPartialName}}
|
|
|
|
{{#if (not-eq selectedAuthBackend.type "token")}}
|
|
|
|
<AuthFormOptions
|
|
|
|
@customPath={{this.customPath}}
|
|
|
|
@onPathChange={{action (mut this.customPath)}}
|
|
|
|
@selectedAuthIsPath={{this.selectedAuthIsPath}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
<button data-test-auth-submit=true type="submit" disabled={{authenticate.isRunning}} class="button is-primary {{if authenticate.isRunning 'is-loading'}}" id="auth-submit">
|
|
|
|
Sign In
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
2018-08-16 17:48:24 +00:00
|
|
|
</div>
|