Project

General

Profile

Actions

Bug #20120

closed

Poor logging of 403 - forbidden responses

Added by Tomáš Strachota over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

When user has insufficient permissions for some action and the foreman replies 403, hammer prints quite a poor message without telling the user what permissions are required (even though server provides such info).

# With user without "View hosts" permissions:
> hammer -u test host list
Forbidden - server refused to process the request

The response from the server:

[ERROR 2017-06-27T11:15:48 API] 403 Forbidden
[DEBUG 2017-06-27T11:15:48 API] {
    "error" => {
        "message" => "Access denied",
        "details" => "Missing one of the required permissions: view_hosts" 
    }
}
[DEBUG 2017-06-27T11:15:48 Exception] Using exception handler HammerCLIForeman::ExceptionHandler#handle_forbidden
[ERROR 2017-06-27T11:15:48 Exception] Forbidden - server refused to process the request

Expected results:

> hammer -u test host list
Access denied
Missing one of the required permissions: view_hosts

Actions #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/314 added
Actions #2

Updated by Marek Hulán over 7 years ago

  • Target version changed from 1.14.0 to 1.14.3
Actions #3

Updated by Marek Hulán over 7 years ago

  • Target version changed from 1.14.3 to 1.17.0-RC2
Actions #4

Updated by Marek Hulán over 7 years ago

  • Target version changed from 1.17.0-RC2 to 1.18.0-RC2
Actions #5

Updated by Marek Hulán about 7 years ago

  • Target version changed from 1.18.0-RC2 to 214
Actions #6

Updated by Anonymous about 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF