Project

General

Profile

Bug #18779

API organization_id can only be numeric

Added by Daniel Lobato Garcia over 2 years ago. Updated about 1 year ago.

Status:
Ready For Testing
Priority:
Normal
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

In paths like 'api/v2/organizations/:organization_id/products', or 'api/v2/products?organization_id=:organization_id' when you try to use a name (e.g "ACMECORP") as the organization id, Foreman returns a 404.

However, the organization_id can be a name in most Foreman API paths and 'katello/api/v2/organizations/:organization_id'.

The problem is that the API controller is only searching by ID, but it should use the 'friendly' scope provided by 'friendly_id' to search by both name/label/id.

History

#1 Updated by Daniel Lobato Garcia over 2 years ago

  • Assignee set to Daniel Lobato Garcia

I actually have a fix for this already so just let me submit the patch :)

#2 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/6645 added

#3 Updated by The Foreman Bot over 2 years ago

  • Pull request https://github.com/Katello/katello/pull/6648 added

#4 Updated by Stephen Benjamin over 2 years ago

  • Pull request deleted (https://github.com/Katello/katello/pull/6648)

#5 Updated by Justin Sherrill over 2 years ago

  • Legacy Backlogs Release (now unused) set to 211

#6 Updated by Justin Sherrill over 2 years ago

  • Legacy Backlogs Release (now unused) changed from 211 to 114

Also available in: Atom PDF