module Kongkit::Client::KeyAuthentication
Public Instance Methods
add_auth_key(identifier)
click to toggle source
Create a new Auth Key for the given consumer
@see getkong.org/plugins/key-authentication/ @param identifier [String] The unique identifier or the username of the consumer @return [Kongkit::Client::Resource] Auth Keys
# File lib/kongkit/client/key_authentication.rb, line 18 def add_auth_key(identifier) post(auth_key_path(identifier)) end
auth_keys(identifier)
click to toggle source
List Auth Keys for the given consumer
@see getkong.org/plugins/key-authentication/ @param identifier [String] The unique identifier or the username of the consumer @return [Kongkit::Client::Resource] Auth Keys
# File lib/kongkit/client/key_authentication.rb, line 9 def auth_keys(identifier) get(auth_key_path(identifier)) end
delete_auth_key(identifier, id)
click to toggle source
Delete Auth Key
@see getkong.org/docs/0.8.x/admin-api/#delete-consumer @param identifier [String] The unique identifier or the name of the consumer to delete @param id [String] The unique identifier of the Auth Key @return [Boolean] `true` if successfully deleted
# File lib/kongkit/client/key_authentication.rb, line 28 def delete_auth_key(identifier, id) delete("#{auth_key_path(identifier)}/#{id}") end
Private Instance Methods
auth_key_path(identifier)
click to toggle source
# File lib/kongkit/client/key_authentication.rb, line 34 def auth_key_path(identifier) "#{consumer_path(identifier)}/key-auth" end