ui: Adds support for AWS-IAM Auth Methods (#12786)

* ui: Adds support for AWS-IAM Auth Methods

* Changelog
This commit is contained in:
John Cowen 2022-04-14 17:13:13 +01:00 committed by GitHub
parent 7c74885180
commit 8edb19f97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 84 additions and 14 deletions

3
.changelog/12786.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:feature
ui: Added support for AWS IAM Auth Methods
```

View File

@ -42,6 +42,12 @@
section dl {
@extend %tabular-dl;
}
section dt {
width: 30%;
}
section dd {
width: 70%;
}
}
// Binding List

View File

@ -37,16 +37,62 @@
<section class="meta">
<dl>
<dt>Type</dt>
<dd><Consul::AuthMethod::Type @item={{@item}} /></dd>
<dd>
<Consul::AuthMethod::Type @item={{@item}} />
</dd>
{{#each (array "MaxTokenTTL" "TokenLocality" "DisplayName" "Description") as |value|}}
{{#each (array "MaxTokenTTL" "TokenLocality" "DisplayName" "Description") as |value|}}
{{#if (get @item value)}}
<dt>{{t (concat "models.auth-method." value)}}</dt>
<dd>{{get @item value}}</dd>
{{/if}}
{{/each}}
{{#if (eq @item.Type 'aws-iam')}}
{{#let
@item.Config
as |config|}}
{{#each (array
"BoundIAMPrincipalARNs"
"EnableIAMEntityDetails"
"IAMEntityTags"
"IAMEndpoint"
"MaxRetries"
"STSEndpoint"
"STSRegion"
"AllowedSTSHeaderValues"
"ServerIDHeaderValue"
) as |value|}}
{{#if (get config value)}}
<dt>{{t (concat "models.auth-method." value)}}</dt>
<dd>
{{#let
(get config value)
as |item|}}
{{#if (array-is-array item)}}
<ul>
{{#each item as |jtem|}}
<li>
<span>{{jtem}}</span>
</li>
{{/each}}
</ul>
{{else}}
{{item}}
{{/if}}
{{/let}}
</dd>
{{/if}}
{{/each}}
{{#if (eq @item.Type 'jwt')}}
{{/let}}
{{else if (eq @item.Type 'jwt')}}
{{#if @item.Config.JWKSURL}}
<dt>{{t 'models.auth-method.Config.JWKSURL'}}</dt>
<dd>
@ -164,6 +210,7 @@
</dl>
</section>
{{#if (not (eq @item.Type 'aws-iam'))}}
<hr />
<section class="claim-mappings">
@ -250,4 +297,5 @@
{{/if}}
</section>
{{/if}}
{{/if}}
</div>

View File

@ -32,3 +32,7 @@ span.policy-service-identity::before {
%pill.kubernetes::before {
@extend %with-logo-kubernetes-color-icon, %as-pseudo;
}
%pill.aws-iam::before {
--icon-name: icon-aws-color;
content: '';
}

View File

@ -1,5 +1,5 @@
<Route
@routeName={{routeName}}
@name={{routeName}}
as |route|>
<div class="tab-section">
<Consul::AuthMethod::View @item={{route.model.item}} />

View File

@ -1,5 +1,5 @@
<Route
@routeName={{routeName}}
@name={{routeName}}
as |route|>
<DataLoader @src={{

View File

@ -1,5 +1,5 @@
<Route
@routeName={{routeName}}
@name={{routeName}}
as |route|>
{{#let
route.model.item
@ -14,13 +14,13 @@ as |item|}}
<EmptyState>
<BlockSlot @name="header">
<h2>
{{t 'routes.dc.acls.auth-methods.show.nspace-rules.index.empty.header'}}
{{compute (fn route.t 'empty.header')}}
</h2>
</BlockSlot>
<BlockSlot @name="body">
{{t 'routes.dc.acls.auth-methods.show.nspace-rules.index.empty.body'
{{compute (fn route.t 'empty.body' (hash
htmlSafe=true
}}
))}}
</BlockSlot>
<BlockSlot @name="actions">
<li class="docs-link">

View File

@ -21,9 +21,9 @@ ${typeof location.search.partition !== 'undefined' ? `
"Partition": "${location.search.partition}",
` : ``}
${env('CONSUL_NSPACES_ENABLE', false) ? `
"Type": "${fake.helpers.randomize(['kubernetes', 'jwt', 'oidc'])}",
"Type": "${fake.helpers.randomize(['kubernetes', 'jwt', 'oidc', 'aws-iam'])}",
` : `
"Type": "${fake.helpers.randomize(['kubernetes', 'jwt'])}",
"Type": "${fake.helpers.randomize(['kubernetes', 'jwt', 'aws-iam'])}",
`}
"Description": "${fake.lorem.sentence()}",
${i%2 ? `

View File

@ -90,6 +90,7 @@
"d3-shape": "^2.0.0",
"dayjs": "^1.9.3",
"deepmerge": "^4.2.2",
"ember-array-fns": "^1.4.0",
"ember-assign-helper": "^0.3.0",
"ember-auto-import": "^1.5.3",
"ember-can": "^4.1.0",

View File

@ -5,6 +5,7 @@ brand:
nomad: Nomad
vault: Vault
aws: AWS
aws-iam: AWS IAM
kubernetes: Kubernetes
jwt: JWT
oidc: OIDC

View File

@ -6277,6 +6277,13 @@ elliptic@^6.5.3:
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"
ember-array-fns@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/ember-array-fns/-/ember-array-fns-1.4.0.tgz#92188edecb91c0b69c78e411f1b3339dfe0006a5"
integrity sha512-dKQ2wvuh+rVYhGsbR8pk8j9TX/Kqwf3sRehtJ+HqEi3VavH/WPPvsY2sH5nczYEtQwgkV1NAzgSzLr1iYj4uXQ==
dependencies:
ember-cli-babel "^7.7.3"
ember-assign-helper@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/ember-assign-helper/-/ember-assign-helper-0.3.0.tgz#7a023dd165ef56b28f77f70fd20e88261380aca7"