Project

General

Profile

Actions

Bug #21299

closed

documentation of user_id in ssh_keys API controller is wrong

Added by Martin Bacovsky about 7 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Category:
Users, Roles and Permissions
Target version:
Difficulty:
easy
Triaged:
Fixed in Releases:
Found in Releases:

Description

In API v2 ssh_keys_controller in :index and :show method the 'user_id' parameter is documented as not required.

https://github.com/theforeman/foreman/blob/develop/app/controllers/api/v2/ssh_keys_controller.rb#L12
https://github.com/theforeman/foreman/blob/develop/app/controllers/api/v2/ssh_keys_controller.rb#L21

param :user_id, String, :desc => N_("ID of the user")

It is part of the resource URL and needs to be required. Wrong documentation leads to problems with parameter resolving in Hammer CLI.

hammer user ssh-keys delete --user admin --name test
Could not delete the SSH Key:
  missing param 'user_id' in parameters

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #20986: user_id parameter in ssh key create action is wrongly documentedClosedTomáš StrachotaActions
Actions

Also available in: Atom PDF