diff --git a/src/cb/logs.cr b/src/cb/logs.cr index 8b71017..2edb1cb 100644 --- a/src/cb/logs.cr +++ b/src/cb/logs.cr @@ -20,7 +20,12 @@ module CB socket = TCPSocket.new(tk.host, 22, connect_timeout: 1) ssh = SSH2::Session.new(socket) - ssh.login_with_data("cormorant", tk.private_key, tk.public_key) + + if tk.certificate.presence + ssh.login_with_data("cormorant", tk.private_key, tk.certificate.to_s) + else + ssh.login_with_data("cormorant", tk.private_key, tk.public_key) + end ch = ssh.open_session ch.shell diff --git a/src/cb/tempkey.cr b/src/cb/tempkey.cr index 8626801..1e752e0 100644 --- a/src/cb/tempkey.cr +++ b/src/cb/tempkey.cr @@ -1,5 +1,5 @@ module CB - record Tempkey, host : String, private_key : String, public_key : String, cluster_id : String, team_id : String, expires_at : Time do + record Tempkey, host : String, private_key : String, public_key : String, certificate : String?, cluster_id : String, team_id : String, expires_at : Time do Cacheable.include key: cluster_id def self.for_cluster(cluster_id : Identifier, client) : Tempkey