Project

General

Profile

Actions

Bug #3025

closed

Supplying no HTTP auth credentials results in server error

Added by Dominic Cleal over 10 years ago. Updated over 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Authentication
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

An error in the controller is showing up when accessing the API without supplying any credentials for HTTP auth.

$ curl -s -H 'Accept: application/json' http://0.0.0.0:3000/api/hosts | json_reformat 
{
    "error": {
        "message": "undefined method `user' for nil:NilClass" 
    }
}
Started GET "/api/hosts" for 127.0.0.1 at 2013-09-04 20:47:42 +0100
Processing by Api::V1::HostsController#index as JSON
undefined method `user' for nil:NilClass (NoMethodError)
/home/dcleal/code/foreman/foreman/app/controllers/api/base_controller.rb:81:in `authorize'

Related issues 1 (0 open1 closed)

Has duplicate Foreman - Bug #2855: API authentication controller does not fail gracefullyClosedOhad Levy07/29/2013Actions
Actions #1

Updated by Lukas Zapletal over 10 years ago

  • Target version changed from 1.3.0 to 1.4.0
Actions #2

Updated by Lukas Zapletal over 10 years ago

  • Has duplicate Bug #2855: API authentication controller does not fail gracefully added
Actions #3

Updated by Dominic Cleal over 10 years ago

  • Status changed from New to Duplicate
Actions #4

Updated by Dominic Cleal over 10 years ago

  • Target version deleted (1.4.0)
Actions

Also available in: Atom PDF