Closed kibernetik542 closed 4 years ago
I have checker for valid ssh key in my api.
When I try wrong values it works
user@Arzus-MBP TaikunCLI % dotnet run taikun check ssh --sshPublicKey ksddksmkd Response Status Code: 400 { "status":400, "detail":"Invalid ssh key" }
But good ssh key looks likessh-rsa AAAA.....
ssh-rsa AAAA.....
And in this case client can not read space based string and throws error
dotnet run taikun check ssh --sshPublicKey ssh-rsa AAAAB3NzaC1yc2EAAA.... Option --sshPublicKey expects a single value, but provided with multiple: "ssh-rsa" "AAAAB3NzaC1yc2EAAAADAQABAAABAQDDT+a7kPwhnTgyF4ygu4D8Zk2GpwpM4qRxzGr48RSklgeL/iQZgiz2IFp6ns9k2pYiUII6J65fM4Im24uJqdIQiz2lg7mWHz5hVnKrFH3v8QvJRsxsQtW9iZYMt7WvmSxi5O5UUH+6oJX8ErpkjNGNL7DTia27n5iXD8pkpLr3lXKuQ2UX47IlXQGG/zG2zhZglsHhs/vn/ozYccNDg2zkyZzAnpK6gDRn6gBWgKjhmFSfXwsJOHpfvWAx7omC3cBEbBy8q5y4BLkwyElSV0UgxnhuMiEawMe7NnhCwRiI5+f+C8UYK2mvvuaUlFZ5Ph3JkFHS6JFLMllobPbe2VBB" "arzu@DESKTOP-H74NH8G" Usage dotnet TaikunCLI.dll taikun check ssh --sshPublicKey <value> [options] Options * --sshPublicKey -h|--help Shows help text.
P.S. Works fine in swagger, postman, curl etc.
My code looks like:
[Command("taikun check ssh")] public class Ssh : BaseOperation, ICommand { public Ssh(ITaikunWebApi taikunClient) : base(taikunClient) { } [CommandOption("sshPublicKey", IsRequired = true)] public string SshPublicKey { get; set; } public async ValueTask ExecuteAsync(IConsole console) { var command = new SshKeyCommand { SshPublicKey = SshPublicKey }; var httpResponse = await taikunClient.Checker.SshWithHttpMessagesAsync("1", command); await PrintResponse(console, httpResponse); } }
With putting double quote it worked
I have checker for valid ssh key in my api.
When I try wrong values it works
But good ssh key looks like
ssh-rsa AAAA.....
And in this case client can not read space based string and throws error
P.S. Works fine in swagger, postman, curl etc.
My code looks like: