Sha256: 0b13538477315d7308ace8960e0c8986ca39602ea421f3cd89a10fb539effcdb

Contents?: true

Size: 754 Bytes

Versions: 11

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

class Gitlab::Client
  # Defines methods related to keys.
  # @see https://docs.gitlab.com/ce/api/keys.html
  module Keys
    # Gets information about a key.
    #
    # @example
    #   Gitlab.key(1)
    #
    # @param  [Integer] id The ID of a key.
    # @return [Gitlab::ObjectifiedHash]
    def key(id)
      get("/keys/#{id}")
    end

    # Gets information about a key by key fingerprint.
    #
    # @example
    #   Gitlab.key_by_fingerprint("9f:70:33:b3:50:4d:9a:a3:ef:ea:13:9b:87:0f:7f:7e")
    #
    # @param  [String] fingerprint The Fingerprint of a key.
    # @return [Gitlab::ObjectifiedHash]
    def key_by_fingerprint(fingerprint)
      get('/keys', query: { fingerprint: fingerprint })
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gitlab-5.1.0 lib/gitlab/client/keys.rb
gitlab-5.0.0 lib/gitlab/client/keys.rb
gitlab-4.20.1 lib/gitlab/client/keys.rb
gitlab-4.20.0 lib/gitlab/client/keys.rb
fs-gitlab-4.19.3 lib/gitlab/client/keys.rb
fs-gitlab-4.19.2 lib/gitlab/client/keys.rb
fs-gitlab-4.19.1 lib/gitlab/client/keys.rb
gitlab-4.19.0 lib/gitlab/client/keys.rb
fs-gitlab-4.18.2 lib/gitlab/client/keys.rb
fs-gitlab-4.18.1 lib/gitlab/client/keys.rb
gitlab-4.18.0 lib/gitlab/client/keys.rb