Add ssh private key to CLI (#2265)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2022-07-19 16:58:03 -04:00
1 parent ef5ac07f02
commit 271cc8f781
13 files changed
+492 -28

No files matched your search

+24
View File
@@ -122,6 +122,30 @@ func WithUsernamePasswordCredentialPassword(inPassword string) Option {
}
}
func WithSshPrivateKeyCredentialPrivateKey(inPrivateKey string) Option {
return func(o *options) {
raw, ok := o.postMap["attributes"]
if !ok {
raw = interface{}(map[string]interface{}{})
}
val := raw.(map[string]interface{})
val["private_key"] = inPrivateKey
o.postMap["attributes"] = val
}
}
func WithSshPrivateKeyCredentialUsername(inUsername string) Option {
return func(o *options) {
raw, ok := o.postMap["attributes"]
if !ok {
raw = interface{}(map[string]interface{}{})
}
val := raw.(map[string]interface{})
val["username"] = inUsername
o.postMap["attributes"] = val
}
}
func WithUsernamePasswordCredentialUsername(inUsername string) Option {
return func(o *options) {
raw, ok := o.postMap["attributes"]
@@ -0,0 +1,8 @@
// Code generated by "make api"; DO NOT EDIT.
package credentials
type SshPrivateKeyAttributes struct {
Username string `json:"username,omitempty"`
PrivateKey string `json:"private_key,omitempty"`
PrivateKeyHmac string `json:"private_key_hmac,omitempty"`
}