Sha256: 1d7108c2a8b9743e6070d8afc5ca99a163ddadf9d3689f441920cdb429fc53f1

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

require 'learn_web/client/ssh_keys/add'

module LearnWeb
  class Client
    module SshKeys
      def add_ssh_key_endpoint
        "#{API_ROOT}/ssh_keys"
      end

      def add_ssh_key(key:, key_title: nil, client: nil)
        response = post(
          add_ssh_key_endpoint,
          headers: { 'Authorization' => "Bearer #{token}" },
          params: { 'key' => key, key_title: key_title }.compact,
          client: client
        )

        LearnWeb::Client::SshKeys::Add.new(response).parse!
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
learn-web-1.5.2 lib/learn_web/client/ssh_keys.rb