Skip to content

Commit

Permalink
Merge branch 'main' into ICU-15854-check-if-static-json-blobs-nested-…
Browse files Browse the repository at this point in the history
…data-needs-to-flattened-into-key-value
  • Loading branch information
DhariniJeeva authored Dec 11, 2024
2 parents 02b3172 + 2869020 commit 0943456
Show file tree
Hide file tree
Showing 40 changed files with 1,045 additions and 212 deletions.
24 changes: 24 additions & 0 deletions addons/core/translations/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,27 @@ settings:
alerts:
cache-daemon: There may be a problem with the cache daemon
client-agent: There may be a problem with the client agent
worker-filter-generator:
toggle:
title: Show filter generator
description: The generator will automatically generate a pre-formatted filter for you. You can copy the result to the editor above.
filter-generator:
title: Filter generator
description: Choose what you want to format into a filter.
link: Learn more about formatting a worker filter.
input-values:
title: Input values
description: Next, input what you want to format.
formatted-result:
title: Formatted result
description: Copy and paste this into the editor above.
label: Generated result
tag:
label: Tag
helper: Format a worker tag
name:
label: Name
helper: Format a worker name
operator:
matches: matches
contains: contains
2 changes: 2 additions & 0 deletions addons/core/translations/form/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ key:
label: Key
value:
label: Value
operator:
label: Operator
callback_url:
label: Callback URL
help: The URL to which the third-party provider sends the authentication response. Paste this into the provider configuration.
Expand Down
15 changes: 14 additions & 1 deletion addons/core/translations/resources/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ storage-bucket:
help: The secret access key generated by your storage provider for the IAM user to use with this storage bucket. We will not show this data after it is saved, but you can replace it.
worker_filter:
label: Worker filter
help: Filter for Boundary workers that have network access to your storage. Boolean expression.
help: Filters to the worker(s) that can handle requests for this storage bucket.
disable_credential_rotation:
label: Disable credential rotation
help: Disabling credential rotation could allow entities outside of Boundary to know the client secret in use.
Expand Down Expand Up @@ -819,6 +819,7 @@ target:
ingress-workers: Ingress workers
actions:
edit-worker-filter: Edit worker filter
add-worker-filter: Add worker filter
credential-store:
title: Credential Store
title_plural: Credential Stores
Expand All @@ -828,8 +829,20 @@ credential-store:
title: Welcome to Credential Stores
titles:
new: New Credential Store
worker-filter:
title: Worker Filter
description: The worker filter format for this credential store.
messages:
none:
title: No worker filter added
description: You haven't added a worker filter yet.
edit:
title: Edit Worker Filter
description: Specify workers that have access to the credential store.
actions:
add: Add Worker Filter
delete: Delete Credential Store
edit: Edit Worker Filter
types:
vault: Vault
static: Static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
{{t 'resources.credential.actions.create'}}
</dd.Interactive>
{{/if}}
{{#if (and (feature-flag 'vault-worker-filter') @model.isVault)}}
<dd.Interactive
@route='scopes.scope.credential-stores.credential-store.edit-worker-filter'
@text={{t 'resources.credential-store.actions.edit'}}
/>
{{/if}}
{{#if (can 'delete model' @model)}}
<dd.Separator />
<dd.Interactive @color='critical' {{on 'click' @delete}}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
{{t 'titles.details'}}
</nav.link>
{{#if @model.isVault}}
{{#if (feature-flag 'vault-worker-filter')}}
<nav.link
@route='scopes.scope.credential-stores.credential-store.worker-filter'
>
{{t 'resources.credential-store.worker-filter.title'}}
</nav.link>
{{/if}}
{{#if (can 'navigate model' @model collection='credential-libraries')}}
<nav.link
@route='scopes.scope.credential-stores.credential-store.credential-libraries'
Expand Down
29 changes: 0 additions & 29 deletions ui/admin/app/components/form/credential-store/vault/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -115,35 +115,6 @@
{{/if}}
</Hds::Form::TextInput::Field>

{{#if (feature-flag 'vault-worker-filter')}}
<Hds::Form::TextInput::Field
name='worker_filter'
@value={{@model.worker_filter}}
@isOptional={{true}}
@isInvalid={{@model.errors.worker_filter}}
disabled={{form.disabled}}
{{on 'input' (set-from-event @model 'worker_filter')}}
as |F|
>
<F.Label>
{{t 'resources.credential-store.form.worker_filter.label'}}
</F.Label>
<F.HelperText>
{{t 'resources.credential-store.form.worker_filter.help'}}
<Hds::Link::Inline @href={{doc-url 'worker-filters'}}>
{{t 'actions.learn-more'}}
</Hds::Link::Inline>
</F.HelperText>
{{#if @model.errors.worker_filter}}
<F.Error as |E|>
{{#each @model.errors.worker_filter as |error|}}
<E.Message>{{error.message}}</E.Message>
{{/each}}
</F.Error>
{{/if}}
</Hds::Form::TextInput::Field>
{{/if}}

{{#if (or @model.isNew form.isEditable)}}
<Hds::Form::TextInput::Field
name='token'
Expand Down
59 changes: 35 additions & 24 deletions ui/admin/app/components/form/storage-bucket/aws/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -456,30 +456,41 @@
{{/if}}

{{! worker_filter }}
<Hds::Form::TextInput::Field
name='worker_filter'
@isRequired={{true}}
@value={{@model.worker_filter}}
@isInvalid={{@model.errors.worker_filter}}
disabled={{form.disabled}}
{{on 'input' (set-from-event @model 'worker_filter')}}
as |F|
>
<F.Label>{{t 'resources.storage-bucket.form.worker_filter.label'}}</F.Label>
<F.HelperText>
{{t 'resources.storage-bucket.form.worker_filter.help'}}
<Hds::Link::Inline @href={{doc-url 'storage-bucket.worker-filter'}}>
{{t 'actions.learn-more'}}
</Hds::Link::Inline>
</F.HelperText>
{{#if @model.errors.worker_filter}}
<F.Error data-test-worker-filter-error as |E|>
{{#each @model.errors.worker_filter as |error|}}
<E.Message>{{error.message}}</E.Message>
{{/each}}
</F.Error>
{{/if}}
</Hds::Form::TextInput::Field>
{{#let (unique-id) (unique-id) as |labelId helpId|}}
<Hds::Form::Fieldset
aria-labelledby={{labelId}}
aria-describedby={{helpId}}
class='storage-bucket-worker-filter'
@isRequired={{true}}
as |F|
>
<F.Legend id={{labelId}}>{{t
'resources.storage-bucket.form.worker_filter.label'
}}</F.Legend>
<F.HelperText id={{helpId}}>
{{t 'resources.storage-bucket.form.worker_filter.help'}}
<Hds::Link::Inline @href={{doc-url 'storage-bucket.worker-filter'}}>
{{t 'actions.learn-more'}}
</Hds::Link::Inline>
</F.HelperText>
<F.Control>
{{#if form.disabled}}
<Hds::CodeBlock
@language='bash'
@value={{@model.worker_filter}}
@hasCopyButton={{true}}
data-test-worker-filter
/>
{{else}}
<WorkerFilterGenerator
@model={{@model}}
@name='worker_filter'
@hideToolbar={{true}}
/>
{{/if}}
</F.Control>
</Hds::Form::Fieldset>
{{/let}}

{{! JUST for static credentials }}
{{#unless this.showDynamicCredentials}}
Expand Down
5 changes: 3 additions & 2 deletions ui/admin/app/components/form/storage-bucket/aws/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ import { tracked } from '@glimmer/tracking';

export default class FormStorageBucketAwsIndexComponent extends Component {
// =attributes
@tracked selectedCredentialType = this.args.model.credentialType;

@tracked selectedCredentialType = this.args.model.credentialType;
@tracked showDynamicCredentials =
this.args.model.credentialType === TYPE_CREDENTIAL_DYNAMIC;

/**
* returns an array of available credential types
* @type {array}
Expand All @@ -28,7 +29,7 @@ export default class FormStorageBucketAwsIndexComponent extends Component {
// =actions
/**
* Allows to update the credential type
* @param type {string}
* @param {string} type
*/
@action
updateCredentialTypeSelection(type) {
Expand Down
60 changes: 36 additions & 24 deletions ui/admin/app/components/form/storage-bucket/minio/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -315,30 +315,42 @@
{{/if}}

{{! worker_filter }}
<Hds::Form::TextInput::Field
name='worker_filter'
@isRequired={{true}}
@value={{@model.worker_filter}}
@isInvalid={{@model.errors.worker_filter}}
disabled={{form.disabled}}
{{on 'input' (set-from-event @model 'worker_filter')}}
as |F|
>
<F.Label>{{t 'resources.storage-bucket.form.worker_filter.label'}}</F.Label>
<F.HelperText>
{{t 'resources.storage-bucket.form.worker_filter.help'}}
<Hds::Link::Inline @href={{doc-url 'storage-bucket.worker-filter'}}>
{{t 'actions.learn-more'}}
</Hds::Link::Inline>
</F.HelperText>
{{#if @model.errors.worker_filter}}
<F.Error data-test-worker-filter-error as |E|>
{{#each @model.errors.worker_filter as |error|}}
<E.Message>{{error.message}}</E.Message>
{{/each}}
</F.Error>
{{/if}}
</Hds::Form::TextInput::Field>
{{#let (unique-id) (unique-id) as |labelId helpId|}}
<Hds::Form::Fieldset
aria-labelledby={{labelId}}
aria-describedby={{helpId}}
class='storage-bucket-worker-filter'
@isRequired={{true}}
as |F|
>
<F.Legend id={{labelId}}>{{t
'resources.storage-bucket.form.worker_filter.label'
}}</F.Legend>
<F.HelperText {{helpId}}>
{{t 'resources.storage-bucket.form.worker_filter.help'}}
<Hds::Link::Inline @href={{doc-url 'storage-bucket.worker-filter'}}>
{{t 'actions.learn-more'}}
</Hds::Link::Inline>
</F.HelperText>
<F.Control>
{{#if form.disabled}}
<Hds::CodeBlock
@maxHeight='300px'
@language='bash'
@value={{@model.worker_filter}}
@hasCopyButton={{true}}
data-test-worker-filter
/>
{{else}}
<WorkerFilterGenerator
@model={{@model}}
@name='worker_filter'
@hideToolbar={{true}}
/>
{{/if}}
</F.Control>
</Hds::Form::Fieldset>
{{/let}}

{{! disable_credential_rotation }}
<Hds::Form::Checkbox::Field
Expand Down
21 changes: 21 additions & 0 deletions ui/admin/app/components/form/worker-filter/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}

<Rose::Form
class='full-width'
@onSubmit={{@submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
as |form|
>
<WorkerFilterGenerator @model={{@model}} @name={{@name}} />

{{#if (can 'save model' @model)}}
<form.actions
@submitText={{t 'actions.save'}}
@cancelText={{t 'actions.cancel'}}
/>
{{/if}}
</Rose::Form>
Loading

0 comments on commit 0943456

Please sign in to comment.