lib/cabal/api/v1/public_key.rb in cabal-api-0.0.1 vs lib/cabal/api/v1/public_key.rb in cabal-api-0.0.3
- old
+ new
@@ -1,23 +1,13 @@
require 'grape'
-require 'cabal/cluster'
require 'cabal/util'
+require 'cabal/api/common'
module Cabal
module API
module V1
class PublicKey < Grape::API
- formatter :txt, ->(object, env) {
- object[:public_ssh_key]
- }
-
- get '/key/:name' do
- name = Cabal::Util.normalize(params[:name])
- {
- name: name,
- public_ssh_key: Cabal::Cluster.new(name).public_ssh_key
- }
- end
+ include Cabal::API::Common::PublicKey
end
end
end
end