DRY Up Rails HTTP Basic Auth
There is not much to say, just two notes:


Common mistake of redundant boolean check: some_boolean ? true : false -> some_boolean. 
You can either use the bang find method or check the returned value, but not just use without a check.


So simply:

def authenticate!
  authenticate_or_request_with_http_basic do |access_key, secret_key|
    @current_app = App.find_by_access_key(access_key)
    @current_app &amp;&amp; @current_app.secret_key == secret_key
  end
end