Add ssh private key to CLI (#2265)
This commit is contained in:
1 parent
ef5ac07f02
commit
271cc8f781
13 files changed
+492
-28
No files matched your search
@@ -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"]
|
||||
|
||||
Reference in new issue
Block a user