Added SSH certificate support

This commit is contained in:
Douglas Temple 2017-02-23 11:21:18 +00:00
parent 44017069df
commit 09dfe7463e
2 changed files with 10 additions and 4 deletions

View File

@ -215,8 +215,14 @@ func (t *task) populateDetails() error {
func (t *task) installKey(key models.AccessKey) error {
t.log("access key " + key.Name + " installed")
err := ioutil.WriteFile(key.GetPath(), []byte(*key.Secret), 0600)
var path = key.GetPath()
err := ioutil.WriteFile(path, []byte(*key.Secret), 0600)
if key.Key != nil {
err2 := ioutil.WriteFile(path+"-cert.pub", []byte(*key.Key), 0600)
if err2 != nil {
return err2
}
}
return err
}

View File

@ -23,7 +23,7 @@
label.control-label.col-sm-4 Public Key
.col-sm-6
textarea.form-control(ng-model="key.key" rows="4")
p.help-text Public key is <strong>optional</strong> however you should set it so you can identify your private key by its fingerprint. Private keys are not available for reading later from the UI.
p.help-text Public key is <strong>optional</strong> (unless you are using SSH certificates) however you should set it so you can identify your private key by its fingerprint. Private keys are not available for reading later from the UI.
.form-group(ng-if="key.type == 'ssh'")
label.control-label.col-sm-4 Private Key
.col-sm-6
@ -56,4 +56,4 @@
button.btn.btn-success(ng-click="$close({ key: key })")
span(ng-if="!key.id") Create
span(ng-if="key.id") Update
button.btn.btn-default.pull-left(ng-click="$dismiss()") Dismiss
button.btn.btn-default.pull-left(ng-click="$dismiss()") Dismiss