Skip to content

Commit

Permalink
Add functional SSH generation to UI
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Scheel <[email protected]>
  • Loading branch information
cipherboy committed Feb 11, 2022
1 parent 6ee76cc commit 3d02735
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ui/app/models/secret-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ export default Model.extend(Validations, {
generateSigningKey: attr('boolean', {
defaultValue: true,
}),
keyType: attr('string', {
label: 'Key type',
possibleValues: [
'ssh-rsa',
'ecdsa-sha2-nistp256',
'ecdsa-sha2-nistp384',
'ecdsa-sha2-nistp521',
'ssh-ed25519',
],
defaultValue: 'ssh-rsa',
}),
keyBits: attr('number'),

saveCA(options) {
if (this.type !== 'ssh') {
Expand All @@ -179,14 +191,16 @@ export default Model.extend(Validations, {
this.setProperties({
privateKey: null,
publicKey: null,
keyType: null,
keyBits: null,
generateSigningKey: false,
});
}
return this.save({
adapterOptions: {
options: options,
apiPath: 'config/ca',
attrsToSend: ['privateKey', 'publicKey', 'generateSigningKey'],
attrsToSend: ['privateKey', 'publicKey', 'generateSigningKey', 'keyType', 'keyBits'],
},
});
},
Expand Down
16 changes: 16 additions & 0 deletions ui/app/templates/components/configure-ssh-secret.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,22 @@
</InfoTooltip>
</label>
</div>
<div class="field">
<label for="privateKey" class="is-label">
Key type
</label>
<div class="control">
<Textarea name="keyType" id="keyType" class="input" @value={{@model.keyType}} />
</div>
</div>
<div class="field">
<label for="keyBits" class="is-label">
Key bits
</label>
<div class="control">
<Textarea name="keyBits" id="keyBits" class="input" @value={{@model.keyBits}} />
</div>
</div>
</div>
<div class="field box is-fullwidth is-bottomless is-marginless">
<div class="control">
Expand Down

0 comments on commit 3d02735

Please sign in to comment.