Actions
Bug #27542
closed/katello/api/srpms does not gives error on undefined parameter
Status:
Duplicate
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Description
/katello/api/srpms does not gives error on undefined parameter
Steps:
1. Create a yum repo.
2. Upload SRPM into that.
3. Try to list SRPM (i.e. here I am trying to list organization wise) and same happens for organization_id/repository_id/environment_id prams too.
a. When passing correct param(organization_id):
[vagrant@srpm-centos7-hammer-devel ~]$ curl --header "Accept:application/json,version=2" --header "Content-Type:application/json" --request GET --insecure --user admin:changeme https://srpm-centos7-katello-devel.vijsingh.example.com/katello/api/srpms --data "{\"organization_id\":[5]}"|python -m json.tool|grep nvr
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 772 0 749 100 23 1922 59 --:--:-- --:--:-- --:--:-- 1920
"nvra": "sasutils-0.3.9-2.el7.src",
"nvra": "SDL2_net-2.0.1-2.el7.src",
b. When passing incorrect params(organization_id1) then it does not gives the error i.e. undefined param or method.
[vagrant@srpm-centos7-hammer-devel ~]$ curl --header "Accept:application/json,version=2" --header "Content-Type:application/json" --request GET --insecure --user admin:changeme https://srpm-centos7-katello-devel.vijsingh.example.com/katello/api/srpms --data "{\"organization_id1\":[5]}"|python -m json.tool|grep nvr
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1468 0 1444 100 24 3450 57 --:--:-- --:--:-- --:--:-- 3446
"nvra": "sasutils-0.3.9-2.el7.src",
"nvra": "SDL2_net-2.0.1-2.el7.src",
"nvra": "viewvc-1.1.26-1.el7.src",
"nvra": "VMDKstream-0.3-1.el7.src",
Updated by Vijay Singh over 5 years ago
- Related to Tracker #27539: [Tracker] SRPM Issues added
Updated by Chris Roberts over 5 years ago
- Target version set to Katello 3.14.0
- Triaged changed from No to Yes
Updated by Ian Ballou about 5 years ago
- Assignee changed from Chris Roberts to Ian Ballou
Updated by Ian Ballou about 5 years ago
This is actually an issue with the Foreman API in general. Currently we don't use Rails strong_parameters, and it takes a bit of effort to switch over to using them. I'm setting this as a duplicate of https://projects.theforeman.org/issues/22285.
Updated by Ian Ballou about 5 years ago
- Is duplicate of Feature #22285: Present error message when passing integer when array expected for API call added
Actions