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"]