Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icu 5651 create spk type #1266

Merged
merged 23 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bdf3901
feat: 🎸 Update the credentials route to support both types
lisbet-alvarez Aug 17, 2022
9ceb1a8
Merge branch 'main' of https://github.com/hashicorp/boundary-ui into …
lisbet-alvarez Aug 17, 2022
3e8f5a1
Merge branch 'main' of https://github.com/hashicorp/boundary-ui into …
lisbet-alvarez Aug 17, 2022
9b67d78
feat: 🎸 Create spk credential type
lisbet-alvarez Aug 17, 2022
f877b0a
Merge branch 'main' of https://github.com/hashicorp/boundary-ui into …
lisbet-alvarez Aug 18, 2022
bb754ca
Merge branch 'main' into ICU-5651-create-spk-type
lisbet-alvarez Aug 18, 2022
da09c32
refactor: πŸ’‘ clean-up credential component forms
lisbet-alvarez Aug 18, 2022
d523422
Merge branch 'ICU-5651-create-spk-type' of https://github.com/hashico…
lisbet-alvarez Aug 18, 2022
a8ea58c
Update ui/admin/app/components/form/credential/ssh_private_key/index.hbs
lisbet-alvarez Aug 18, 2022
e341c3f
fix: πŸ› rename attribute in credential create test
lisbet-alvarez Aug 18, 2022
af988bf
Merge branch 'main' into ICU-5651-create-spk-type
lisbet-alvarez Aug 19, 2022
2fe1574
fix: πŸ› add changed to serializer and normalizer for credentials
lisbet-alvarez Aug 19, 2022
5c47a6e
Merge branch 'ICU-5651-create-spk-type' of https://github.com/hashico…
lisbet-alvarez Aug 19, 2022
247497e
refactor: πŸ’‘ change serializer for credential
lisbet-alvarez Aug 19, 2022
535c5b6
fix: πŸ› query param resets to default type when exiting route
lisbet-alvarez Aug 20, 2022
35f4c7b
refactor: πŸ’‘ change serializer to serialize by type and by attr
lisbet-alvarez Aug 20, 2022
ac1adec
Update addons/api/addon/serializers/credential.js
lisbet-alvarez Aug 22, 2022
178e08e
Update addons/api/addon/serializers/credential.js
lisbet-alvarez Aug 22, 2022
7c53d1e
refactor: πŸ’‘ remove code that sets default value for queryParam
lisbet-alvarez Aug 22, 2022
0d0a8d2
Merge branch 'ICU-5651-create-spk-type' of https://github.com/hashico…
lisbet-alvarez Aug 22, 2022
cade91d
Update addons/api/addon/serializers/credential.js
lisbet-alvarez Aug 23, 2022
9d73c9e
refactor: πŸ’‘ change bracket notation to dot notation
lisbet-alvarez Aug 23, 2022
243e269
Merge branch 'main' into ICU-5651-create-spk-type
lisbet-alvarez Aug 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions addons/core/translations/resources/en-us.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,20 @@ credential:
ssh_private_key: Username & Key Pair
help:
username_password: This host requires a username and password to connect.
ssh_private_key: This host requires a username, public key, and private key to connect.
form:
username:
label: Username
help: The username to use when connecting with this credential store.
password:
label: Password
help: The password to use when signing in with this credential store.
ssh_private_key:
label: SSH Private Key
help: The private key to use when connecting with this credential store.
passphrase:
label: Pass phrase
help: Optional.
scope:
title: Scope
title_plural: Scopes
Expand Down
127 changes: 9 additions & 118 deletions ui/admin/app/components/form/credential/index.hbs
Original file line number Diff line number Diff line change
@@ -1,118 +1,9 @@
<Rose::Form
@onSubmit={{@submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
@showEditToggle={{if @model.isNew false true}}
as |form|
>

<form.input
@name='name'
@type='name'
@value={{@model.name}}
@label={{t 'form.name.label'}}
@error={{@model.errors.name}}
@helperText={{t 'form.name.help'}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.name}}
<field.errors as |errors|>
{{#each @model.errors.name as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.input>

<form.textarea
@name='description'
@type='description'
@value={{@model.description}}
@label={{t 'form.description.label'}}
@error={{@model.errors.description}}
@helperText={{t 'form.description.help'}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.description}}
<field.errors as |errors|>
{{#each @model.errors.description as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.textarea>
<form.fieldset>
<:title>{{t 'form.type.label'}}</:title>
<:body>
<form.radioGroup
@name='types'
@selectedValue='username_password'
@changed={{@changeType}}
as |radioGroup|
>
<radioGroup.card
@label={{t 'resources.credential.types.username_password'}}
@helperText={{t 'resources.credential.help.username_password'}}
@value='username_password'
@layout='wide'
readonly={{true}}
@disabled={{true}}
/>
</form.radioGroup>
</:body>
</form.fieldset>

<form.input
@name='username'
@type='username'
@value={{@model.username}}
@label={{t 'form.username.label'}}
@error={{@model.errors.username}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.username}}
<field.errors as |errors|>
{{#each @model.errors.username as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.input>

{{#if (or @model.isNew form.isEditable)}}
<form.input
@name='password'
@type='password'
@value={{@model.password}}
@label={{t 'form.password.label'}}
@error={{@model.errors.password}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.password}}
<field.errors as |errors|>
{{#each @model.errors.password as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.input>
{{/if}}

{{#if (can 'save model' @model)}}
<form.actions
@disabled={{if @model.cannotSave @model.cannotSave}}
@enableEditText={{t 'actions.edit-form'}}
@submitText={{t 'actions.save'}}
@cancelText={{t 'actions.cancel'}}
/>
{{/if}}

</Rose::Form>
{{#if @model.type}}
{{component
(concat 'form/credential/' @model.type)
model=@model
submit=@submit
cancel=@cancel
changeType=@changeType
}}
{{/if}}
161 changes: 161 additions & 0 deletions ui/admin/app/components/form/credential/ssh_private_key/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<Rose::Form
@onSubmit={{@submit}}
@cancel={{@cancel}}
@disabled={{@model.isSaving}}
@error={{@model.errors.base}}
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@showEditToggle={{if @model.isNew false true}}
as |form|
>

<form.input
@name='name'
@type='name'
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@value={{@model.name}}
@label={{t 'form.name.label'}}
@error={{@model.errors.name}}
@helperText={{t 'form.name.help'}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.name}}
<field.errors as |errors|>
{{#each @model.errors.name as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.input>

<form.textarea
@name='description'
@type='description'
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@value={{@model.description}}
@label={{t 'form.description.label'}}
@error={{@model.errors.description}}
@helperText={{t 'form.description.help'}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.description}}
<field.errors as |errors|>
{{#each @model.errors.description as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.textarea>
<form.fieldset>
<:title>{{t 'form.type.label'}}</:title>
<:body>
{{#if @model.isNew}}
<form.radioGroup
@name='types'
@selectedValue={{@model.type}}
@changed={{@changeType}}
as |radioGroup|
>
<radioGroup.card
@label={{t 'resources.credential.types.username_password'}}
@helperText={{t 'resources.credential.help.username_password'}}
@value='username_password'
@layout='wide'
/>
<radioGroup.card
@label={{t 'resources.credential.types.ssh_private_key'}}
@helperText={{t 'resources.credential.help.ssh_private_key'}}
@value='ssh_private_key'
@layout='wide'
/>
</form.radioGroup>
{{else}}
<form.radioGroup
@name='types'
@selectedValue={{@model.type}}
as |radioGroup|
>
<radioGroup.card
@label={{t (concat 'resources.credential.types.' @model.type)}}
@helperText={{t (concat 'resources.credential.help.' @model.type)}}
@value={{@model.type}}
@layout='wide'
@disabled={{true}}
readonly={{true}}
/>
</form.radioGroup>
{{/if}}
</:body>
</form.fieldset>

<form.input
@name='username'
@type='username'
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@value={{@model.username}}
@label={{t 'resources.credential.form.username.label'}}
@helperText={{t 'resources.credential.form.username.help'}}
@error={{@model.errors.username}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.username}}
<field.errors as |errors|>
{{#each @model.errors.username as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.input>

{{#if (or @model.isNew form.isEditable)}}
<form.textarea
@name='ssh_private_key'
@type='ssh_private_key'
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@value={{@model.ssh_private_key}}
@label={{t 'resources.credential.form.ssh_private_key.label'}}
@helperText={{t 'resources.credential.form.ssh_private_key.help'}}
@error={{@model.errors.ssh_private_key}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.ssh_private_key}}
<field.errors as |errors|>
{{#each @model.errors.ssh_private_key as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.textarea>
<form.textarea
@name='passphrase'
@type='passphrase'
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@value={{@model.passphrase}}
@label={{t 'resources.credential.form.passphrase.label'}}
@helperText={{t 'resources.credential.form.passphrase.help'}}
@error={{@model.errors.passphrase}}
disabled={{@model.isSaving}}
readonly={{false}}
as |field|
>
{{#if @model.errors.passphrase}}
<field.errors as |errors|>
{{#each @model.errors.passphrase as |error|}}
<errors.message>{{error.message}}</errors.message>
{{/each}}
</field.errors>
{{/if}}
</form.textarea>
{{/if}}

{{#if (can 'save model' @model)}}
<form.actions
@disabled={{if @model.cannotSave @model.cannotSave}}
lisbet-alvarez marked this conversation as resolved.
Show resolved Hide resolved
@enableEditText={{t 'actions.edit-form'}}
@submitText={{t 'actions.save'}}
@cancelText={{t 'actions.cancel'}}
/>
{{/if}}

</Rose::Form>
Loading