From 8edb19f97a5e41316783891b4f078ed30546966d Mon Sep 17 00:00:00 2001 From: John Cowen Date: Thu, 14 Apr 2022 17:13:13 +0100 Subject: [PATCH] ui: Adds support for AWS-IAM Auth Methods (#12786) * ui: Adds support for AWS-IAM Auth Methods * Changelog --- .changelog/12786.txt | 3 + .../components/consul/auth-method/index.scss | 6 ++ .../consul/auth-method/view/index.hbs | 60 +++++++++++++++++-- .../consul-ui/app/components/pill/index.scss | 4 ++ .../dc/acls/auth-methods/show/auth-method.hbs | 2 +- .../acls/auth-methods/show/binding-rules.hbs | 2 +- .../acls/auth-methods/show/nspace-rules.hbs | 8 +-- .../consul-ui/mock-api/v1/acl/auth-methods | 4 +- ui/packages/consul-ui/package.json | 1 + .../consul-ui/translations/common/en-us.yaml | 1 + ui/yarn.lock | 7 +++ 11 files changed, 84 insertions(+), 14 deletions(-) create mode 100644 .changelog/12786.txt diff --git a/.changelog/12786.txt b/.changelog/12786.txt new file mode 100644 index 000000000..ca772829e --- /dev/null +++ b/.changelog/12786.txt @@ -0,0 +1,3 @@ +```release-note:feature +ui: Added support for AWS IAM Auth Methods +``` diff --git a/ui/packages/consul-ui/app/components/consul/auth-method/index.scss b/ui/packages/consul-ui/app/components/consul/auth-method/index.scss index c1b862381..beff18a65 100644 --- a/ui/packages/consul-ui/app/components/consul/auth-method/index.scss +++ b/ui/packages/consul-ui/app/components/consul/auth-method/index.scss @@ -42,6 +42,12 @@ section dl { @extend %tabular-dl; } + section dt { + width: 30%; + } + section dd { + width: 70%; + } } // Binding List diff --git a/ui/packages/consul-ui/app/components/consul/auth-method/view/index.hbs b/ui/packages/consul-ui/app/components/consul/auth-method/view/index.hbs index 396aea1d7..e7f8f319c 100644 --- a/ui/packages/consul-ui/app/components/consul/auth-method/view/index.hbs +++ b/ui/packages/consul-ui/app/components/consul/auth-method/view/index.hbs @@ -37,16 +37,62 @@
Type
-
+
+ +
+ +{{#each (array "MaxTokenTTL" "TokenLocality" "DisplayName" "Description") as |value|}} + {{#if (get @item value)}} - {{#each (array "MaxTokenTTL" "TokenLocality" "DisplayName" "Description") as |value|}} - {{#if (get @item value)}}
{{t (concat "models.auth-method." value)}}
{{get @item value}}
- {{/if}} - {{/each}} - {{#if (eq @item.Type 'jwt')}} + {{/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)}} + +
{{t (concat "models.auth-method." value)}}
+
+{{#let + (get config value) +as |item|}} + {{#if (array-is-array item)}} +
    + {{#each item as |jtem|}} +
  • + {{jtem}} +
  • + {{/each}} +
+ {{else}} + {{item}} + {{/if}} +{{/let}} +
+ + {{/if}} + {{/each}} + +{{/let}} + + {{else if (eq @item.Type 'jwt')}} {{#if @item.Config.JWKSURL}}
{{t 'models.auth-method.Config.JWKSURL'}}
@@ -164,6 +210,7 @@
+ {{#if (not (eq @item.Type 'aws-iam'))}}
@@ -250,4 +297,5 @@ {{/if}}
{{/if}} +{{/if}} \ No newline at end of file diff --git a/ui/packages/consul-ui/app/components/pill/index.scss b/ui/packages/consul-ui/app/components/pill/index.scss index d7da1f0a5..cbeabfff1 100644 --- a/ui/packages/consul-ui/app/components/pill/index.scss +++ b/ui/packages/consul-ui/app/components/pill/index.scss @@ -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: ''; +} diff --git a/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/auth-method.hbs b/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/auth-method.hbs index 248122f06..cc28d28f6 100644 --- a/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/auth-method.hbs +++ b/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/auth-method.hbs @@ -1,5 +1,5 @@
diff --git a/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/binding-rules.hbs b/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/binding-rules.hbs index f12f996a0..f1e09e636 100644 --- a/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/binding-rules.hbs +++ b/ui/packages/consul-ui/app/templates/dc/acls/auth-methods/show/binding-rules.hbs @@ -1,5 +1,5 @@ {{#let route.model.item @@ -14,13 +14,13 @@ as |item|}}

- {{t 'routes.dc.acls.auth-methods.show.nspace-rules.index.empty.header'}} + {{compute (fn route.t 'empty.header')}}

- {{t 'routes.dc.acls.auth-methods.show.nspace-rules.index.empty.body' + {{compute (fn route.t 'empty.body' (hash htmlSafe=true - }} + ))}}