Module: Kongkit::Client::KeyAuthentication

Included in:
Kongkit::Client
Defined in:
lib/kongkit/client/key_authentication.rb

Instance Method Summary collapse

Instance Method Details

#add_auth_key(identifier) ⇒ Kongkit::Client::Resource

Create a new Auth Key for the given consumer

Parameters:

  • identifier (String)

    The unique identifier or the username of the consumer

Returns:

See Also:


18
19
20
# File 'lib/kongkit/client/key_authentication.rb', line 18

def add_auth_key(identifier)
  post(auth_key_path(identifier))
end

#auth_keys(identifier) ⇒ Kongkit::Client::Resource

List Auth Keys for the given consumer

Parameters:

  • identifier (String)

    The unique identifier or the username of the consumer

Returns:

See Also:


9
10
11
# File 'lib/kongkit/client/key_authentication.rb', line 9

def auth_keys(identifier)
  get(auth_key_path(identifier))
end

#delete_auth_key(identifier, id) ⇒ Boolean

Delete Auth Key

Parameters:

  • identifier (String)

    The unique identifier or the name of the consumer to delete

  • id (String)

    The unique identifier of the Auth Key

Returns:

  • (Boolean)

    `true` if successfully deleted

See Also:


28
29
30
# File 'lib/kongkit/client/key_authentication.rb', line 28

def delete_auth_key(identifier, id)
  delete("#{auth_key_path(identifier)}/#{id}")
end