Bug #21299

documentation of user_id in ssh_keys API controller is wrong

Added by Martin Bacovsky 3 months ago. Updated 3 months ago.

Status:Closed
Priority:Normal
Assigned To:Martin Bacovsky
Category:Users
Target version:Team Ivan Iteration 21
Difficulty:easy Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/4907
Story points-
Velocity based estimate-
Release1.16.0Release relationshipAuto

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

Related to Foreman - Bug #20986: user_id parameter in ssh key create action is wrongly doc... Closed 09/18/2017

Associated revisions

Revision 5cb587b6
Added by Martin Bacovsky 3 months ago

Fixes #21299 - Make user_id required

user_id is part of the resource URL and needs to be mandatory.

Revision 9c4c00b1
Added by Martin Bacovsky 3 months ago

Fixes #21299 - Make user_id required

user_id is part of the resource URL and needs to be mandatory.

(cherry picked from commit 5cb587b6990ceb5f368e493f772c6748bd07f9c8)

History

#1 Updated by Martin Bacovsky 3 months ago

  • Subject changed from documentation of user_id in ssh_keys controller is wrong to documentation of user_id in ssh_keys API controller is wrong

#2 Updated by Martin Bacovsky 3 months ago

  • Status changed from New to Assigned
  • Assigned To set to Martin Bacovsky
  • Target version set to Team Ivan Iteration 21
  • Difficulty set to easy

#3 Updated by Marek Hulán 3 months ago

  • Related to Bug #20986: user_id parameter in ssh key create action is wrongly documented added

#4 Updated by Martin Bacovsky 3 months ago

  • Project changed from Hammer CLI to Foreman
  • Category changed from Users and roles to Users

#5 Updated by The Foreman Bot 3 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4907 added

#6 Updated by Timo Goebel 3 months ago

  • Release set to 1.16.0

#7 Updated by Martin Bacovsky 3 months ago

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

Also available in: Atom PDF