From c033a0ff259d89e937a371335d67b1975dca6354 Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 25 Jun 2013 17:34:25 -0700 Subject: lock version for allowed platform & add authorized_keys support --- lib/leap_cli/config/macros.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/leap_cli/config') diff --git a/lib/leap_cli/config/macros.rb b/lib/leap_cli/config/macros.rb index b3e7308..94ad034 100644 --- a/lib/leap_cli/config/macros.rb +++ b/lib/leap_cli/config/macros.rb @@ -262,5 +262,21 @@ module LeapCli; module Config end end + # + # creates a hash from the ssh key info in users directory, for use in updating authorized_keys file + # + def authorized_keys + hash = {} + Dir.glob(Path.named_path([:user_ssh, '*'])).sort.each do |keyfile| + ssh_type, ssh_key = File.read(keyfile).strip.split(" ") + name = File.basename(File.dirname(keyfile)) + hash[name] = { + "type" => ssh_type, + "key" => ssh_key + } + end + hash + end + end end; end -- cgit v1.2.3