class RestBase::Authentication::BasicAuthentication

Public Class Methods

new(keys) click to toggle source
# File lib/rest_base/authentication/basic_authentication.rb, line 4
def initialize(keys)
  @valid_keys = keys
end

Public Instance Methods

authorized?(request, key) click to toggle source
# File lib/rest_base/authentication/basic_authentication.rb, line 8
def authorized?(request, key)
  authorized = true
  authorized = @valid_keys.include?(key) unless @valid_keys.length == 0
  authorized
end