lib/cli/credential_task.rb in factor-0.1.10 vs lib/cli/credential_task.rb in factor-0.3.1
- old
+ new
@@ -4,27 +4,35 @@
module Factor
module CLI
class CredentialTask < Command
- desc "set SERVICE NAME VALUE", "add a key and value for the credential"
+ desc "create SERVICE NAME VALUE", "add a key and value for the credential"
method_option :key, :type=>:string, :desc=>"File reference containing the symmetric key for encryption"
- def set(service,name,value)
- securet=nil
+ method_option :organization, :type=>:string, :desc=>"Organizoation to which this credential belongs"
+ def create(service,name,value)
+ secret=nil
if options[:key]
secret=File.read(options[:key])
end
- puts @client.set_credential(service,name,value,secret)
+ puts @client.create_credential(service,name,value,secret,options[:organization])
end
desc "list", "get all of the credential"
def list()
- puts @client.get_credentials()
+ @client.get_credentials["value"].each do |service,values|
+ # puts "#{credential['service']} : #{credential['name']} (#{credential['slug']}): #{credential['value']}"
+ puts "#{service}:"
+ values.each do |key,values|
+ # puts "#{key['value']} (#{value['slug']}) : #{value}"
+ puts " #{key} (#{values['slug']}): ***"
+ end
+ end
end
- desc "remove SERVICE NAME", "remove a value from the credentials bag"
- def remove(service,name)
- puts @client.remove_credential(service,name)
+ desc "delete SERVICE NAME", "remove a value from the credentials bag"
+ def delete(service,name)
+ puts @client.delete_credential(service,name)
end
end
end
end
\ No newline at end of file