Bug #18779
API organization_id can only be numeric
Status:
Ready For Testing
Priority:
Normal
Assignee:
Category:
API
Target version:
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 about 5 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 about 5 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 about 5 years ago
- Pull request https://github.com/Katello/katello/pull/6648 added
#4
Updated by Stephen Benjamin about 5 years ago
- Pull request deleted (
https://github.com/Katello/katello/pull/6648)
#5
Updated by Justin Sherrill about 5 years ago
- Legacy Backlogs Release (now unused) set to 211
#6
Updated by Justin Sherrill about 5 years ago
- Legacy Backlogs Release (now unused) changed from 211 to 114