Skip to content

Commit

Permalink
add http basic authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
egoholic committed Feb 22, 2011
1 parent 7815766 commit f8e9d4c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/controllers/free_relic/metrics_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
class FreeRelic::MetricsController < ApplicationController

LOGIN = 'root'
PASSWORD = 'root'

before_filter :authenticate

prepend_around_filter :mute_notifications

def index
Expand All @@ -15,4 +21,10 @@ def destroy
def mute_notifications
FreeRelic.mute! { yield }
end

def authenticate
authenticate_or_request_with_http_basic do |l, p|
l = LOGIN && p = PASSWORD
end
end
end

0 comments on commit f8e9d4c

Please sign in to comment.